Static route created via Luci interface is not applied into route network configuration

I created static route to other network via Luci interface (OpenWrt 19.07.1/2):

But there is no any records in route table:

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.88.254  0.0.0.0         UG    0      0        0 eth2
10.9.0.0        *               255.255.255.0   U     0      0        0 wg0
178.XXX.XXX.XX  192.168.88.254  255.255.255.255 UGH   0      0        0 eth2
192.168.3.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.88.0    *               255.255.255.0   U     0      0        0 eth2

If I was trying to add route in command line I got an error:

root@OpenWrt:~# route add 192.168.11.0 netmask 255.255.255.0 dev wg0
route: netmask 000000ff and host route conflict

If I'm trying to add route in command line with -net argument everything goes well:

root@OpenWrt:~# route add -net 192.168.11.0 netmask 255.255.255.0 dev wg0
root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.88.254  0.0.0.0         UG    0      0        0 eth2
10.9.0.0        *               255.255.255.0   U     0      0        0 wg0
178.XXX.XXX.XX  192.168.88.254  255.255.255.255 UGH   0      0        0 eth2
192.168.3.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.11.0    *               255.255.255.0   U     0      0        0 wg0
192.168.88.0    *               255.255.255.0   U     0      0        0 eth2

What I did wrong ? Or it is a bug with creating route rules via Luci interface ?

I think you forgot the gateway.

1 Like

Check if the route config is there in /etc/config/network. If it does, running /etc/init.d/network reload should work.

On LuCI page, likely there is a "Save & Apply" button that is used to actually apply the config change.

If wg0 is a WireGuard link, then gateway is not needed as a route attribute.

Yes, route config present:

config route
        option target '192.168.11.0'
        option netmask '255.255.255.0'
        option interface 'wg0'

Yes, wg0 is a WireGuard interface, and yes I pushed Save & Apply correspondingly and running /etc/init.d/network reload.

It starts to work only after rebooting the device.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.