Ummm, router or switch? SwitchOS does not include a DHCP server, so I have to assume you are talking about a router, and not a switch. what hardware?
Sure you can assign a DHCH server to a VLAN. If the VLAN exists, you can assign a DHCP server to the VLAN - it’s just another interface selection. I have several on one of RB750 routers.
You setup the switch menu VLAN to be able to talk to the cpu port as well as the physical ports it needs, then create the same vlan# under interfaces menu for the ‘master port’ of the switch. Assign that vlan interface to the dhcp server.
It’s a CRS125, which is listed under “switches” on their routerboard.com website. That is why I called it a switch.
It’s not clear to me when we should create a virtual VLAN interface, or when we can just use the switch VLAN settings. Can someone clearify this for me?
For instance in example 2 of the above link, there is no virtual VLAN interface created. Let’s say I want to connect the red VLAN300 there with a DHCP server, then I need to create a virtual VLAN interface on the masterport, and put the DHCP server on that port? It can’t be done without creating a virtual VLAN interface?
Switch VLAN settings control what VLAN tags your switch will allow or process. Creating a VLAN interface creates it at the CPU, which is necessary for inter-VLAN routing. The CRS can do some limited routing, but its CPU isn’t strong enough for heavy use.
You need the internal virtual vlan set up and cpu authorized any time you want the vlan to send/receive information from the router… like dhcp assignments.
If you’re just routing the vlan through the switch and out another physical port, then there’s no need for the virtual interface.