1

I want to configure a linux(ubuntu) machine such that when a direct connection is made with another PC my machine will enable a DHCP server and serve it an IP address, but if my machine is connected to a network with an existing DHCP server I want make sure my DHCP server is disabled and obtain an IP-address from the networks DHCP server.

If there are any better ways to manage the direct connection than having my own dhcp server, great. The only thing is that I do not want to use static IP addresses or force the external computer to use a static IP addresses.

So heres the two situations:

1. Us DHCP to serve an address to the PC

Linux box ------------- PC

2. Obtain an address automatically from the network

Linux box ------------- network

I want to automatically do the appropriate thing depending on what my machine gets connected to.

4
  • What do you mean by a "direct connection" to another PC?
    – John
    Commented Oct 18, 2012 at 21:48
  • as in someone uses an ethernet cable with one end connected to my linux machine and the other to a PC. I'm assuming that Auto-MDIX will take care of the crossover-ness.
    – richmb
    Commented Oct 19, 2012 at 14:21
  • 1
    Having a DHCP server running on your machine to serve a local NAT that's routed to your WAN is not mutually exclusive with having your WAN interface obtain an IP from a downstream DHCP server. You can just use NetworkManager to turn on connection sharing (similar to Windows' ICS) and it'll do the appropriate routing rules, DNS, DHCP, etc. Commented Oct 19, 2012 at 14:35
  • I think I'm going to enable dhcp fallback/auto-ip(avahi) on the linux machine and see how that works
    – richmb
    Commented Nov 5, 2012 at 13:43

0

You must log in to answer this question.

Browse other questions tagged .