Skip to content

Instantly share code, notes, and snippets.

@morteza-mori
Created July 3, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morteza-mori/94d7be62a074013917ae3c26091f3daa to your computer and use it in GitHub Desktop.
Save morteza-mori/94d7be62a074013917ae3c26091f3daa to your computer and use it in GitHub Desktop.
networking linux
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