Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
08-16-2005, 10:12 AM
|
#1
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Rep:
|
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.
|
|
|
08-16-2005, 10:24 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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
|
|
|
08-16-2005, 11:42 AM
|
#3
|
Member
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173
Rep:
|
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 
|
|
|
08-16-2005, 11:46 AM
|
#4
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
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.
|
|
|
08-16-2005, 11:52 AM
|
#5
|
Member
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173
Rep:
|
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
|
|
|
08-16-2005, 01:31 PM
|
#6
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
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.
|
|
|
08-16-2005, 01:35 PM
|
#7
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
Yes, but you'll need a switch as stated above to connect those two computers to the router/firewall computer.
|
|
|
08-16-2005, 01:36 PM
|
#8
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
Please enlighten me as to how
PLEASE!!!! 
|
|
|
08-16-2005, 01:37 PM
|
#9
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
Can't I just put three NICs on the PC used as a router?
|
|
|
08-16-2005, 01:41 PM
|
#10
|
Member
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173
Rep:
|
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
|
|
|
08-16-2005, 01:43 PM
|
#11
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
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.
|
|
|
08-16-2005, 01:56 PM
|
#12
|
Member
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173
Rep:
|
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.
|
|
|
08-16-2005, 02:06 PM
|
#13
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Original Poster
Rep:
|
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!
|
|
|
08-16-2005, 03:47 PM
|
#14
|
Member
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173
Rep:
|
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.
|
|
|
08-16-2005, 04:48 PM
|
#15
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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...
|
|
|
All times are GMT -5. The time now is 08:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|