Small bug in DHCP Relay settings 6.49.17

While doing some “crazy” experiments on a hap lite running 6.49.17 I happened to find a “strange” thing related to the /ip dhcp-relay.

I tried adding a dhcp relay:

/ip dhcp-relay
add dhcp-server=192.168.1.151 interface=bridge1 name=relay1

ok.

The I tried adding a second one, and (correctly) it wasn’t possible as a relay was already assigned to bridge1.

So I disabled the first one in Winbox (x button) and proceeded to add a second one.

Now, if I do a

/ip dhcp-relay export

I get:

/ip dhcp-relay
add dhcp-server=192.168.1.151 interface=bridge1 name=relay1
add dhcp-server=192.168.1.1 interface=bridge1 name=relay2

The result is the same whether:

  1. first one is disabled and the second is enabled
  2. first one is enabled and the second is disabled
  3. both are disabled

I would have expected that in the export there was a way to distinguish between enabled and disabled in a “normal” export.

With

/ip dhcp-relay export verbose

the “disabled=yes” appears alright.

I presume that since the whole /ip dhcp-relay stuff seems to be not very commonly used it hasn’t been noticed till now.

Very likely if you try to import (or copy/paste) the settings from an export it will give an error on the second relay, but if you have only one relay configured but disabled, it will likely be imported as enabled.

disabled=yes is the default value, hence it doesn’t appear in export. If you enable one of them you will see “disabled=no”. Tested on 6.49.17.

Ah, OK :slight_smile: , I tried again (started from scratch after a reset with no default configuration to be sure) and you are right, though the “logic” is inverted, I can confirm that now it works as you described, then it was only a false alarm, sorry :blush:

I wonder how it could have happened yesterday, maybe I should sleep more and play less with Mikrotik configurations :unamused:

Anyway, when you add a relay via command line/terminal it is added as disabled, when you add it via Winbox it is added as enabled by default, so it is just a matter of a “different” default when adding it via command line vs. when adding it via Winbox (unless you explicitly press the Disable button).