I'm migrating a legacy Debian setup to a new Ubuntu setup. I have previously set, in
post-up /sbin/ip rule add fwmark 1 table table.tunnel pre-down /sbin/ip rule del fwmark 1 table table.tunnel
Now that I'm on Ubuntu, it looks like I need to use netplan and the routing-policy section. Specifically, I think I should be able to use:
network: version: 2 renderer: networkd ethernets: eno1: dhcp4: yes dhcp6: yes routing-policy: - table: 201 fwmark: 1
Where table.tunnel is 201 in
/etc/iproute2/rt_table. I've just upgraded to Ubuntu 18.04, as fwmark isn't documented as available in the netplan version included in 17.10.
When I try and apply the configuration, I get the error:
The overwriting error message was: Error in network definition //etc/netplan/01-netcfg.yaml line 10 column 7: IP routing policy must include either a 'from' or 'to' IP Error in network definition //etc/netplan/01-netcfg.yaml line 10 column 9: unknown key fwmark
It seems incorrect that I need to have a to/from in routing-policy (rather than routing) and this is suggested in man page:
routes (mapping) The routes block defines standard static routes for an interface. At least to and via must be specified. .... routing-policy (mapping) The routing-policy block defines extra routing policy for a network, where traffic may be handled specially based on the source IP, firewall marking, etc.
Even if I put in a random to address, it still throws up the unknown key fwmark (even though this is stated in the man page).
Anyone got any thoughts?