Atualizar pisrc_compartilha_internet.sh

This commit is contained in:
2026-02-08 18:03:02 +00:00
parent 6f4061e4f7
commit e379de92c1

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
read -p "Qual a interface de saída para a internet? " IFACE read -p "Qual a interface de saída para a internet? " IFACE
nft add table -exist ip nat nft add table ip nat
nft add chain -exist ip nat postrouting { type nat hook postrouting priority 100 \; } nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; }
if ! nft list chain ip nat postrouting | grep -q "oifname \"$IFACE\" masquerade"; then if ! nft list chain ip nat postrouting | grep -q "oifname \"$IFACE\" masquerade"; then
nft add rule ip nat postrouting oifname "$IFACE" masquerade nft add rule ip nat postrouting oifname "$IFACE" masquerade
fi fi