Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux 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?

  2. #2
    Content Team tylerwylie's Avatar
    Join Date
    Apr 2004
    Posts
    120
    Could you tell us more info, like what's the setup, 2 NICS in one box or what?

  3. #3
    Linux User
    Join Date
    Nov 2003
    Location
    Brooklyn, NY
    Posts
    347
    Quote Originally Posted by tylerwylie
    Could you tell us more info, like what's the setup, 2 NICS in one box or what?
    Yes, box with 2 NICs..

  4. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    wait, i thought you said you were attempting to share a connection between two boxes

  5. #5
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Quote Originally Posted by lakerdonald
    wait, i thought you said you were attempting to share a connection between two boxes
    I believe that it would be:

    Code:
    box2 -> box1{eth1} -> box1{eth0} -> Internet
    If I understand what he's saying?
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  6. #6
    Linux User
    Join Date
    Nov 2003
    Location
    Brooklyn, NY
    Posts
    347
    Quote Originally Posted by sarumont
    Quote Originally Posted by lakerdonald
    wait, i thought you said you were attempting to share a connection between two boxes
    I believe that it would be:

    Code:
    box2 -> box1{eth1} -> box1{eth0} -> Internet
    If I understand what he's saying?
    That is exactly it.

  7. #7
    Just Joined!
    Join Date
    Sep 2004
    Location
    belgium
    Posts
    10
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •