Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Have you seen help.ubuntu.com/community/Internet/ConnectionSharing? –  jdthood Oct 30 '12 at 16:28
    
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. –  Dudemcman 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. –  Dudemcman Oct 31 '12 at 15:17
add comment

1 Answer 1

up vote 0 down vote accepted

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).

share|improve this answer
    
So how would I then provide Internet to the clients? –  Dudemcman 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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