Created
August 24, 2019 17:36
-
-
Save cretudorin/3ca1a032e865e9900c72c5a4b1361278 to your computer and use it in GitHub Desktop.
iptables forward all from one nic to other
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install --reinstall iptables | |
update-alternatives --config iptables | |
legacy | |
net.ipv4.ip_forward = 1 | |
sudo sysctl -p /etc/sysctl.conf | |
iptables -A FORWARD -i eth0 -o ztuze4sgqk -j ACCEPT | |
iptables -A FORWARD -i ztuze4sgqk -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
sudo apt-get install iptables-persistent | |
dpkg-reconfigure iptables-persistent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment