stupid question about OSPF cost and route preference

Eugene M. Zheganin emz at norma.perm.ru
Tue Apr 7 15:41:37 CEST 2020


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 at gw /usr/local/etc]# ifconfig gif1 down
[root at 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 at gw /usr/local/etc]# ifconfig gif1 up
[root at 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.



More information about the Bird-users mailing list