[PATCH,RFC] Allow exchanging LOCAL_PREF with eBGP peers.

Lennert Buytenhek buytenh at wantstofly.org
Sat Feb 18 17:34:40 CET 2017


On Sat, Feb 18, 2017 at 05:20:15PM +0100, Job Snijders wrote:

> Hi,

Goedemiddag!


> Can you make the LOCAL_PREF something that can be matched on? Example:
> 
> if ! bgp_path.local_pref = 80 then {
> bgp_local_pref = 100;
> }
> 
> This way one can limit the influence of the adjacent neighbor to either
> 80 or 100 (default).

You can match against the existing variable and change it:

	protocol bgp peer_a {
		ebgp localpref rx;
		import filter {
			if bgp_local_pref = 12349 then {
				print "changing it";
				bgp_local_pref = 54321;
			}
			accept;
		};
		[...]
	}

===
2017-02-18 18:28:35 <TRACE> a: Got UPDATE
2017-02-18 18:28:35 <INFO> changing it


bird> show route all
0.0.0.0/0          via 172.17.76.1 on eth0 [a 18:28:35] * (100) [AS1i]
        Type: BGP unicast univ
        BGP.origin: IGP
        BGP.as_path: 1
        BGP.next_hop: 172.17.76.1
        BGP.local_pref: 54321
===

Are you asking for a variable that records the received LOCAL_PREF that
is separate from bgp_local_pref?


Cheers,
Lennert


More information about the Bird-users mailing list