LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2005, 10:12 AM   #1
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Rep: Reputation: 31
Old PC as a Router/Firewall for Multiple PCs


I have read many articles concerning using an old PC as a router/firewall but they only seem to include two PCs. One as the router/firewall and the other as the work station.

My questions are:

1. Has anyone done this using three NIC's?
(One to the modem and the other two to the two computers sharing the internet connection)

2. How is the speed? I would like the two PCs to share a 4MB cable internet connection.

3. What software would you recomend? Slackware?

Last edited by AxXium; 08-16-2005 at 10:14 AM.
 
Old 08-16-2005, 10:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
1. Don't. go spend $10 on a cheap switch and connect both machines to that. you don't want to have multiple lans and all that. the way the router is set up you just want an "inside" and and "outside" interface. It's not that people have only done this with 2 machines, they are simply representing a generic internal lan structure with a single machine.

2. depends on many different things, but a 4mb connection??? you'll be on a 100mbps network at least, why should a puny 4mbps be a problem?

3. get something dedicated for the job if that's all you're doing with it... http://ipcop.sf.net http://smoothwall.org
 
Old 08-16-2005, 11:42 AM   #3
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
Re: Old PC as a Router/Firewall for Multiple PCs

Quote:
Originally posted by mianve
I have read many articles concerning using an old PC as a router/firewall but they only seem to include two PCs. One as the router/firewall and the other as the work station.

My questions are:

1. Has anyone done this using three NIC's?
(One to the modem and the other two to the two computers sharing the internet connection)

2. How is the speed? I would like the two PCs to share a 4MB cable internet connection.

3. What software would you recomend? Slackware?
1. Read acid_kewpie's reply

2. Here I share 5 PC's on a 4 Mbit connection, internally it's all 100 Mbit, no problem

3. You could use slackware, setting it up will be a nice learning experiance, if you don't want to spend much time setting it up acid_kewpie's reply is your answer
 
Old 08-16-2005, 11:46 AM   #4
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
Code:
2. Here I share 5 PC's on a 4 Mbit connection, internally it's all 100 Mbit, no problem
I want to do it without spending any money for a router.

It was hell to convince my wife for the money for the internet, let alone to start buying more hardware.

I have three pcs and a spare that I would like to use as a router, I just don't know how.
 
Old 08-16-2005, 11:52 AM   #5
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
Quote:
Originally posted by mianve
Code:
2. Here I share 5 PC's on a 4 Mbit connection, internally it's all 100 Mbit, no problem
I want to do it without spending any money for a router.

It was hell to convince my wife for the money for the internet, let alone to start buying more hardware.

I have three pcs and a spare that I would like to use as a router, I just don't know how.
You don't need a router, just a cheap switch.

This should be your setup



http://www.nukey.nl/images/temp/mianve.jpg
 
Old 08-16-2005, 01:31 PM   #6
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
Is it possible to use an old PC as a router without having to buy a router or a switch?


Example:


