[systemd-devel] Unable to insert a route to a non-default table

Liu, Minsheng lambda at liu.ms
Tue Feb 9 05:16:17 UTC 2021


Hi everyone,

I am trying to setup an app using transparent proxy and I need to insert the following route:

ip route add local 0.0.0.0/0 dev lo table 100

After a few attempts, I noticed that it appears that systemd-networkd, on my router, cannot insert any route to any table other than the default one. I have reduced the issue to the following setup:

[Match]
Name=eth-wan

[Route]
Destination=192.168.125.1
Table=101

eth-wan is my router's WAN interface and has a subnet of 192.168.125.0/24. After reloading, restarting, and even rebooting, when I inspect table 101 via "ip route show table 101", I always get:

Error: ipv4: FIB table does not exist.
Dump terminated

I noticed that the support of custom routing table was added way back in 2016:

https://github.com/systemd/systemd/pull/3132

with an example of 

-------------------------------------
[Match]
Name=wlan0

[Route]
Destination=10.76.1.254
Table=111
-------------------

[root at maximus route-table]# ip route show table  111
[root at maximus route-table]# ip route show table  111
10.76.1.254 dev wlan0  proto static
[root at maximus route-table]#

This setup looks almost identical to mine, so I am not sure is this a bug, or is there something that might be wrong with my environment. Could anyone give me some advice on how to figure this out?

I am running systemd 247.3-1 on ArchLinux with kernel 5.10.13:

root at home-gateway /e/s/network# systemctl --version
systemd 247 (247.3-1-arch)
+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

root at home-gateway /e/s/network [2]# uname -a
Linux home-gateway 5.10.13-arch1-1 #1 SMP PREEMPT Wed, 03 Feb 2021 23:44:07 +0000 x86_64 GNU/Linux

Thanks!
— Minsheng


More information about the systemd-devel mailing list