I put the following into /etc/config/network but it appears to have no effect:
config route 'vpnbell' option interface 'vpn' option target '0.0.0.0' option netmask '0.0.0.0' option gateway '10.8.0.1' option table 'vpn'
I expected it to do the same thing as command:
ip route add default via 10.8.0.1 dev tun0 table vpn
which is working fine. Maybe the device tun0 isn't up (openvpn not connected yet) when the configuration file is parsed? Any other idea?
I do have a vpn interface defined (and working):
config interface 'vpn' option ifname 'tun0' option auto '1' option proto 'none'
as well as a "vpn" routing table in /etc/iproute2/rt_tables:
128 prelocal 255 local 254 main 253 default 10 vpn 0 unspec
the goal is to have a default route over the VPN only for a specific host.