User Tools

Site Tools


ip_forwarding

Differences

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

Link to this comparison view

ip_forwarding [2007/02/09 12:34]
adam
ip_forwarding [2016/11/25 22:38]
Line 1: Line 1:
-===== IP Forwarding ===== 
  
-To enable a machine to act as a gateway for a network: 
- 
-  echo "1" > /proc/sys/net/ipv4/ip_forward 
-  iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE 
- 
-Where 192.168.1.0/24 is the network which will use this machine as a gateway. 
- 
-To make this permanent, on Debian/Ubuntu: 
- 
-  touch /etc/network/if-up.d/iptables 
-  chmod 755 /etc/network/if-up.d/iptables 
- 
-And add the following the new file: 
- 
-  #!/bin/bash 
-   
-  echo "1" > /proc/sys/net/ipv4/ip_forward 
-  iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE 
-   
-For Red Hat/Fedora: 
- 
-  iptables-save 
- 
-Good IP Tables Tutorial: 
-  * [[http://iptables-tutorial.frozentux.net/iptables-tutorial.html]] 
-  * [[http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables]] 
ip_forwarding.txt ยท Last modified: 2016/11/25 22:38 (external edit)