Results 1 to 6 of 6

Thread: Share Internet Connection (Ubuntu Server)

  1. #1
    Join Date
    Nov 2012
    Beans
    5

    Share Internet Connection (Ubuntu Server)

    I have turned an old laptop into a linux server. It uses wi-fi to connect to the internet (eth1) and I have a desktop connected to it via ethernet that I want to share the internet with (eth0).

    Easy enough with the ubuntu GUI, but something to do with 'iptables' by command line, from what I've read. Can anybody help?

  2. #2
    Join Date
    Nov 2012
    Beans
    5

    Re: Share Internet Connection (Ubuntu Server)

    One thing I keep coming accross is this:

    Code:
    iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o eth1 -j MASQUERADE
    Say I can browse to my router settings on 192.168.1.254 and my server IP is 192.168.1.69. But eth1's default gateway is 192.168.1.255.

    After telling eth1 to masquerade, how do I configure eth0 on the server and the ipv4 settings on the (windows 8) desktop?
    Last edited by mikemhz; November 18th, 2012 at 06:41 PM.

  3. #3
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Share Internet Connection (Ubuntu Server)

    I've used this tutorial in the past:
    http://codeghar.wordpress.com/2012/0...d-dhcp-server/
    Cheesemill

  4. #4
    Join Date
    Nov 2012
    Beans
    5

    Re: Share Internet Connection (Ubuntu Server)

    So I followed the tutorial and my Windows desktop recognizes a DHCP through the Ethernet but tells me DHCP is not enabled. Also, my DNS suffix is blank or has example.org.

    My setup differs from that tutorial in the first step.

    in /etc/network/interfaces i have:

    Code:
    auto eth1
    iface eth1 inet dhcp
        wpa-ssid <ESSID>
        wpa-psk <password>
    will this make a difference?

  5. #5
    Join Date
    Nov 2012
    Beans
    5

    Re: Share Internet Connection (Ubuntu Server)

    So I've wasted a weekend doing this. Please help lol. Just want this to be over. Do I need to enter my ISPs DNS details into /etc/dhcp/dhcpd.conf?

  6. #6
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Share Internet Connection (Ubuntu Server)

    If you don't mind setting up the IP settings on your Windows box manually you can skip the DHCP part of that tutorial altogether.
    Cheesemill

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
  •