Désactivation de la nat

This commit is contained in:
jeremy.thomas 2025-03-26 15:34:34 +01:00
parent 9bd886a3e0
commit 65449fbf98
3 changed files with 24 additions and 0 deletions

View File

View File

@ -0,0 +1,13 @@
[Unit]
Description=execute /root/dnsfwd.sh
After=default.target
[Service]
ExecStart=bash /root/dnsfwd.sh
[Install]
WantedBy=default.target

View File

@ -0,0 +1,11 @@
!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
nft add table dnsfwd
nft add chain dnsfwd prerouting {type nat hook prerouting priority 0 \; }
nft add chain dnsfwd postrouting {type nat hook postrouting priority 0 \; }
nft add rule dnsfwd postrouting tcp dport 53 masquerade
nft add rule dnsfwd postrouting udp dport 53 masquerade
nft add rule dnsfwd prerouting tcp dport 53 masquerade
nft add rule dnsfwd prerouting udp dport 53 masquerade
nft add rule dnsfwd prerouting ct state established,related accept
nft add rule dnsfwd postrouting ct state established,related accept