Hi everyone,
I like playing around with IPv6 and noticed a behavior in RouterOS (currently 7.8 ) which seams to be a bug. But I’m not yet very familiar with RouterOS and no Networking expert, therefore this could be due to a misconfiguration.
This is my DHCPv6 config:
[admin@CRS326] /ipv6> export
/ipv6 dhcp-client
add add-default-route=yes interface=10_Mgmt request=address use-interface-duid=yes
The device pulls an IPv6 address as it should but the resulting routing table looks a bit off:
[admin@CRS326] /ipv6> route print
Flags: D - DYNAMIC; A - ACTIVE; c, s, d, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
DAd ::/0 fe80::2e0:67ff:fe21:ce09%10_Mgmt 1
DAc 2003:aaaa:bbbb:cc10::cc10:41/128 10_Mgmt 0
DAc fe80::%bridge/64 bridge 0
DAc fe80::%10_Mgmt/64 10_Mgmt 0
DAc fe80::%20_Home/64 20_Home 0
DAc fe80::%30_IoT/64 30_IoT 0
DAc fe80::%40_Public/64 40_Public 0
That means, that even if the device communicates within the same subnet (e.g. to 2003:aaaa:bbbb:cc10::cc10:10), it tries to reach the other device via the Gateway. On all my Linux devices a get another standard route that basically says: If you are communicating within the same subnet, just communicate directly via the interface (and not via the gateway).
I was able to work around this with this script within the DHCPv6 config:
/ipv6 route remove [find gateway="10_Mgmt" and dst-address~"/64" and dst-address~"2003"];
:local ip6 [:toip6 $"na-address"]
:local mask6 FFFF:FFFF:FFFF:FFFF::;
:local ip61 ($ip6&$mask6);
/ipv6 route add disabled=no distance=1 dst-address="$ip61/64" gateway=10_Mgmt routing-table=main vrf-interface=10_Mgmt;
Resulting routing table:
[admin@CRS326] /ipv6> route print
Flags: D - DYNAMIC; A - ACTIVE; c, s, d, y - COPY
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DISTANCE
DAd ::/0 fe80::2e0:67ff:fe21:ce09%10_Mgmt 1
0 As 2003:aaaa:bbbb:cc10::/64 10_Mgmt 1 ### <- that is the important line
DAc 2003:aaaa:bbbb:cc10::cc10:41/128 10_Mgmt 0
DAc fe80::%bridge/64 bridge 0
DAc fe80::%10_Mgmt/64 10_Mgmt 0
DAc fe80::%20_Home/64 20_Home 0
DAc fe80::%30_IoT/64 30_IoT 0
DAc fe80::%40_Public/64 40_Public 0
After this, communication within the same subnet is no issue at all.
Question: Why is this rule not added by default? Is my DHCPv6 config just wrong? Is this a bug?
Thank you!