Update:
The issue name was Route loading error if with device created from container.
A new test, I read include/constraint/interface-name.xml.i, see there is a regex for interface names, so I rename the clash container created interface to tun0 which matches the regex, no error.
Breifly, if I create a interface by other program/container, not matching the regex which is for now
<regex>(bond|br|dum|en|ersp|eth|gnv|ifb|ipoe|lan|l2tp|l2tpeth|macsec|peth|ppp|pppoe|pptp|sstp|sstpc|tun|veth|vti|vtun|vxlan|wg|wlan|wwan)[0-9]+(.\d+)?|pod-[-_a-zA-Z0-9]{1,11}|lo</regex>
and I put the interface in protocol static, the whole protocol static will not be loaded on boot.
Start up message
vyos-rt vyos-config[971]: Configuration error
configure command message
WARNING: There was a config error on boot: saving the configuration now could overwrite data. You may want to check and reload the boot config
load & compare
+ static { + route 192.168.24.0/24 { + next-hop 192.168.1.1 { + } + } + route 192.168.51.0/24 { + interface wg1 { + } + } + route 198.18.0.0/15 { + interface utun0 { + disable + } + } + table 18 { + route 0.0.0.0/0 { + interface utun0 { + disable + } + next-hop 198.18.0.1 { + disable + interface "utun0" + } + } + } + }
commit & save works.
utun0 is the clash TUN interface created from container.
I remove & test entry by entry, if I don't use the interface utun0, everyting works fine.
If I add utun0, like
interface utun0 or next-hop 198.18.0.1 interface utun0
both in protocol static route and prototcol static table route
disabled or not disabled
error occurs on boot, but can be load & commit.
Lucky thing for me is my route works if not with interface utun0.
Extra test:
To test if this occurs on any interface not defined in config tree:
I try set protocol static route 192.168.0.0/24 interface wg9 and reboot. No error.
I try with utun1, also not defined, error Incorrect path /sys/class/net/utun1: no such file or directory after commit.
I grep utun0 /var/log -r found no error at all.