Community discussions

MikroTik App
 
Aerowinder
newbie
Topic Author
Posts: 27
Joined: Fri Jan 31, 2020 4:09 pm

Bridge VLAN IP assignment behavior

Sat Sep 12, 2020 8:22 pm

On my CRS326, I have a single bridge that spans all of the switch ports (default). On this bridge, I have assigned a management VLAN with a static IP address (bridge is set to tagged on this VLAN). I have one incoming (tagged) trunk that carries all VLANs, and access ports that are untagged (have PVID to tag them when they get to the switch). I have assigned a static IP address to the management interface (on bridge). All others will pull DHCP from an upstream router.

On my CRS326, if I have 2 ports that carry the management VLAN - one is the trunk port (tagged), and the other is an access port on the switch (untagged) - how does the switch know which interface to hand out the management VLAN address to? Is it based on whichever device is connected first (that resides on the management VLAN)? If so, how does this work after a reboot?

Normally, I would not have multiple management ports on a switch, but on this particular switch, it's kind of a test bench, so it needs access ports to all of these different VLANs. See relevant config snippet below. Management VLAN is MGMT876
/interface vlan
add interface=bridge name=vlan273 vlan-id=273
add interface=bridge name=vlan458 vlan-id=458
add interface=bridge name=vlan387 vlan-id=387
add interface=bridge name=MGMT876 vlan-id=876
add interface=bridge name=vlan123 vlan-id=123

/ip address
add address=10.10.1.5/24 interface=MGMT876 network=10.10.1.0

/interface bridge vlan
add vlan-ids=876 bridge=bridge tagged=bridge,ether1,ether15,ether16 untagged=ether11,ether12

/interface bridge port
set [ find interface=ether1 ] frame-types=admit-only-vlan-tagged
set [ find interface=ether11 ] pvid=876 comment="Spare MGMT876"
set [ find interface=ether12 ] pvid=876 comment="Spare MGMT876"
set [ find interface=ether15 ] frame-types=admit-only-vlan-tagged comment="Spare Trunk"
set [ find interface=ether16 ] frame-types=admit-only-vlan-tagged comment="Spare Trunk"
To verify, I am receiving the expected behavior. Trunk port gets the management VLAN static IP address, access ports are pulling DHCP from upstream router. I just don't know WHY it's working, and how to ensure that the same port is always getting the management address.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Bridge VLAN IP assignment behavior

Sat Sep 12, 2020 9:17 pm

I'm not completely sure what you're after, but the address belongs to MGMT876 interface, it doesn't go anywhere else. Other interfaces (bridge ports) are on another level below. Bridge is like switch, it's transparent for IP. Your 10.10.1.5 is reachable on all those ports you defined in /interface bridge vlan.
 
Aerowinder
newbie
Topic Author
Posts: 27
Joined: Fri Jan 31, 2020 4:09 pm

Re: Bridge VLAN IP assignment behavior

Sat Sep 12, 2020 11:16 pm

I'm not completely sure what you're after, but the address belongs to MGMT876 interface, it doesn't go anywhere else. Other interfaces (bridge ports) are on another level below. Bridge is like switch, it's transparent for IP. Your 10.10.1.5 is reachable on all those ports you defined in /interface bridge vlan.
Allow me to try to rephrase. I know that the address belongs to the MGMT876 interface. My question is, when multiple switch ports that are part of the bridge, whether trunk or access, carry that VLAN, how does the switch know (1) which port to assign that IP address to, and (2) how does it know if it already assigned it, and to start handing out DHCP instead?
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Bridge VLAN IP assignment behavior

Sat Sep 12, 2020 11:56 pm

You may need to try once more.

I don't know what you mean by (1), the address is where it is, it doesn't get assigned to any specific port. It's like if you'd split the config between two devices, one with bridge and vlan config, but no address or vlan interface, and another with just address and single port connected to first device (to some of access ports), then the other device would be like your current vlan interface on your one device, i.e. the address would be there and bridge/vlan config would just allow access to it from different ports.

Similar with (2), I don't know what you mean. This static address is not going anywhere, and it doesn't have anything to do with dhcp. If there are other devices connected to this vlan and they want address from dhcp, they'll send a request and dhcp server, if there is any, on this device or another, will give them some.
 
Aerowinder
newbie
Topic Author
Posts: 27
Joined: Fri Jan 31, 2020 4:09 pm

Re: Bridge VLAN IP assignment behavior

Sun Sep 13, 2020 1:08 am

You may need to try once more.

I don't know what you mean by (1), the address is where it is, it doesn't get assigned to any specific port. It's like if you'd split the config between two devices, one with bridge and vlan config, but no address or vlan interface, and another with just address and single port connected to first device (to some of access ports), then the other device would be like your current vlan interface on your one device, i.e. the address would be there and bridge/vlan config would just allow access to it from different ports.

Similar with (2), I don't know what you mean. This static address is not going anywhere, and it doesn't have anything to do with dhcp. If there are other devices connected to this vlan and they want address from dhcp, they'll send a request and dhcp server, if there is any, on this device or another, will give them some.
With the config snippet above that I posted, I'm saying that the Winbox/SSH/etc connection to this switch will be achieved through address 10.10.1.5 via the management VLAN. This is because the bridge is tagged on the management VLAN.

I think I just noticed why you're having a hard time understanding my line of thinking. The static address I've assigned is FOR the SWITCH, particularly the management VLAN on the switch, not for the devices that connect to said switch, which would typically be DHCP. Definitely an idiot moment, thank you for making me rethink it a little more thoroughly.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Bridge VLAN IP assignment behavior  [SOLVED]

Sun Sep 13, 2020 1:21 am

Address is on the switch, so it's for the switch, switch owns it, other devices wanting to connect to service on the switch will connect to this addres, ... all good, I got this part.

But I still don't know what you're asking about. It can be me, maybe someone else will get it. Or if you feel like it, you can try to explain it in some other way.
 
Aerowinder
newbie
Topic Author
Posts: 27
Joined: Fri Jan 31, 2020 4:09 pm

Re: Bridge VLAN IP assignment behavior

Sun Sep 13, 2020 1:37 am

No, my questions had a faulty premise. Thank you for pointing it out.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot], sebi099 and 224 guests