User Tools

Site Tools


route_traffic_across_two_interfaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
route_traffic_across_two_interfaces [2013/07/07 14:36]
deftesprit
route_traffic_across_two_interfaces [2013/07/07 14:39] (current)
deftesprit
Line 1: Line 1:
 +====== Route traffic across two interfaces ======
 +  * eth0 is the WAN
 +  * eth1 is the LAN
 +
 First, turn on ip forwarding:​\\ First, turn on ip forwarding:​\\
 ''​echo 1 > /​proc/​sys/​net/​ipv4/​ip_forward''​ ''​echo 1 > /​proc/​sys/​net/​ipv4/​ip_forward''​
  
 Next create iptables rules:\\ Next create iptables rules:\\
-''/​sbin/​iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE +''/​sbin/​iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 
-/​sbin/​iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,​ESTABLISHED -j ACCEPT +/​sbin/​iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,​ESTABLISHED -j ACCEPT 
-/​sbin/​iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT''​+/​sbin/​iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT''​
route_traffic_across_two_interfaces.txt · Last modified: 2013/07/07 14:39 by deftesprit