From efe6e3d69c35cf44af4481b4089838fa9bb4e79a Mon Sep 17 00:00:00 2001 From: Folkert Kevelam Date: Sun, 22 Jun 2025 20:49:24 +0200 Subject: [PATCH] Initial commit --- Mozart/fix_network.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Mozart/fix_network.sh diff --git a/Mozart/fix_network.sh b/Mozart/fix_network.sh new file mode 100644 index 0000000..7599903 --- /dev/null +++ b/Mozart/fix_network.sh @@ -0,0 +1,37 @@ +#!/usr/bin/sh + +nft delete chain ip nat post +nft delete chain ip nat pre +nft delete chain ip6 nat pre +nft delete chain ip6 nat post + +nft delete table ip nat +nft delete table ip6 nat + +nft add table ip nat +nft add chain ip nat post { type nat hook postrouting priority 0 \; } +nft add chain ip nat pre { type nat hook prerouting priority 0 \; } + +nft add rule ip nat post ip saddr 10.0.3.1/24 oif enp1s0 masquerade + +nft add table ip6 nat +nft add chain ip6 nat pre { type nat hook prerouting priority 0 \; } +nft add chain ip6 nat post { type nat hook postrouting priority 0 \; } + +nft add rule ip6 nast post ip6 saddr fd96:d0e4:4979::/64 oif enp1s0 masquerade + +ip -6 addr add fd96:d0e4:4979://64 dev lxcbr0 + +nft add rule ip nat pre ip daddr 116.203.17.85 tcp dport 10022 dnat to 10.0.3.1:22 +nft add rule ip nat pre ip daddr 116.203.17.85 tcp dport 22 dnat to 10.0.3.10:22 +nft add rule ip nat pre ip daddr 116.203.17.85 tcp dport 20022 dnat to 10.0.3.113:22 +nft add rule ip nat pre ip daddr 116.203.17.85 tcp dport 30022 dnat to 10.0.3.17:22 + +nft add rule ip6 nat pre ip6 daddr 2a01:4f8:1c1b:89d2::2/64 tcp dport 10022 dnat to [fe80:9400:2ff:fefa:9ba6]:22 +nft add rule ip6 nat pre ip6 daddr 2a01:4f8:1c1b:89d2::2/64 tcp dport 22 dnat to [fd96:d0e4:4979::1]:22 +nft add rule ip6 nat pre ip6 daddr 2a01:4f8:1c1b:89d2::2/64 tcp dport 20022 dnat to [fd96:d0e4:4979::2]:22 +nft add rule ip6 nat pre ip6 daddr 2a01:4f8:1c1b:89d2::2/64 tcp dport 30022 dnat to [fd96:d0e4:4979::3]:22 + +for i in /proc/sys/net/ipv6/conf/*; do + echo 1 > $i/forwarding +done