I installed OpenWRT on a few on my devices (22.03.3). On one of those devices I have a difficulty setting routes.
Here's what defined in the interface :
However, here's the result of route -e :
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default R3.lan 0.0.0.0 UG 0 0 0 switch.1
192.168.114.0 * 255.255.255.0 U 0 0 0 switch.1
192.168.240.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.245.0 * 255.255.255.0 U 0 0 0 lan10
I don't see any route to 192.168.243.0/24.
If I run : traceroute 192.168.240.2
I get :
traceroute to 192.168.240.2 (192.168.240.2), 30 hops max, 46 byte packets
1 192.168.240.2 (192.168.240.2) 0.543 ms 0.465 ms 0.421 ms
The packets are going through the default route.
I assume there's something wrong with my configuration !
I rebooted the device. Things changed in the routing table :
route -e
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default R3.lan 0.0.0.0 UG 0 0 0 switch.1
192.168.114.0 * 255.255.255.0 U 0 0 0 switch.1
192.168.240.0 * 255.255.255.0 U 0 0 0 lan9
192.168.241.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.242.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.244.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.245.0 * 255.255.255.0 U 0 0 0 lan10
192.168.249.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
However, I still don't get the route to 192.168.243.0/24 which I need to access 192.168.243.2 (which is another OpenWRT router).
The router is still trying to access that subnet via the default gateway :
traceroute 192.168.243.2
traceroute to 192.168.243.2 (192.168.243.2), 30 hops max, 46 byte packets
1 R3.lan (192.168.114.1) 0.719 ms 0.805 ms 0.686 ms
I deleted the route to 192.168.243.0/24, perhaps did I set something wrong concerning it. I made it again, and rebooted the router. Now I get the route I needed :
route -e
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default R3.lan 0.0.0.0 UG 0 0 0 switch.1
192.168.114.0 * 255.255.255.0 U 0 0 0 switch.1
192.168.240.0 * 255.255.255.0 U 0 0 0 lan9
192.168.241.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.242.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9 192.168.243.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.244.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
192.168.245.0 * 255.255.255.0 U 0 0 0 lan10
192.168.249.0 192.168.240.2 255.255.255.0 UG 0 0 0 lan9
I still can't access 192.168.243.2, but the problem is somewhere else now.
Thank you for your help regarding that routing table.
root@R3:~# traceroute 192.168.243.2
traceroute to 192.168.243.2 (192.168.243.2), 30 hops max, 46 byte packets
1 192.168.114.63 (192.168.114.63) 1.001 ms 0.829 ms 0.807 ms
2 192.168.240.2 (192.168.240.2) 1.156 ms 1.051 ms 1.009 ms
3 * * *
Ping + http KO.
From the managed switch, access to R6 is OK :
traceroute 192.168.243.2
traceroute to 192.168.243.2 (192.168.243.2), 30 hops max, 46 byte packets
1 192.168.240.2 (192.168.240.2) 0.516 ms 0.420 ms 0.099 ms
2 192.168.243.2 (192.168.243.2) 0.664 ms 0.531 ms 0.524 ms
Ping + http access to R6 OK.
From R5, access to R6 is OK :
traceroute 192.168.243.2
traceroute to 192.168.243.2 (192.168.243.2), 30 hops max, 46 byte packets
1 192.168.243.2 (192.168.243.2) 0.308 ms 0.163 ms 0.139 ms
I assume the problem is on the managed switch (running OpenWRT).