Differences

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

Link to this comparison view

routing_two_nets [2016/03/23 20:56]
imcsk8 created
routing_two_nets [2016/03/23 21:15] (current)
imcsk8
Line 1: Line 1:
 ====== Routing traffic between two networks with iptables ====== ====== Routing traffic between two networks with iptables ======
  
 +I you have not enabled iptables just activate ip forwarding :)
 <​code>​ <​code>​
 # sysctl -w net.ipv4.conf.all.forwarding=1 # sysctl -w net.ipv4.conf.all.forwarding=1
 </​code>​ </​code>​
 +\\ 
 +Most Linux distributions enable filtering by default so you'll have to do it using iptables
 <​code>​ <​code>​
 # iptables -I FORWARD -i eth0 -o wlan0 -s wi.red.net.work/​24 -d wire.less.net.work/​24 -j ACCEPT # iptables -I FORWARD -i eth0 -o wlan0 -s wi.red.net.work/​24 -d wire.less.net.work/​24 -j ACCEPT