[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bird-users
Subject:    Re: constant not available everywhere and passing variables from protocols
From:       Jan Maria Matejka <jan.matejka () nic ! cz>
Date:       2018-03-21 11:53:56
Message-ID: b510bc76-ae7e-0f59-0f1f-30f0daaee813 () nic ! cz
[Download RAW message or body]

> Are there considerations in future to pass bgp_neighbour object to
> filter, to discriminate on neighbor address, ifname, asn, etc? JunOS
> allows this. This would allow me to keep single 'define backup_int =
> "XYZ". On ingress I'd match against protocol, on egress I'd match
> against bgp_neighbour.ifname. So only thing I'd define for
> backup/primary selection is single const, which could be included in a
> single line config file.
> 
> Something like this:
> 
> 
> filter bgp_primary_out {
>   if ifname = "lo" then {
>     if bgp_neighbor.ifname = backup_int then bgp_path.prepend(local_as);
>     accept;
>   }
>   reject;
> }
> 
> filter bgp_primary_in {
>   if proto = backup_int then bgp_local_pref = 50;
>   if net = default_candidate_net then accept;
>   reject;
> }

Probably yes (or something like that) . See this thread.
http://bird.network.cz/pipermail/bird-users/2018-January/011881.html

>> Anyway, it should be possible to 'define default_candidate_ip = default_candidate_net.ip;'
>> and then use the constant as IP.
> 
> This works. Curiously won't work if the next-hop is
> default_candidate_net.ip; Actually have to assign own constant to it.

Yes, you have to assign an own constant for it due to current
configuration syntax restrictions. It may change in future.

M.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic