Enable IP Forwarding in Linux

echo 1 > /proc/sys/net/ipv4/ip_forward
 #This is temporary
 #for permanent >>
 
 
#vim /etc/sysctl.conf
 
net.ipv4.ip_forward = 1
 <save it>
 
#sysctl -p or 
#service network restart 
 
Configure iptables :
-----------------  
 
# /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE    
 
 
 
--optional---next--> 

# /sbin/iptables -A FORWARD -i eth0 -o eth1 -m state   --state RELATED,ESTABLISHED -j ACCEPT 

# /sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT 
 
 

No comments:

Post a Comment