Community discussions

MikroTik App
 
uts
newbie
Topic Author
Posts: 25
Joined: Mon Jul 30, 2018 10:40 am

Port 2 deletion in year 2021

Mon Jul 19, 2021 5:46 am

Hi,
Just trying to setup Lag on port 2 and 3 on latest HexS. But removing port 2 from bridge seems to be trickey and brings down network. Please guide and help. Thank You.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: Port 2 deletion in year 2021

Mon Jul 19, 2021 10:14 am

It brings down the network because bridge MAC address changes. By default bridge takes MAC address of first active member port and by default that's ether2. When you remove ether2 from bridge, it takes another MAC address (possibly of ether3 if that port is still member of bridge) and because of that traffic gets paused until connected devices learn new MAC address.

You can manually set bridge MAC address to some other value by setting admin-mac=<MAC address> auto-mac=no. In this case adding or removing ports doesn't affect traffic through unaffected ports.
 
tangent
Forum Guru
Forum Guru
Posts: 1330
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Port 2 deletion in year 2021

Mon Jul 19, 2021 10:28 am

Another fun effect of this is that if you assign static IPs to your MT devices by DHCP reservation, fiddling with the configuration can cause them to unexpectedly change their IP address because they aren't asking from the same MAC as before.

However many ports your MT box has, that's how many MAC addresses it has!
 
uts
newbie
Topic Author
Posts: 25
Joined: Mon Jul 30, 2018 10:40 am

Re: Port 2 deletion in year 2021

Mon Jul 19, 2021 11:52 am

Thank You MKX for clarifying.

Thank you Tangent for important caution.

Combining both replies above, is it best to change MAC of port 2 rather? Assuming Bridge accepts a MAC, that is unique.
 
tangent
Forum Guru
Forum Guru
Posts: 1330
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Port 2 deletion in year 2021

Mon Jul 19, 2021 12:08 pm

If it's essential that you reconfigure the device in a single step so nothing's lost, you could write a bunch of RouterOS commands that deleted the old interfaces, reestablished the new configuration, duplicated MACs, and whatever else was necessary to bring things back up as they were. Such a requirement might occur in an established WISP setup, for instance, where nothing's allowed to go down just because you're reconfiguring the world on the fly. You'd build that RSC script offline, test it on a dummy router until you're satisfied it's a safe migration, then upload it to the MT boxes and run it.

But if you're just doing this on a one-off basis on your home system, I can't see any good reason to go through the bother. Just be aware of what's going on and iterate toward a working configuration, switching from IP-based connections to MAC-based connections when your steps temporarily break the IP setup.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: Port 2 deletion in year 2021

Mon Jul 19, 2021 5:34 pm

It's better to change bridge MAC address. Physical ports have each one factory default (tied to hardware) while bridge is always "inventing" its own MAC address ... this way or another. One way is to use MAC of ether2 but replace second hex-digit from left with one of 2,6,A,E. E.g. if MAC address of ether2 port is B8:69:F4:20:A5:49, assign bridge MAC address B6:69:F4:20:A5:49. Read more about localy administered addresses (LAA).
 
uts
newbie
Topic Author
Posts: 25
Joined: Mon Jul 30, 2018 10:40 am

Re: Port 2 deletion in year 2021

Tue Jul 20, 2021 10:28 am

Thank you both again for reply.
I will have to test run changing bridge's MAC, as per caution by Tangent, DHCP reservation can get messed up.
 
tangent
Forum Guru
Forum Guru
Posts: 1330
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Port 2 deletion in year 2021

Tue Jul 20, 2021 11:41 pm

replace second hex-digit from left with one of 2,6,A,E.

I've done the math, and I can see that that rule works, but I wonder if a simpler rule isn't just "add 2"? This only works if the bottom 2 bits in the top octet of the MAC are 0, but should they not be in any situation where you'd use this rule?
 
andriys
Forum Guru
Forum Guru
Posts: 1526
Joined: Thu Nov 24, 2011 1:59 pm
Location: Kharkiv, Ukraine

Re: Port 2 deletion in year 2021

Sat Jul 24, 2021 11:53 am

This only works if the bottom 2 bits in the top octet of the MAC are 0, but should they not be in any situation where you'd use this rule?
I will assume "bottom 2 bits" means "least significant 2 bits" here. The two least significant bits of the first octet of a MAC address have special meaning. The first least significant bit differentiates between unicast (0) and multicast (1) MAC addresses; interfaces can only have unicast addresses assigned. The second least significant bit differentiates between "universal" and "locally administered" MAC addresses. Factory-assigned MAC addresses must always have this bit set to 0, and you can flip it to 1 to derive a unique MAC address for your local needs.

Who is online

Users browsing this forum: infabo, JDF, qatar2022 and 35 guests