Skip to content

Instantly share code, notes, and snippets.

@lotusirous
Created June 18, 2016 03:38
Show Gist options
  • Save lotusirous/7ade4f76a92ffcf0a4b7add8641c219f to your computer and use it in GitHub Desktop.
Save lotusirous/7ade4f76a92ffcf0a4b7add8641c219f to your computer and use it in GitHub Desktop.
iptables -t nat -A POSTROUTING -o eth4 -s 192.168.13.10 -j SNAT --to-source 192.168.9.10
iptables -t nat -A PREROUTING -i eth4 -d 192.168.9.10 -j DNAT --to-destination 192.168.13.10
iptables -A FORWARD -s 192.168.9.10 -j ACCEPT
iptables -A FORWARD -d 192.168.13.10 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth5 -s 192.168.14.10 -j SNAT --to-source 192.168.10.10
iptables -t nat -A PREROUTING -i eth5 -d 192.168.10.10 -j DNAT --to-destination 192.168.14.10
iptables -A FORWARD -s 192.168.10.10 -j ACCEPT
iptables -A FORWARD -d 192.168.14.10 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth6 -s 192.168.15.10 -j SNAT --to-source 192.168.11.10
iptables -t nat -A PREROUTING -i eth6 -d 192.168.11.10 -j DNAT --to-destination 192.168.15.10
iptables -A FORWARD -s 192.168.11.10 -j ACCEPT
iptables -A FORWARD -d 192.168.15.10 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth7 -s 192.168.16.10 -j SNAT --to-source 192.168.12.10
iptables -t nat -A PREROUTING -i eth7 -d 192.168.12.10 -j DNAT --to-destination 192.168.16.10
iptables -A FORWARD -s 192.168.12.10 -j ACCEPT
iptables -A FORWARD -d 192.168.16.10 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment