stupid question about OSPF cost and route preference
Hello. I have a bunch of birder routers, and the troublesome router is connected to some of them via LAN and to some of them via WAN tunnels. For some reason it always chooses a WAN route, regardless of it's metric: ===Cut=== bird> show route for 10.50.3.0/24 10.50.3.0/24 via 172.16.0.45 on gif1 [ospfv4 18:25:39] * E2 (150/10222/10000) [192.168.57.254] [root@gw /usr/local/etc]# ifconfig gif1 down [root@gw /usr/local/etc]# birdc BIRD 1.6.6 ready. bird> show route for 10.50.3.0/24 10.50.3.0/24 via 192.168.57.254 on vlan57 [ospfv4 18:33:37] * E2 (150/11/10000) [192.168.57.254] [root@gw /usr/local/etc]# ifconfig gif1 up [root@gw /usr/local/etc]# birdc BIRD 1.6.6 ready. bird> show route for 10.50.3.0/24 10.50.3.0/24 via 172.16.0.45 on gif1 [ospfv4 18:34:01] * E2 (150/10222/10000) [192.168.57.254] bird> ===Cut=== And I totally don't understand why (OSPF cost is several times higher !). Config is as follows: === Cut=== filter importospfv4 { if net ~ [ 10.8.1.0/24 ] then { reject; } else { accept; } } filter exportospfv4 { if net ~ [ 192.168.55.254/32, 192.168.57.2/32 ] then { reject; } else { accept; } } protocol ospf ospfv4 { export filter exportospfv4; import filter importospfv4; area 0.0.0.0 { interface "vlan55" { cost 11; }; interface "vlan57" { cost 11; }; }; area 0.0.0.1 { interface "gif0"{ cost 5111; }; interface "gif1" { cost 5111; }; }; } ===Cut=== Thanks. Eugene.
On Tue, Apr 07, 2020 at 06:41:37PM +0500, Eugene M. Zheganin wrote:
Hello.
I have a bunch of birder routers, and the troublesome router is connected to some of them via LAN and to some of them via WAN tunnels.
For some reason it always chooses a WAN route, regardless of it's metric:
Hello gif1 and vlan57 are in different areas, that is something that is likely relevant. What you get from 'show ospf state'? Where (which area) is 192.168.57.254? How internal routes for 192.168.57.254 looks if you enable/disable gif1? There are some area-based rules (prefer internal to inter-area routes) that have higher priority to just OSPF cost comparison. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On 07.04.2020 19:06, Ondrej Zajicek wrote:
On Tue, Apr 07, 2020 at 06:41:37PM +0500, Eugene M. Zheganin wrote:
Hello.
I have a bunch of birder routers, and the troublesome router is connected to some of them via LAN and to some of them via WAN tunnels.
For some reason it always chooses a WAN route, regardless of it's metric: Hello
gif1 and vlan57 are in different areas, that is something that is likely relevant. What you get from 'show ospf state'?
Here it is: ===Cut=== bird> show ospf state area 0.0.0.0 router 192.168.55.254 distance 0 network 192.168.57.0/24 metric 11 stubnet 192.168.55.0/24 metric 11 xnetwork 172.16.0.36/30 metric 5111 xnetwork 172.16.0.44/30 metric 5111 external 0.0.0.0/0 metric2 10000 external 10.8.1.0/24 metric2 10000 external 10.8.1.1/32 metric2 10000 external 10.8.1.2/32 metric2 10000 external 10.9.0.0/24 metric2 10000 via 172.16.0.37 external 10.95.255.126/32 metric2 10000 external 172.16.0.36/30 metric2 10000 external 172.16.0.38/32 metric2 10000 external 172.16.0.44/30 metric2 10000 external 172.16.0.46/32 metric2 10000 external 192.168.55.0/24 metric2 10000 external 192.168.57.0/24 metric2 10000 router 192.168.57.23 distance 11 network 192.168.57.0/24 metric 10 router 192.168.57.24 distance 11 network 192.168.57.0/24 metric 10 external 0.0.0.0/0 metric2 10000 external 192.168.57.0/24 metric2 10000 external 192.168.60.1/32 metric2 10000 external 192.168.60.2/32 metric2 10000 external 192.168.60.3/32 metric2 10000 router 192.168.57.254 distance 11 network 192.168.57.0/24 metric 10 xnetwork 172.16.0.44/30 metric 5121 xnetwork 172.16.0.56/30 metric 5121 xnetwork 172.16.0.64/30 metric 5121 xrouter 192.168.53.1 metric 10 external 0.0.0.0/0 metric2 10000 external 10.3.51.0/24 metric2 10000 external 10.3.60.0/24 metric2 10000 external 10.4.0.41/32 metric2 10000 external 10.4.0.42/32 metric2 10000 external 10.4.1.41/32 metric2 10000 external 10.4.1.42/32 metric2 10000 external 10.8.0.1/32 metric2 10000 external 10.8.0.2/32 metric2 10000 external 10.8.0.0/24 metric2 10000 external 10.46.0.0/24 metric2 10000 external 10.50.0.0/24 metric2 10000 external 10.50.3.0/24 metric2 10000 external 10.58.0.0/24 metric2 10000 external 10.60.0.0/24 metric2 10000 external 10.61.0.0/24 metric2 10000 external 10.62.0.0/24 metric2 10000 external 10.200.116.0/24 metric2 10000 external 10.201.255.1/32 metric2 10000 external 10.201.255.237/32 metric2 10000 external 10.201.255.238/32 metric2 10000 external 90.150.180.21/32 metric2 10000 external 172.16.0.5/32 metric2 10000 external 172.16.0.6/32 metric2 10000 external 172.16.0.57/32 metric2 10000 external 172.16.0.58/32 metric2 10000 external 172.16.0.67/32 metric2 10000 external 172.16.0.68/32 metric2 10000 external 172.16.1.1/32 metric2 10000 external 185.71.78.61/32 metric2 10000 external 185.71.78.62/32 metric2 10000 external 192.168.57.0/24 metric2 10000 external 192.168.58.1/32 metric2 10000 external 192.168.58.3/32 metric2 10000 external 192.168.59.0/24 metric2 10000 via 192.168.57.60 external 192.168.100.0/24 metric2 10000 via 192.168.57.60 router 192.168.100.23 distance 21 network 192.168.100.0/24 metric 10 external 192.168.100.0/24 metric2 10000 external 192.168.122.0/24 metric2 10000 router 192.168.100.254 distance 11 network 192.168.57.0/24 metric 10 network 192.168.100.0/24 metric 10 external 0.0.0.0/0 metric2 10000 external 10.101.0.0/16 metric2 10000 external 10.101.6.61/32 metric2 10000 external 10.101.6.62/32 metric2 10000 external 10.101.6.63/32 metric2 10000 external 10.101.21.0/24 metric2 10000 external 10.115.0.0/16 metric2 10000 external 10.121.10.0/24 metric2 10000 external 10.121.13.0/24 metric2 10000 external 10.0.0.0/8 metric2 10000 via 192.168.57.254 external 46.146.236.39/32 metric2 10000 external 46.146.236.53/32 metric2 10000 external 90.150.180.20/32 metric2 10000 external 109.194.148.199/32 metric2 10000 external 109.194.148.200/32 metric2 10000 external 109.194.158.2/32 metric2 10000 external 172.16.0.69/32 metric2 10000 external 172.16.0.70/32 metric2 10000 external 192.168.51.0/24 metric2 10000 external 192.168.51.1/32 metric2 10000 external 192.168.57.0/24 metric2 10000 external 192.168.59.0/24 metric2 10000 external 192.168.59.1/32 metric2 10000 external 192.168.100.254/32 metric2 10000 external 192.168.100.0/24 metric2 10000 external 192.168.0.0/16 metric2 10000 via 192.168.57.254 network 192.168.57.0/24 dr 192.168.100.254 distance 11 router 192.168.100.254 router 192.168.57.254 router 192.168.57.23 router 192.168.57.24 router 192.168.55.254 network 192.168.100.0/24 dr 192.168.100.254 distance 21 router 192.168.100.254 router 192.168.100.23 area 0.0.0.1 router 192.168.55.254 distance 0 stubnet 172.16.0.36/30 metric 5111 stubnet 172.16.0.44/30 metric 5111 xnetwork 172.16.0.56/30 metric 5132 xnetwork 172.16.0.64/30 metric 5132 xnetwork 192.168.55.0/24 metric 11 xnetwork 192.168.57.0/24 metric 11 xnetwork 192.168.100.0/24 metric 21 xrouter 192.168.53.1 metric 21 xrouter 192.168.57.23 metric 11 xrouter 192.168.57.24 metric 11 xrouter 192.168.57.254 metric 11 xrouter 192.168.100.23 metric 21 xrouter 192.168.100.254 metric 11 external 0.0.0.0/0 metric2 10000 external 10.8.1.0/24 metric2 10000 external 10.8.1.1/32 metric2 10000 external 10.8.1.2/32 metric2 10000 external 10.9.0.0/24 metric2 10000 via 172.16.0.37 external 10.95.255.126/32 metric2 10000 external 172.16.0.36/30 metric2 10000 external 172.16.0.38/32 metric2 10000 external 172.16.0.44/30 metric2 10000 external 172.16.0.46/32 metric2 10000 external 192.168.55.0/24 metric2 10000 external 192.168.57.0/24 metric2 10000 other ASBRs router 192.168.53.1 external 0.0.0.0/0 metric2 10000 external 8.8.4.4/32 metric2 10000 external 10.95.255.254/32 metric2 10000 external 77.88.8.1/32 metric2 10000 external 80.78.96.1/32 metric2 10000 external 172.16.0.44/30 metric2 10000 external 172.16.0.45/32 metric2 10000 external 172.16.0.57/32 metric2 10000 external 172.16.0.56/30 metric2 10000 external 172.16.0.64/30 metric2 10000 external 192.168.53.0/24 metric2 10000 external 192.168.53.1/32 metric2 10000 external 192.168.53.10/32 metric2 10000 external 192.168.55.0/24 metric2 10000 via 172.16.0.46 ===Cut===
Where (which area) is 192.168.57.254? It's in area 0, the "gw" router and 192.168.57.254 are connected via vlan interface over a 100 Mbit/s link. How internal routes for 192.168.57.254 looks if you enable/disable gif1?
Pretty much identical, because "gw" is locally connected to 192.168.57.0/24: ===Cut=== [root@gw /usr/local/etc]# birdc BIRD 1.6.6 ready. bird> show route for 192.168.57.254 192.168.57.0/24 dev vlan57 [direct1 2020-04-04] * (240) dev vlan57 [ospfv4 18:26:04] I (150/11) [192.168.100.254] [root@gw /usr/local/etc]# ifconfig gif1 down [root@gw /usr/local/etc]# birdc BIRD 1.6.6 ready. bird> show route for 192.168.57.254 192.168.57.0/24 dev vlan57 [direct1 2020-04-04] * (240) dev vlan57 [ospfv4 18:26:05] I (150/11) [192.168.100.254] ===Cut=== Thanks. Eugene.
On Tue, Apr 07, 2020 at 07:17:25PM +0500, Eugene M. Zheganin wrote:
On 07.04.2020 19:06, Ondrej Zajicek wrote:
On Tue, Apr 07, 2020 at 06:41:37PM +0500, Eugene M. Zheganin wrote:
Hello.
I have a bunch of birder routers, and the troublesome router is connected to some of them via LAN and to some of them via WAN tunnels.
For some reason it always chooses a WAN route, regardless of it's metric: Hello
gif1 and vlan57 are in different areas, that is something that is likely relevant. What you get from 'show ospf state'?
Here it is:
Well, i do not see any connection for gif1 for router 192.168.55.254 in area 1, is this done when gif1 is up? What is a path to 192.168.57.254 through gif1? -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Eugene M. Zheganin -
Ondrej Zajicek