All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Register

Login

All New Register Login

nuno

Joined 6 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 584

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::fw::list() {
2 local peer="" type=""
3 local show_nflog=true show_accept=true show_drop=true
4
5 while [[ $# -gt 0 ]]; do
6 case "$1" in
7 --peer) peer="$2"; shift 2 ;;
8 --type) type="$2"; shift 2 ;;
9 --no-nflog) show_nflog=false; shift ;;
10 --no-accept) show_accept=false; shift ;;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::fw::list() {
2 local peer="" type=""
3 while [[ $# -gt 0 ]]; do
4 case "$1" in
5 --peer) peer="$2"; shift 2 ;;
6 --type) type="$2"; shift 2 ;;
7 *) shift ;;
8 esac
9 done

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 grep -r "firewall::" /etc/wireguard/wgctl/
2 /etc/wireguard/wgctl/commands/remove.command.sh: firewall::unblock_all "$client_ip"
3 /etc/wireguard/wgctl/commands/remove.command.sh: firewall::remove_block_file "$name" 2>/dev/null || true
4 /etc/wireguard/wgctl/commands/service.command.sh: firewall::restore_blocks
5 /etc/wireguard/wgctl/commands/service.command.sh: firewall::restore_blocks
6 /etc/wireguard/wgctl/commands/unblock.command.sh: firewall::unblock_all "$client_ip"
7 /etc/wireguard/wgctl/commands/unblock.command.sh: firewall::remove_block_file "$name"
8 /etc/wireguard/wgctl/commands/unblock.command.sh: firewall::unblock_ip "$client_ip" "$ip"
9 /etc/wireguard/wgctl/commands/unblock.command.sh: firewall::unblock_subnet "$client_ip" "$subnet"
10 /etc/wireguard/wgctl/commands/unblock.command.sh: firewall::unblock_port "$client_ip" "$target" "$port" "$proto"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function firewall::block_ip_logged() {
2 local client_ip="$1" target_ip="$2"
3
4 iptables -I FORWARD 1 -s "$client_ip" -d "$target_ip" -j LOG --log-prefix "wgctl-dropped: " --log-level 4
5 iptables -I FORWARD 1 -s "$client_ip" -d "$target_ip" -j DROP
6 log::wg_block "Blocked ${client_ip} → ${target_ip} (logged)"
7 }
8 function firewall::unblock_ip() {
9 local client_ip="$1" target_ip="$2"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 ────────────────────────────────────────────────
2 Inspect: guest-zephyr
3 ────────────────────────────────────────────────
4
5 ── Client ──────────────────────────────────
6 Name: guest-zephyr
7 IP: 10.1.101.1
8 Type: guest/desktop
9 Rule: moonlight-02
10 Status: offline

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 root@wireguard:~# wgctl inspect --name guest-zephyr
2
3 ────────────────────────────────────────────────
4 Inspect: guest-zephyr
5 ────────────────────────────────────────────────
6
7 ── Client ──────────────────────────────────
8 Name: guest-zephyr
9 IP: 10.1.101.1
10 Type: guest/desktop

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 cat /etc/wireguard/clients/guest-zephyr.meta
2 {
3 "subtype": "desktop",
4 "rule": "moonlight-02"
5 }root@wireguard:~# cat /etc/wireguard/wgctl/rules/moonlight-02.rule
6 {
7 "name": "moonlight-02",
8 "desc": "Moonlight-02 - Access to VM",
9 "dns_redirect": true,
10 "allow_ips": ["10.0.0.244/32"],

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 root@wireguard:~# wgctl inspect --name zephyr --type guest --config
2
3 ────────────────────────────────────────────────
4 Inspect: guest-zephyr
5 ────────────────────────────────────────────────
6
7 ── Client ──────────────────────────────────
8 Name: guest-zephyr
9 IP: 10.1.101.1
10 Type: guest/desktop

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 ────────────────────────────────────────────────
2 Inspect: phone-nuno
3 ────────────────────────────────────────────────
4
5 ── Client ──────────────────────────────────
6 Name: phone-nuno
7 IP: 10.1.3.1
8 Type: phone
9 Rule: admin
10 Status: offline

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 root@wireguard:~# wgctl inspect --name phone-nuno
2
3 ────────────────────────────────────────────────
4 Inspect: phone-nuno
5 ────────────────────────────────────────────────
6
7 ── Client ─)
8 Name: phone-nuno
9 IP: 10.1.3.1
10 Type: phone
Newer Older

Powered by Opengist ⋅ Load: 140ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ KrilHub