0

I am running Raspbian and trying to run cmd service isc-dhcp-server start. This returns the msg

[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!

my /var/sys/log file contains

dhcpd: Wrote 0 leases to leases file.
dhcpd: Multiple interfaces match the same subnet: wlan0 eth0
dhcpd: Multiple interfaces match the same shared network: wlan0 eth0
dhcpd:
dhcpd: No subnet declaration for wlan1 (no IPv4 addresses).
dhcpd: ** Ignoring requests on wlan1.  If this is not what
dhcpd:    you want, please write a subnet declaration
dhcpd:    in your dhcpd.conf file for the network segment
dhcpd:    to which interface wlan1 is attached. **
dhcpd:
dhcpd:
dhcpd: Not configured to listen on any interfaces!

My /etc/network/interfaces contains

auto lo
iface lo inet loopback


iface wlan1 inet static
        address 192.168.42.1
        netmask 255.255.255.0


iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.1

allow-hotplug wlan0

iface wlan0 inet static
        address 192.168.1.200
        netmask 255.255.255.0
        gateway 192.168.1.1

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

up iptables-restore < /etc/iptables.ipv4.nat

Breaking down the error log

Multiple interfaces match the same subnet: wlan0 eth0

Is subnet labelled as address inside the /etc/network/interfaces file? If so, eth0 has address 192.168.1.100 and wlan0 has address 192.168.1.200. These are different.

Furthermore. When I rearrange my /etc/network/interfaces file and order the blocks as the following

auto lo
iface lo inet loopback

iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.1

allow-hotplug wlan0

iface wlan0 inet static
        address 192.168.1.200
        netmask 255.255.255.0
        gateway 192.168.1.1

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

iface wlan1 inet static
        address 192.168.42.1
        netmask 255.255.255.0

up iptables-restore < /etc/iptables.ipv4.nat

The error in my var/sys/log file changes to only

dhcpd: Wrote 0 leases to leases file.
dhcpd: No subnet declaration for wlan1 (no IPv4 addresses).
dhcpd: ** Ignoring requests on wlan1.  If this is not what
...

Why does the previous** dhcpd: Multiple interfaces match the same subnet: wlan0 eth0** disappear just because of the ordering of this file? if they match the same subnet then they should always match regardless of declaration right?

  • You realise you're trying to run the DHCP server, and not the client? Please post the server configuration file in your question. It's likely you've got the same subnet assigned to both interfaces. – roaima Sep 16 '15 at 22:45
  • have u check > ip a s if you get to IP addresses on the same interface the problem is that you have two dhcp client working one ontop of each other... have a look here – maco1717 Jan 14 '17 at 3:21
1

The subnets for eth0 and wlan0 both have the same subnet/network address.

The subnet address (a.k.a. the network address) for eth0 in interfaces is 192.168.1 (a.k.a 192.168.1.0). It is determined by taking the "logical and" of the "address" and the "netmask". The "address" is 192.168.1.100 and the "netmask" is 255.255.255.0.

In decimal notation the value of digit locations are ... 10000,1000,100,10,1.

In binary notation the values are ... 128, 64, 32, 16, 8, 4, 2, 1.

                           128 64 32 16 8 4 2 1 
 Since 192=128+64  it is     1  1  0  0 0 0 0 0  or 11000000  in binary.
 Since 168=128+32+8 it is    1  0  1  0 1 0 0 0  or 10101000  in binary.
 Since 1=1  it is            0  0  0  0 0 0 0 1  or 00000001  in binary.
 Since 100=64+32+4  it is    0  1  1  0 0 1 0 0  or 01100100  in binary.
 Since 200=128+64+8 it is    1  1  0  0 1 0 0 0  or 11001000  in binary.
 255=128+64+32+16+8+4+2+1 or 1  1  1  1 1 1 1 1  or 11111111  in binary.

To find the subnet or network address we must do a "logical and" of the "address" and the "netmask". The "logical and" of 0 and 0 = 0, 1 and 0 = 0, 0 and 1 = 0, and finally 1 and 1 = 1. Therefore 192.168.1.100 logical and 255.255.255.0 is

                  11000000.10101000.00000001.01100100
 "logical and"    11111111.11111111.11111111.00000000  gives
                  11000000.10101000.00000001.00000000 which equals
                       192.     168.       1.       0  or 192.168.1.0 

Likewise 192.168.1.200 logical and 255.255.255.0 is

                  11000000.10101000.00000001.11001000
 "logical and"    11111111.11111111.11111111.00000000  gives
                  11000000.10101000.00000001.00000000 which equals
                       192.     168.       1.       0  or 192.168.1.0 

Thus the two subnets have the same address and are therefore the same subnet.

The fix is to change 192.168.1.200 to 192.168.2.200 or to change 192.168.1.100 to 192.168.2.100.

For a related example see DHCP server: offer different subnet addresses for different interfaces

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.