Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to setup up NAT

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, I need to find out how to setup up NAT so the other machines on the network can access the internet.

Also is there a free program similer to winproxy that will do most of the configuring for me.

thanx
 
goto and download the disk creation software. This will create a single floppy that will boot a computer into a version of linux designed to act as a router and allow multiple machines behind it to access the internet. It is actually quite easy to configure. Troy Williams B.Eng.
fenris@hotmail.com
 
Hi,



You would just use IP masquerading on the linux box using either ipchains or the newer iptables :



If you have iptables (with 2.4 series kernels) :



echo 1 >/proc/sys/net/ipv4/ip_forward
/sbin/modprobe ip_tables iptable_nat iptable_nat_ftp

/sbin/modprobe ip_conntrack ip_conntrack_ftp

/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 172.16.16.0/24 -j MASQUERADE



Or - for ipchains (2.2.x kernels onwards)



echo 1 >/proc/sys/net/ipv4/ip_forward

/sbin/ipchains -P forward DENY

/sbin/ipchains -A forward -i ppp0 -s 172.16.16.0/24 -j MASQ





In both cases replace 'ppp0' with your internet interface and '172.16.16.0/24' with you lan ip address range (or even leave the '-s 172.16.16.0/24' out completely if you're not fussy.



In either case a good place to put these commands would be /etc/rc.d/rc.local or the equivalent for your distribution.



Regards





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top