********************************(PC1)***************
********************************/*******************
*******************************/*********************
****************************** /********************
(Internet)-----------(PC as router)----************************
***************************** \************************
*******************************\************************
********************************\**********************
********************************(PC2)******************

Last edited by AxXium; 08-16-2005 at 01:34 PM.
 
Old 08-16-2005, 01:35 PM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Yes, but you'll need a switch as stated above to connect those two computers to the router/firewall computer.
 
Old 08-16-2005, 01:36 PM   #8
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
Please enlighten me as to how




PLEASE!!!!
 
Old 08-16-2005, 01:37 PM   #9
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
Can't I just put three NICs on the PC used as a router?
 
Old 08-16-2005, 01:41 PM   #10
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
Quote:
Originally posted by mianve
Is it possible to use an old PC as a router without having to buy a router or a switch?


Example:


********************************(PC1)***************
********************************/*******************
*******************************/*********************
****************************** /********************
(Internet)-----------(PC as router)----************************
***************************** \************************
*******************************\************************
********************************\**********************
********************************(PC2)******************
Yes, that's also possible but then you come to the point acid_kewpie mentioned. You have to have 3 NICs (network-cards) in the router-pc as in the picture on the link below:

But that takes a "little" more work to accomplish

http://www.nukey.nl/images/temp/mianve2.jpg
 
Old 08-16-2005, 01:43 PM   #11
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
That is exactly what I'm looking for Nukey.

A PC/Router with three NICs.

You got it exactly!!!

Now where do I start?

I already have the hardware

Last edited by AxXium; 08-16-2005 at 01:44 PM.
 
Old 08-16-2005, 01:56 PM   #12
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
Quote:
Originally posted by mianve
That is exactly what I'm looking for Nukey.

A PC/Router with three NICs.

You got it exactly!!!

Now where do I start?

I already have the hardware
If you really want i that way, which I wouldn't reccomend (a switch can save you hours of configuration). But hee, it's a nice project hehe

What i would do.

Install slackware, cofigure eth0 to recieve IP adress from provider.

Give eth1 192.168.1.0
Give eth2 192.168.2.0

Give pc1 192.168.1.1 255.255.255.0 192.168.1.0 (default gateway)
Give pc2 192.168.2.1 255.255.255.0 192.168.2.0 (default gateway)
(you could also set the dhcpd daemon on both interface but this is easier maybe

If that's done your pc's can "talk" to your server on the seperate interfaces. and your "pc as router" can connect to the internet.
Than you should enable ipforwarding (can't (yet) help you on that one, "chmod +x /etc/rc.d/rc.ip_forward" is where i would start, i have no experiance in that area (yet).

And last, but actualy most import is to configure IPTables on you eth0 interface to secure your "pc as router"

For the rest -> GOOGLE

Last edited by nukey; 08-16-2005 at 01:58 PM.
 
Old 08-16-2005, 02:06 PM   #13
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Original Poster
Rep: Reputation: 31
You're the fuc*'n man nukey!!

Thanks a bunch!

That's the answer I was looking for.

I really appreciate it. For a moment I was breif moment looking into WinXP ICS, but you saved the day. A windows firewall is a scary thought indeed.

Slackware as a router/firewall...now that's the ticket!
 
Old 08-16-2005, 03:47 PM   #14
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
I couldn't resist trying this router-shit so i took an old laptop, put 2 PCMCIA cards in it and made the network as shown below.

As for the routing stuff:

Enable ipforwarding like i said above (chmod +x /etc/rc.d/rc.ip_forward).
Make (at least these) two iptables rules:

iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT

choose the right eth0 and eth1 for your interfaces.

You might wanne read up on iptables and make sure all the ports are closed on the interface connected to the internet.

Good luck.

http://www.nukey.nl/images/temp/rout...ingrouting.jpg


And Windows with 3 network cards ? That'll be like rebooting 3 time as much as usual

Last edited by nukey; 08-16-2005 at 04:06 PM.
 
Old 08-16-2005, 04:48 PM   #15
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
slackware as a router / firewall really isn't the ticket when ready built tickets already exist just fine. In fact opcop or smoothwall do have configuration in them for additional interfaces, using "blue" interfaces in addition to the standard internal "green" and external "red" interfaces... but a router is not a switch, don't mix the two things up.

but hey, no one ever listens to me anyway... spend 2 weeks getting slackware set up exactly as you want, or grab an ipcop cd, and be ready running in 10 minutes tops...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Run a program on multiple pcs mesh2005 Linux - Networking 4 09-18-2005 02:33 PM
Connecting a single ethernet port to multiple PCs? beejayzed Linux - Networking 14 09-08-2005 04:14 PM
Do I need a FW? Client PCs behind a Netgear NAT router cevjr Linux - Networking 1 01-08-2005 07:49 PM
Stopping/Blocking PCs infected with MS BLASTER Worm (RH 6 Gateway/Router) smartcard Linux - Security 1 11-06-2003 01:02 PM
All PCs behind router with one eth0 each. Shorewall ACCEPTetho:192.168.1.0/24 - bad ? cmisip Linux - Security 4 09-20-2003 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:45 PM.

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