Created
July 3, 2017 07:33
-
-
Save morteza-mori/94d7be62a074013917ae3c26091f3daa to your computer and use it in GitHub Desktop.
networking linux
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
Networking | |
#IPv4 Forwarding: | |
nano /etc/sysctl.conf → Change 0 to 1 in ip_forward | |
sysctl -p && echo 1 > /proc/sys/net/ipv4/ip_forward | |
#IPtables: | |
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT | |
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment