1

I have an AP which broadcasts several SSIDs tagged with different VLANs. The AP is wired to a server which manages the traffic.

There are several different well documented ways to set up a DHCP server to manage such VLANs. For testing purposes I have a tagged and non-tagged network defined on a lan0 interface:

root@srv ~# ip addr

3: lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1b:21:5c:29:64 brd ff:ff:ff:ff:ff:ff
    inet 10.100.10.254/24 brd 10.100.10.255 scope global lan0:10
       valid_lft forever preferred_lft forever
    inet 10.10.10.254/24 brd 10.10.10.255 scope global lan0
       valid_lft forever preferred_lft forever
(...)

35: lan0.10@lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:1b:21:5c:29:64 brd ff:ff:ff:ff:ff:ff
    inet 10.100.10.254/24 brd 10.100.10.255 scope global lan0.10
       valid_lft forever preferred_lft forever

This corresponds to the entries in /etc/network/interfaces

auto lan0
iface lan0 inet static
        address 10.10.10.254
        netmask 255.255.255.0

auto lan0.10
iface lan0.10 inet static
        address 10.100.10.254
        netmask 255.255.255.0
        vlan-raw-device lan0

I want to serve on the DHCP server both of these networks:

subnet 10.10.10.0 netmask 255.255.255.0 {
        range 10.10.10.100 10.10.10.200;
        option routers 10.10.10.254;
        option domain-name-servers 10.10.10.254;
}

subnet 10.100.10.0 netmask 255.255.255.0 {
    range 10.100.10.100 10.100.10.200;
    option routers 10.100.10.254;
    option domain-name-servers 10.100.10.254;
}

When starting the DHCP server I get

root@srv ~# /usr/sbin/dhcpd -d -f
Internet Systems Consortium DHCP Server 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 14 leases to leases file.
Interface lan0 matches multiple shared networks

What does this error message mean in the context of my configuration?

WoJ
  • 3,365
  • 8
  • 46
  • 75

2 Answers2

1

You have same ip address 10.100.10.254/24 on two different interfaces lan0 and lan0.10. lan0:10 is the same interface lan0. It is used to assign several ip addresses on one interface.

Your /etc/network/interfaces config is right. I think you will not give dhcp error after reboot.

Be sure that network-manager will not add second ip address on interface lan0.

Mikhail Khirgiy
  • 2,003
  • 9
  • 7
  • This is the status after reboot. `lan0.10` (with a dot) is, physically, the same interface as `lan0` (as indicated in the network config) but actually a different VLAN. I am not sure if you are not mixing this with virtual interfaces (which would be with a colon, as in your answer). – WoJ Sep 10 '16 at 16:32
  • See the output of your command `ip addr`. Vlan Interface lan0.10 is different interface then lan0. But lan0:1 is used to assign second ip address on lan0 interface. Check Network-Managers config. I tink the problem is there. – Mikhail Khirgiy Sep 10 '16 at 16:40
  • And you were absolutely right! Thank you. What I realized is that after rebooting I tested some settings and must have sneaked in a virtual ip somewhere. Everything is back to normal now. – WoJ Sep 10 '16 at 16:50
-1

In my case, I created two networks, both attached to the same interface.

This is really easy to do now a day, especially with the netplan setup:

network:
    version: 2
    renderer: networkd
    ethernets:
        eno1:
            addresses:
                - 192.168.11.1/24
                - 10.11.23.1/24

And I use that a lot, all the time, everywhere....

What I did not yet know is the fact that the ISC DHCP server is not happy about such. If I want to accept DHCP on more than one network, it just can't be on the same interface.

With such a setup and attempting to allow DHCP on 192.168.11.x. and 10.11.23.x, the current implementation gives me the same error (interface matches multiple shared networks).

It took me a while to understand the issue. I had to move everything on the same network. I was trying to add a new network as the old one was running out of IPs, but keep the old one as is. No dice...

One possible answer if the network is similar enough is to enlarge your mask as mentioned here.

Alexis Wilke
  • 2,057
  • 1
  • 18
  • 33