![]() |
Finally made the jump....setting up NAT on linux
After promising my self for years that i would upgrade my gateway box from win2k server using NAT to Linux i finally did it yesterday.
I was shocked at how simple it actually is to set up the NAT/firewall on Linux and thought i would supply a few bits of information I found on various different web sites incase anyone else also wishes to do this. firstly chose your linux :) i chose redhat 9 as i have used redhat before and it has a cool logo :P i did i full install (about 2 gigs with all the extras but you dont need all this). log onto your machine and start a terminal session type "su" and and then your password to become root. fire up your favourite text editor and open the file /etc/rc.d/rc.local and add the following at the end of the file /etc/rc.d/rc.ipmasq Save this and close but keep the editor open. (this will execute the script you are about to create on startup.) Now create a new file in /etc/rc.d/ called rc.ipmasq and add the below data. Code:
#!/bin/shThis script assumes that eth0 is the network adaptor connected to the cable modem (you can change this depending on your machine config eth1, eth2 etc. in the case of a modem/dsl setup you can use ppp1 ppp2 etc.) Make this script executable by running the command chmod 755 /etc/rc.d/rc.ipmasq now run the command /etc/rc.d/rc.ipmasq to start the script without having to reboot. this script assumes that all network and internet connections have been previously set up and are working. I recomend you also set up some form of firewall, instructions for a basic firewall using IPtable follow. Firstly, open the file /etc/rc.d/rc.local again in your text editor and add the line /etc/rc.d/rc.firewall at the end, close the file and save again. now open a new file and save it in /etc/rc.d/ as rc.firewall. add the following text Code:
#!/bin/shrun /etc/rc.d/rc.firewall to start the firewall without needing to restart. Remember this firewall is by no means perfect, but it does provide a basic level of protection and make you "stealthed". (Stealthed means that your computer is invisible to most kinds of tests, but again this is not perfect) if any one has made it this far then i hope this has been usefull, i will be trying to post more stuff for linux in the future, if any one has any requests, just ask :) hth ava |
| All times are GMT. The time now is 07:35. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum