Atualizar pisrc_compartilha_internet.sh
This commit is contained in:
8
pisrc_compartilha_internet.sh
Normal file
8
pisrc_compartilha_internet.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
read -p "Qual a interface de saída para a internet? " IFACE
|
||||
nft add table -exist ip nat
|
||||
nft add chain -exist ip nat postrouting { type nat hook postrouting priority 100 \; }
|
||||
if ! nft list chain ip nat postrouting | grep -q "oifname \"$IFACE\" masquerade"; then
|
||||
nft add rule ip nat postrouting oifname "$IFACE" masquerade
|
||||
fi
|
||||
sysctl -w net.ipv4.ip_forward=1
|
||||
Reference in New Issue
Block a user