LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-14-2003, 09:00 PM   #1
sub_netter
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0
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
 
Old 08-14-2003, 11:43 PM   #2
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
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).

Last edited by Robert0380; 08-14-2003 at 11:45 PM.
 
Old 08-14-2003, 11:46 PM   #3
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
i have to re-state, SECURE YOUR SYSTEM BEFORE PUTTING IT ON THE INTERNET.
 
Old 08-15-2003, 12:33 AM   #4
Sage1
LQ Newbie
 
Registered: Dec 2002
Location: Central Florida http://golug.org http://leap-cf.org
Distribution: Debian & Slack based distros!
Posts: 25

Rep: Reputation: 17
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?
 
Old 08-15-2003, 06:18 AM   #5
sub_netter
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks a bunch
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I setup a Linux firewall router for my public class C IP block? abefroman Linux - Networking 9 09-06-2005 02:32 PM
router and firewall setup jibskg Linux - Networking 1 08-23-2004 09:01 AM
how to setup router on linux as a open firewall thirumala Linux - Networking 8 04-10-2004 05:38 PM
Howto setup two stage firewall? Linux and router-in-a-box? drdirt Linux - Security 5 01-10-2004 02:51 AM
router/firewall setup please help?! basatum Mandriva 1 09-20-2003 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration