I'm using systemd-networkd on Debian 13 and I'm trying to add a routing policy rule to a macvlan interface but it won't take effect.
This is my scenario: I have two WAN interfaces over a single link (don't ask), both of them are macvlans with different MAC addresses, DUIDs, etc. Inbound connection packets reach the macvlans, but then the replies try to go out the default gateway and connections fail. So I'm giving the macvlans their own routing tables with:
[Route]
Gateway=_ipv6ra
Table=1234
GatewayOnLink=yes
... and trying to add routing policy rules to match, but my settings in the .network file are not being applied unless I match on the IP address, for example this works:
[RoutingPolicyRule]
From=2001:xxxx:xxxx:xxxx::1
Table=1234
Priority=200
But this, which doesn't require knowing the IP address ahead of time, doesn't:
[RoutingPolicyRule]
SourcePort=80
Table=1234
Priority=200
Because systemd-networkd doesn't add the routing rule, 'ip -6 rule' shows nothing. If I add it manually:
ip -6 rule add sport 80 table 1234
Then it works. Anyone have an idea why systemd-networkd would fail to add the rule? It doesn't report anything in the journal.