LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   setup linux firewall/router (https://www.linuxquestions.org/questions/linux-networking-3/setup-linux-firewall-router-82099/)

sub_netter 08-14-2003 09:00 PM

setup linux firewall/router
 
hey guys i am a complete newb to debian woody...currently atm i have a linksys router connecting two computers to the internet with a cable modem...

i would like to take a third computer and create a router/firewall out of it and get rid of the linksys one. how would i go about setting up my debian box as a router/firewall?

thank you

Robert0380 08-14-2003 11:43 PM

Insecure Router Setup

A. Setup network interface (the internal one)
Code:

ifconfig eth1 192.168.0.1 netmask 255.255.255.0 bcast 192.168.0.255
if u have another network card, you could give it an address of 192.168.1.1 and have another network. Also, you could attach the uplink of the linksys to the router with a cross-over cable, turn off the dhcp server in the router, give the router an ip of 192.168.0.2. you can then use the router as a switch. (i think that's the setup, linksys tech support will tell u how to set it up).

B. Turn on forwarding
Code:

#echo 1 > /proc/sys/net/ipv4/ip_forwarding
there is a config file somewhere where you can set the value and not have to deal with it anymore. If you do it command line style the way i just showed u, you'll have to do it after every reboot.

C. Share the Internet connection

Code:

#iptables -A POSTROUTING -t nat -s 192.168.0.1/24 -j MASQUERADE
OR if you have a static ip to the internet:

Code:

#iptables -A POSTROUTING -t nat -s 192.168.0.1/24 -j SNAT -to <ip address here>
only choose 1 of those


D. Setup host
Give the computer connected to the router (or linksys switch if u set it up that way) an ip of 192.168.0.X (X = any number from 3 - 254)

E. Plug it all together (for computer-to-computer connections make sure you use cross-over cables as well as for the uplink-to-computer if you use the linksys router as a switch).



this setup will allow you to share your connection through a linux computer. it is insecure. you should check a tutorial on iptables for added security (DO THAT NOW).

Robert0380 08-14-2003 11:46 PM

i have to re-state, SECURE YOUR SYSTEM BEFORE PUTTING IT ON THE INTERNET.

Sage1 08-15-2003 12:33 AM

Ya know, a noob might be better trying ipcop, on a 486 with two NICs,
http://ipcop.org or at http://distrowatch.com there are about 8 firewall/router distros. (all CD ISO's.

Then, there are a pile of floppy distros (tom's Root 'n Boot), and
a floppy firewall that is strong is Bering... These are easily researched in http://google.com/linux with a search word like 'floppy' and, 'firewall',
and, 'floppy firewall'... you get the drift?

sub_netter 08-15-2003 06:18 AM

Thanks a bunch


All times are GMT -5. The time now is 09:12 AM.