I'm trying to add a custom route between 2 routers from Router1 to Router2:
Router1
Router2
Router1 route table:
I need to add a static route on Router1 to the LAN on Router2.
If I add the route manually all works perfetly:
But if I add the route using router GUI:
The first line is transforming to command (adding particular gateway)
and after issuing the second command:
I get the error:
route: SIOCADDRT: Network is unreachable
How can I add a static route to particular network via particular gateway using GUI?
Router1
WAN - 10.10.218.1/255.255.255.0
LAN - 192.168.121.0/255.255.255.0
Router2
WAN - 10.10.170.18/255.255.255.0
LAN - 192.168.145.0/255.255.255.0
Router1 route table:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.10.218.1 0.0.0.0 UG 0 0 0 eth0
10.10.218.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.218.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.121.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
I need to add a static route on Router1 to the LAN on Router2.
If I add the route manually all works perfetly:
route add -host 10.10.170.18 dev eth0
route add -net 192.168.145.0 netmask 255.255.255.0 gw 10.10.170.18 eth0
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.10.218.1 0.0.0.0 UG 0 0 0 eth0
10.10.170.18 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
10.10.218.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.218.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.121.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.145.0 10.10.170.18 255.255.255.0 UG 0 0 0 eth0
But if I add the route using router GUI:
IP-address Network mask Gateway Metric Interface
10.10.170.18 255.255.255.255 0.0.0.0 - WAN
192.168.145.0 255.255.255.0 10.10.170.18 - WAN
The first line is transforming to command (adding particular gateway)
route add -host 10.10.170.18 gw 10.10.218.1 dev eth0
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.10.218.1 0.0.0.0 UG 0 0 0 eth0
10.10.170.18 10.10.218.1 255.255.255.255 UGH 0 0 0 eth0
10.10.218.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.218.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.121.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
and after issuing the second command:
route add -net 192.168.145.0 netmask 255.255.255.0 gw 10.10.170.18 eth0
I get the error:
route: SIOCADDRT: Network is unreachable
How can I add a static route to particular network via particular gateway using GUI?