Client cannot receive a DHCP address on a specific VLAN

Hello,

I have a Mikrotik CRS112-8P-4S directly connected to an HPE switch. The HPE switch is the DHCP server for VLAN 1 and VLAN 50, the DHCP relay for VLAN 1 is working but the relay for VLAN 50 is giving some issues. The DHCP for VLAN 50 on the HPE is correctly assigning DHCP addresses for other switches directly connected to it, the only “problematic” switch is the Mikrotik.

The client that is not receiving the IP address in VLAN 50 is connected on eth2 and the trunk to the HPE switch is on eth8. The client needs to receive an IP address from the HPE switch on VLAN 50 and then, if it has the requirements, on VLAN 1 (the change of VLAN is carried by 802.1x, and is working good this assignment on VLAN 1, so the production VLAN).

Below I’m pasting the configuration of the ports, the vlan, can You please help me to find out what is missing? The IP address of the VLAN 50 on the Mikrotik can ping the VLAN 50 address of the HPE switch and vice versa, but the DHCP is not working.

[...]

/interface bridge
add admin-mac=D4:01:C3:D9:50:A9 auto-mac=no comment=defconf name=bridge vlan-filtering=yes
/interface vlan
add interface=bridge name=vlan50 vlan-id=50

[...]

/interface bridge port

add bridge=bridge comment=defconf interface=ether2 pvid=50

[...]

add bridge=bridge comment=defconf interface=ether8

[...]

/interface bridge vlan
add bridge=bridge tagged=ether8 untagged=ether3,ether4,ether5,ether6,ether7,ether2 vlan-ids=50
add bridge=bridge tagged=ether8 untagged=ether1 vlan-ids=1
/interface dot1x server
add accounting=no disabled=yes guest-vlan-id=50 interface=ether2 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1

[...]

add address=10.1.109.125/25 interface=bridge network=10.1.109.0
add address=10.50.109.125/25 interface=vlan50 network=10.50.109.0

[...]

Thank You and kind regards

Please post the whole configuration, it is improbable that with only the snippets you posted anyone will be able to understand where the issue might be.

wild guess: you didn’t mark DHCP port as trusted.

But yes: paste the whole config and create a network diagram

Hello!

I changed the topology: the eth1 is the port of the trunk, eth2 is the port of the IP camera. The DHCP for VLAN1 is working, also I noticed that even if I put the IP camera in vlan 50, the ip address gained in vlan 1 still works and is reachable. Now the 802.1x on the eth2 is disabled, so the device must use the VLAN 50

The configuration:

/interface bridge
add admin-mac=D4:01:C3:D9:50:A9 auto-mac=no comment=defconf name=bridge vlan-filtering=yes
/interface list
add name=WAN
add name=LAN
/port
set 0 name=serial0
/snmp community
add addresses=::/0 name=##########
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2 pvid=50
add bridge=bridge comment=defconf interface=ether3 pvid=50
add bridge=bridge comment=defconf interface=ether4 pvid=50
add bridge=bridge comment=defconf interface=ether5 pvid=50
add bridge=bridge comment=defconf interface=ether6 pvid=50
add bridge=bridge comment=defconf interface=ether7 pvid=50
add bridge=bridge comment=defconf interface=ether8 pvid=50
add bridge=bridge comment=defconf interface=sfp9
add bridge=bridge comment=defconf interface=sfp10
add bridge=bridge comment=defconf interface=sfp11
add bridge=bridge comment=defconf interface=sfp12
/interface bridge vlan
add bridge=bridge tagged=ether1 untagged=ether2 vlan-ids=50
add bridge=bridge tagged=ether1 vlan-ids=1
/interface dot1x server
add accounting=no guest-vlan-id=50 interface=ether2 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1 NOW DISABLED
add accounting=no guest-vlan-id=50 interface=ether3 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether4 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether5 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether7 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether6 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
/interface ethernet switch port
set 1 vlan-type=edge-port
set 2 vlan-type=edge-port
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
add interface=sfp9 list=LAN
add interface=sfp10 list=LAN
add interface=sfp11 list=LAN
add interface=sfp12 list=LAN
/ip address
add address=10.1.109.125/25 interface=bridge network=10.1.109.0
/ip dns
set servers=10.1.5.9
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=10.1.109.126 routing-table=main suppress-hw-offload=no
add disabled=no dst-address=10.50.109.0/25 gateway=10.50.109.126 routing-table=main suppress-hw-offload=no
/ip ssh
set always-allow-password-login=yes forwarding-enabled=both
/radius
add address=10.1.5.19 authentication-port=1645 require-message-auth=no secret=########## service=dot1x src-address=10.1.109.125
/radius incoming
set accept=yes
/snmp
set enabled=yes trap-community=########## trap-version=2
/system clock
set time-zone-name=Europe/Rome
/system clock manual
set time-zone=-02:00
/system identity
set name=SW-A-P
/system logging
add topics=radius,debug
/system ntp client servers
add address=193.204.114.105
add address=10.1.5.254
/tool sniffer
set filter-interface=ether2 filter-mac-protocol=ip filter-port=bootps,bootpc memory-scroll=no

