bgp local preference from static protocol

Milen Bogunski milen at gentoo.bg
Thu Apr 19 10:20:29 CEST 2018


Hello,

trying to preset local preference for originated route on static protocol like this

protocol static mynetwork {
        import all;
        route 10.1.1.0/24 reject {
        bgp_local_pref = 200;
        };

}

on BGP peer configuration i'm using following export filter

   export filter {    
    if proto = "mynetwork" then {
       accept;
    }
   reject;
  };

in routing table everything seems fine, bgp.local_pref from static protocol is set

bird> show route all for 10.1.1.0/24
10.1.1.0/24        unreachable [mynetwork 11:13:34] * (200)
	Type: static unicast univ
	BGP.local_pref: 200


but on exported route BGP.local_pref is 100

bird> show route all export peer2   
10.1.1.0/24        unreachable [mynetwork 11:13:34] * (200)
	Type: static unicast univ
	BGP.origin: IGP
	BGP.as_path: 65001
	BGP.local_pref: 100

----
if i set local preference on bgp peer export filter, like this - it is OK
    if proto = "mynetwork" then {
       if net = 10.1.1.0/24 then bgp_local_pref = 200;
       accept;
    }
   reject;
  };

bird> show route all export peer2
10.1.1.0/24        unreachable [mynetwork 11:13:34] * (200)
	Type: static unicast univ
	BGP.origin: IGP
	BGP.as_path: 65001
	BGP.local_pref: 200

my question is, is there any way to use bgp_local_pref from static protocol when originate routes, without touching neighbor export filter?

Thanks in advance



More information about the Bird-users mailing list