Results 1 to 10 of 14

Thread: how to route traffic through my pc?

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Location
    New Zealand
    Beans
    443
    Distro
    Ubuntu 12.04 Precise Pangolin

    how to route traffic through my pc?

    I'm trying to route internet traffic through my pc but I'm having little success.
    I tried using the "use access point" feature on the setup page my router but that wasn't much good because the feature allows another access point to connect, not vice versa (as far as I can tell). I want the router to be the access point and my laptop to be the gateway to the internet (the modem plugs into my laptop).

    I have the modem plugged into my lan, my wifi connected to my router.
    So now I want to share the internet (eth0) with my router (connected on wlan0).
    How can I do this?
    Last edited by jonnyboysmithy; November 5th, 2012 at 12:02 AM.

  2. #2
    Join Date
    Mar 2011
    Location
    New Zealand
    Beans
    443
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to route traffic through my pc?

    Bump.

  3. #3
    Join Date
    Jun 2007
    Location
    Melbourne, AU
    Beans
    211
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: how to route traffic through my pc?

    You will need to do a few things:

    1. Enable IP forwarding, this will allow your PC to route traffic between interfaces. There are a few ways of doing this, but you will likely want to do this permanently. It's quite straight forward, this link will help in doing this.

    http://www.ducea.com/2006/08/01/how-...ding-in-linux/

    2. You will need to configure your remaining clients on the network to use the wireless interface on your computer as their default gateway, this can be done from the DHCP settings, or simply manually defined on each client.

    3. I will need a little more information here, could you confirm if the public IP address issued to you by your service provider is the address of your eth0 interface? If so, you will need to install (if not already) IPTABLES and configure it to perform port address translation (also called masquerading) which is a form of NAT which translates all of your internal hosts IP addresses to this public address when destined for the internet. This link will likely help, but I will see if I can dig up some old examples also:

    http://www.ibiblio.org/pub/linux/doc...ple-HOWTO.html

    Let us know how you go.
    Ubuntu 8.04 Hardy Heron User

  4. #4
    Join Date
    Mar 2011
    Location
    New Zealand
    Beans
    443
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to route traffic through my pc?

    Thanks for the info. Interesting stuff.
    Last time I needed to use my machine as gateway went to >Systems Settings>Network>Wireless>use as hotspot and that worked well.

    I asked the question wrong. I'm hoping set it up like:
    Other pcs connect to-> router which connects to ->my laptop which connects to-> modem to ->internet

    Or:
    Other pcs -> router ->my laptop which routes back to ->router which goes to-> modem to ->internet

    The thing is I want the router being used . Is there anyway to do this?
    Last edited by jonnyboysmithy; November 7th, 2012 at 07:05 AM.

  5. #5
    Join Date
    Jun 2007
    Location
    Melbourne, AU
    Beans
    211
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: how to route traffic through my pc?

    Hey, yeah I think we're on the same page.

    I have drawn a couple of diagrams (attached to this post) to try and represent it. Let me know if this is what you're after.
    Attached Images Attached Images
    Ubuntu 8.04 Hardy Heron User

  6. #6
    Join Date
    Mar 2011
    Location
    New Zealand
    Beans
    443
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to route traffic through my pc?

    Yes this is exactly what I'm after.
    Edit: I tried googling it but I could never get good search results for what I was trying to do.
    Last edited by jonnyboysmithy; November 7th, 2012 at 09:34 AM.

Tags for this Thread

Bookmarks

Posting Permissions

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