Possible BUG in OpenWrt/DHCP when using VLAN

I found some problem when using multiple VLANS over one NIC connected to OpenWRT.

Steps to reproduce:

  1. OpenWRT prepare two VLAN networks, say VLAN 1 and VLAN 2
  2. Get a server with single NIC and set VLAN 1 and VLAN 2 on it.
  3. In OpenWRT DHCP set static lease for servers NIC VLAN 1, leave VLAN 2 custom. Also for VLAN 1 and VLAN 2 set different IP ranges, say for VLAN 1 10.0.100.x and for VLAN 2 10.0.110.x
  4. Connect OpenWRT with the server through LAN trunk port.

Actual result:
every time after around two days (in my case), DHCP on server stop receiving IP address for VLAN 2. Syslog on the server have message: dhcp lease lost. In OpenWRT Status page doesn't show IP for VLAN 2 only for VLAN 1

Expected result:
DHCP properly assign ip address for VLAN 1 and VLAN 2

Possible workaround
set different mac address for VLAN 1 and VLAN 2

Extra info
A temporary workaround is unplug the cable from the server and plug it back. Nothing else works like restarting systemd on the server, resetting netplan and so on.

So it seems that dhcp on OpenWRT got confused that same mac address is connecting from two VLAN networks which actually shouldn't be a problem imho, or maybe I'm wrong?

Did you enable logs on dnsmasq (option logdhcp) to check what is going on?

tbh no, didn't knew about that and right now I've got fixed this by setting custom mac for VLAN 2.
I can't also change it back as I need this machine to be working so I'm leaving info here :frowning:
Also I forgot to mention there, that the issue show up after 2 days :frowning:
so replug, wait two days - problem, replug, two days fine, then problem.

And how long is the lease time?

It's standard, 12h

In two day's time you have the initial lease and 8 renewals. If it was a problem of the DHCP server confused by the same mac address, the problem would appear much earlier.

1 Like

plausible, then why it works in the beggining and not later?
You think server?

I think that we don't have enough data to find the problem.

1 Like

You can also try the split DNS/DHCP.
This way the vlan1 instance is unaware of the vlan2 instance mac addresses.

oh my, when I see that, it seems the easiest for me is to just make new macaddress