Thank You

Hello!

Below the diagram and the configuration. I changed the topology: the eth1 is the port of the trunk, eth2 is the port of the IP camera. The DHCP for VLAN1 is working, also I noticed that even if I put the IP vcamera in vlan 50, the ip address gained in vlan 1 still works and is reachable. Now the 802.1x on the eth2 is disabled, so the device must use the VLAN 50

The configuration:

/interface bridge
add admin-mac=D4:01:C3:D9:50:A9 auto-mac=no comment=defconf name=bridge vlan-filtering=yes
/interface list
add name=WAN
add name=LAN
/port
set 0 name=serial0
/snmp community
add addresses=::/0 name=##########
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2 pvid=50
add bridge=bridge comment=defconf interface=ether3 pvid=50
add bridge=bridge comment=defconf interface=ether4 pvid=50
add bridge=bridge comment=defconf interface=ether5 pvid=50
add bridge=bridge comment=defconf interface=ether6 pvid=50
add bridge=bridge comment=defconf interface=ether7 pvid=50
add bridge=bridge comment=defconf interface=ether8 pvid=50
add bridge=bridge comment=defconf interface=sfp9
add bridge=bridge comment=defconf interface=sfp10
add bridge=bridge comment=defconf interface=sfp11
add bridge=bridge comment=defconf interface=sfp12
/interface bridge vlan
add bridge=bridge tagged=ether1 untagged=ether2 vlan-ids=50
add bridge=bridge tagged=ether1 vlan-ids=1
/interface dot1x server
add accounting=no guest-vlan-id=50 interface=ether2 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1 NOW DISABLED
add accounting=no guest-vlan-id=50 interface=ether3 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether4 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether5 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether7 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
add accounting=no guest-vlan-id=50 interface=ether6 reauth-timeout=5m reject-vlan-id=50 server-fail-vlan-id=1
/interface ethernet switch port
set 1 vlan-type=edge-port
set 2 vlan-type=edge-port
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
add interface=sfp9 list=LAN
add interface=sfp10 list=LAN
add interface=sfp11 list=LAN
add interface=sfp12 list=LAN
/ip address
add address=10.1.109.125/25 interface=bridge network=10.1.109.0
/ip dns
set servers=10.1.5.9
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=10.1.109.126 routing-table=main suppress-hw-offload=no
add disabled=no dst-address=10.50.109.0/25 gateway=10.50.109.126 routing-table=main suppress-hw-offload=no
/ip ssh
set always-allow-password-login=yes forwarding-enabled=both
/radius
add address=10.1.5.19 authentication-port=1645 require-message-auth=no secret=########## service=dot1x src-address=10.1.109.125
/radius incoming
set accept=yes
/snmp
set enabled=yes trap-community=########## trap-version=2
/system clock
set time-zone-name=Europe/Rome
/system clock manual
set time-zone=-02:00
/system identity
set name=SW-A-P
/system logging
add topics=radius,debug
/system ntp client servers
add address=193.204.114.105
add address=10.1.5.254
/tool sniffer
set filter-interface=ether2 filter-mac-protocol=ip filter-port=bootps,bootpc memory-scroll=no

Thank You

Besides and before anything else, you shouldn't use "numbers" with set, if not in an interactive session:

You never know which item is actually 1 or 2.

Generally speaking the "correct" way is to use find to select an item from one unique characteristic (like name, address, comment, etc.), see:

but in your case you can probably use port names directly (if this is what you want to obtain) i.e.:

/interface ethernet switch port
set ether1 vlan-type=edge-port
set ether2 vlan-type=edge-port

Now the 802.1x on the eth2 is disabled, so the device must use the VLAN 50

How did you disable it exactly?

Do you really need dot1x?

set 1 vlan-type=edge-port

Do you use IVL?

As situation isn’t clear, use Torch or sniffer to see which traffic goes to which interface

I disabled it via winbox, using “disable” for 802.1x on the single port, the 802.1x is strictly needed but for now I’m happy if we put the camera in the conditions to have an IP in vlan 50, I don’t use IVL

Since I can reach the camera on a VLAN 1 IP address assigned by DHCP, even if the port is in VLAN 50, it seems that the switch is ignoring the vlan 50 or putting all the incoming/outgoing traffic in VLAN 1, do You know what might cause this behaviour?

Thank You

I disabled it via winbox, using “disable” for 802.1x on the single port

please, show your config

it seems that the switch is ignoring the vlan 50 or putting all the incoming/outgoing traffic in VLAN 1,

This is why I suggested to use Torch or Sniffer (both available in Winbox) to see which traffic goes where.

PS:

On eth2, set

frame-types=admit-only-untagged-and-priority-tagged

on trunk (eth1) set

frame-types=admit-only-vlan-tagged

and do not use vlan1 as it means “no vlan at all”

Example:

Hello,

I really cannot use a different VLAN to replace VLAN1, unfortunately changing this VLAN will have an impact on a highly sensitive environment. I will perform some test and update You as soon as possible

Thank You!