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.

  • 1
    Have you seen help.ubuntu.com/community/Internet/ConnectionSharing? – jdthood Oct 30 '12 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 '12 at 16:30
  • @jdthood Yes, that doesn't work with a DHCP server, at least in my experiences. – Beefy_Swain Oct 30 '12 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. – Paul Hänsch Oct 31 '12 at 2:41
  • Yes, that is correct, eth0 is connected to a switch which is connected to clients. – Beefy_Swain Oct 31 '12 at 15:17

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

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 as the gateway (in this example).

  • So how would I then provide Internet to the clients? – Beefy_Swain Oct 31 '12 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. – Paul Hänsch Oct 31 '12 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.