User avatar
Kyong
Posts: 5
Joined: Sat Dec 22, 2012 9:28 pm

isc-dhcp-server doesn't work if LAN is disconnected

Tue May 19, 2015 12:31 pm

Hi, I have a problem with isc-dhcp-server which I was unable to found solution for.
My configuration is:
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.50;
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
host fox-pc {hardware ethernet 00:1D:0F:B4:A4:BE; fixed-address 192.168.2.3;}
host fox-ntb {hardware ethernet 0C:D2:92:45:CD:56; fixed-address 192.168.2.4;}
}

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.50;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}

The first one is for WLAN and the second is for LAN. If everything is connected than both works. My problem is that if I don't have anything connected to the LAN port when dhcp server is starting then after connected anything to that port doesn't get IP from the server. If I connect something and restart dhcp server (or the whole system) then the connected device obtain an IP address. Then I can disconnect it and connect again to the port and it obtain again.
So the problem is that isc-dhcp-server refuse to assign IP address to any device if it is started without anything plugged in LAN port. And I just want to use it as a router but not to have something still connected.
How to solve this problem without having to restart dhcp server after plugging any device before the start of the system?

User avatar
realies
Posts: 43
Joined: Fri Jul 18, 2014 9:27 am

Re: isc-dhcp-server doesn't work if LAN is disconnected

Wed May 20, 2015 7:37 am

I've had a similar problem when trying to work out 2 wireless dongles, one broadcasting a hotspot and the other being connected to a network as a client. I've found a not so good solution, but it turns out it worked for what I've did.

The problem with me was that if I'm connected to the hotspot and and connect/reconnect/disconnect the wireless client, the hotspot would lose its router IP address for some unknown reason and would stay that way until I restart the networking services or the system.

My solution was to add a pre-up ifconfig wlan0 10.10.0.1 in the /etc/network/interfaces file, which is supposed to tell the hotspot dongle to know its IP address every time I do a change with the client one. Maybe you could try and put this line in the eth0 section, looking like this: pre-up ifconfig eth0 192.168.1.1

Not sure if it could be a solution to your problem, neither do I know what causes this. My thoughts on it are that it might be the isc-dhcp-server or the way the networking service handless the hardware.

Return to “Networking and servers”