1

I am trying to configure an Ubuntu 10.04 desktop edition as a server. I currently have the DHCP server working through eth0.

My problem is that I only have one Ethernet port, and am receiving Internet though a mobile hotspot on my phone through wlan0, and whenever I attempt to connect through wlan0 and eth0 I am unable to access the Internet through the server or the clients. When I disconnect from eth0 I then regain access.

I have searched extensively for a solution, and have come up short. Any help is appreciated.

5
  • 1
    Have you seen help.ubuntu.com/community/Internet/ConnectionSharing?
    – jdthood
    Oct 30, 2012 at 16:28
  • 1
    This is a question that keeps popping up all the time, haven't seen a satisfactory answer to this one yet.
    – nikhil
    Oct 30, 2012 at 16:30
  • @jdthood Yes, that doesn't work with a DHCP server, at least in my experiences. Oct 30, 2012 at 16:37
  • Just for clarification... you have some cable clients attached to the network on eth0 and to those you want to provide an internet connection, which is accessed on wlan0. So the machine we are talking about functions as router. Oct 31, 2012 at 2:41
  • Yes, that is correct, eth0 is connected to a switch which is connected to clients. Oct 31, 2012 at 15:17

1 Answer 1

1

Your eth0 interface is probably controlled by NetworkManager, which shuts the connection down once it has something it deems better suited for getting online.

You could create a static configuration for eth0 in /etc/network/interfaces. I.e. insert some lines like this:

auto eth0
iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255

This should tell NetworkManager to leave the interface alone. Enable routing by invoking echo 1 |sudo tee /proc/sys/net/ipv4/ip_forward. And make sure your DHCP server announces 192.168.1.1 as the gateway (in this example).

2
  • So how would I then provide Internet to the clients? Oct 31, 2012 at 15:17
  • With the described setup every Device connected to the cable interface of your computer would be routed to the internet whenever the computer itself has any kind of internet connection. From the fact that you set up and configured a DHCP server yourself I assume that you know at least basic facts about TCP/IP setup and routing. Oct 31, 2012 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .