Results 1 to 7 of 7
I am trying to share an Internet connection between two Gentoo box's, this is the firs time I am ever doing this and would like a step by step guide ...
- 09-30-2004 #1Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
Sharing Internet Connection
I am trying to share an Internet connection between two Gentoo box's, this is the firs time I am ever doing this and would like a step by step guide or an explanation. Anyone?
- 09-30-2004 #2
Could you tell us more info, like what's the setup, 2 NICS in one box or what?
- 09-30-2004 #3Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
Yes, box with 2 NICs..
Originally Posted by tylerwylie
- 09-30-2004 #4
wait, i thought you said you were attempting to share a connection between two boxes
- 09-30-2004 #5I believe that it would be:
Originally Posted by lakerdonald
If I understand what he's saying?Code:box2 -> box1{eth1} -> box1{eth0} -> Internet
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 09-30-2004 #6Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
That is exactly it.
Originally Posted by sarumont
- 10-01-2004 #7Just Joined!
- Join Date
- Sep 2004
- Location
- belgium
- Posts
- 9
I think the best thing to do is to follow this guide :
http://www.gentoo.org/doc/en/home-router-howto.xml
But roughly, here are the main steps :
Let's say your internet gateway is box A, and the machine in your LAN is box B.
A has 2 NICs, and B has only 1.
First, you configure your internet connection on box A :
Use adsl-setup and adsl-start if you are on adsl, or use dhcpcd if you are on tv cable, ...
Then, you set up the second NIC of box A and the only NIC of box B :
use private adresses for that network, ie 192.168.0.X, or 10.1.1.X, or something.
For box B, you must set the default gateway to be the box A.
You should now be able to ping A from B, and to ping the internet from A.
Once there, all you have to do is to configure masquerading on box A :
Suppose that your eth0 is plugged to the internet (and eth1 to your internal LAN).
You type :
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE"
and that should do it. No need to say that this only enable masquerading, but you should add more rules to protect yourself...
Make your changes permanent, and you're done!
HTH
Flupke


Reply With Quote
