[SOLVED] Routing is broken?

I'm on snapshot build r4589-cb2a391. Internet worked fine initially, but after adding NAT interface I've got into interesting situation, where NAT is used as default gateway even though WAN is configured to be used as default gateway in UI.

root@LEDE:~# cat /etc/config/network 

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd65:c41f:bc7f::/48'

config interface 'wan'
	option ifname 'eth1'
	option proto 'dhcp'

config interface 'mng'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option _orig_ifname 'eth0'
	option _orig_bridge 'true'
	option ipaddr '192.168.56.2'
	option ifname 'eth0'

config interface 'NAT'
	option proto 'static'
	option ipaddr '192.168.5.1'
	option netmask '255.255.255.0'
	option gateway '192.168.5.1'

root@LEDE:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         LEDE.lan        0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
192.168.1.1     *               255.255.255.255 UH    0      0        0 eth1
192.168.5.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.56.0    *               255.255.255.0   U     0      0        0 br-mng

Is it a bug in LEDE or am I missing something obvious?

Manually doing following helps:

route del default
ip route add default via 192.168.1.1

So everything besides figuring out default route seems to work fine

The "option gateway" is not for the clients to use the router as a gateway, but for the router to use that address as a gateway; just remove it.

1 Like

Thanks, it works now!