DHCP not working on VLANs - SOLVED
-
I am running into an issue with DHCP on VLANs.
tldr: I did end up solving the issue but since I was about to post the topic and it may help others, I decided to keep it.I did find a post that sounded similar (https://forum.netgate.com/topic/112358/no-dhcp-on-vlan-interfaces) but I did setup my interface fine I think (see below).
So here is a recap of where I stand:
- I am on a Mac and I did create some virtual interfaces for the VLANs
- I have a typical LAN with DHCP
- I have a few VLANs, all showing the same issue
Running a DHCP request on the LAN works as expected:
sudo nmap --script broadcast-dhcp-discover -e en0
Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-02 19:30 CEST Pre-scan script results: | broadcast-dhcp-discover: | Response 1 of 1: | Interface: en0 | IP Offered: 192.168.0.197 | DHCP Message Type: DHCPOFFER | Server Identifier: 192.168.0.1 | IP Address Lease Time: 2h00m00s | Subnet Mask: 255.255.255.0 | Router: 192.168.0.1 | Domain Name Server: 192.168.0.1 |_ Domain Name: ....
All good. If I do the same test on a VLAN, I get no DHCP response.
Here is one of the VLANs:
The interface was created with a static IP:
And the DHCP was setup for the interface:
I also defined one static mapping.
I can ping the router on the VLAN:
But my machine (Mac) and others do not get leases.
Hardware-wise:
Mac -> trunk -> Unifi USW -> ... -> ...
... thank you internet for the rubber ducking... In the chain, most (but not all, and that was the issue) links were trunk and ONE was LAN only... so my VLAN traffic did not go through, as expected, and causing my problem.
Problem solved.