Results 1 to 6 of 6

Thread: Howto share internet connection

  1. #1
    Join Date
    Jun 2006
    Location
    Odense
    Beans
    1
    Distro
    Ubuntu 6.06

    HOWTO: share internet connection

    After reading and strugling with http://www.ubuntuforums.org/showthread.php?t=91370 I desided to write a new howto for 6.06, so here we go.

    You need 2 network cards, I used a ethernet network card and a wireless network card, but it will do with any kind of networking cards.

    my setup is as follows:
    wireless nic for internet connection called wlan0
    ethernet nic for local network called eth0

    wlan0 is set up with DHCP and have
    IP : 192.168.1.3
    netmask : 255.255.255.0
    ns : 192.168.1.254
    gateway : 192.168.1.254

    eth0 is set up with static and have
    IP : 192.168.2.1
    netmask : 255.255.255.0
    ns : 192.168.2.1
    gateway : none

    assign adresses to your cards in you computer like mine above. But you need to make sure, that your internet connection side (in my case wlan0) does not have the same IP range as the local network side (in my case eth0).

    We need to install firestarter with
    Code:
    sudo apt-get install firestarter
    then we need to set up DNS proxy with:

    Code:
    sudo apt-get install pdnsd
    edit /etc/pdnsd.conf:
    Code:
    nano /etc/pdnsd.conf
    change the lines to match your DNS settings and your local network card configuration.

    Code:
            server_ip="192.168.2.1";
    should be the IP of your local network card (eth0)

    Code:
    /*
    server {
            ip="192.168.1.254";
            timeout=30;
            interval=30;
            uptest=ping;
            ping_timeout=50;
            purge_cache=off;
    }
    */
    remove the /* and */ around the above block and change the ip="192.168.1.254" to the ip of your internet DNS server ip.

    save and exit.

    now we need to set up the computers on the local network.

    Each computer needs settings like:

    IP : 192.168.2.n
    netmask : 255.255.255.0
    ns : 192.168.2.1
    gateway : 192.168.2.1

    where n is a new number for each new computer, but not 1.

    When you have done that, you should be able to ping 192.168.2.1 from every computer on the local network, but not to ping anything on the internet.
    We now begin to set up the routing of the traffic from the local network to the internet side.

    start firestarter and follow the guide, select your internet bound nic for internet side and local nic for local network side.
    Start up the firewall if it is not allready running.
    Now you should be able to ping any IP on the internet.

    If you have any services, which is not let trough the firewall look in the events log in firestarter, find the blocked event from the given IP and right click on it and select "Allow connections from source"

    You should be up and running now.
    Last edited by schultzconsult; June 16th, 2006 at 07:52 PM.

  2. #2
    Join Date
    Feb 2007
    Location
    CA
    Beans
    20
    Distro
    Kubuntu 8.10 Intrepid Ibex

    Re: HOWTO: share internet connection

    Thanks for this great tutorial. I got everything up and running on my first try. I didn't find where to set my "ns" setting but it worked without it.

  3. #3
    Join Date
    Mar 2007
    Beans
    15
    Distro
    Ubuntu 6.10 Edgy

    Re: Howto share internet connection

    now how would i go about doing that with only one network card...
    i did it just fine when i used windows but now ...

  4. #4
    Join Date
    Apr 2007
    Location
    Kingsport, TN
    Beans
    4
    Distro
    Kubuntu 8.10 Intrepid Ibex

    Smile Re: Howto share internet connection

    Thanks a bunch! I've been looking for a way to share my wireless internet connection from my Ubuntu laptop for quite some time now, and this is the first one to actually work for me!

  5. #5

    Re: Howto share internet connection

    How much more difficult is it to go in the reverse direction, that is, to have the wired eth0 be the WAN and a wireless card (for me, eth1) acting as a wireless router for the LAN?

  6. #6
    Join Date
    Jan 2009
    Beans
    110

    Re: Howto share internet connection

    Can this be done with et0 to internet and shared over wlan0?

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
  •