-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static blackhole route does not honor distance attribute #2230
Comments
Aip route 50.1.1.0/24 blackhole 200 Bip route 50.1.1.0/24 ens192 Case 1) Static route is already present in rib and redistributed to bgp with weight 32768 (default) Then route from peer is received Best route selected in bgp is static (since weight of static route is higher) Therefore peer route is not installed in RIB as expected as shown in logs below LOGSAshow ip bgp Network Next Hop Metric LocPrf Weight Path
show ip route K>* 0.0.0.0/0 [0/0] via 10.112.157.253, ens160, 1d22h08m Case 2) Static route NOT in rib when bgp session is established dev(config-router-af)# do show ip bgp Network Next Hop Metric LocPrf Weight Path Displayed 1 routes and 1 total paths K>* 0.0.0.0/0 [0/0] via 10.112.157.253, ens160, 1d22h38m Add static routedev(config)# ip route 50.1.1.0/24 blackhole 200 show ip routeCodes: K - kernel route, C - connected, S - static, R - RIP, K>* 0.0.0.0/0 [0/0] via 10.112.157.253, ens160, 1d22h42m RIB selected BGP route since it has lower admin distance. The static route is not selected therefore RIB will not send update to bgp static void zebra_redistribute(struct zserv *client, int type,
|
No, bgp needs to respect admin distance. BGP should be storing the redistributed routes admin distance and in section 3 of bgp_info_cmp when we look at the static route type we should do a quick comparison of the route's admin distance -vs- bgp's admin distance and select the better. |
To whit we want a reproducible deterministic network this bug is not. |
Historically, this is the way it also worked at the last vendor I worked at as well. BGP best path calculation prefers locally injected routes over those learned from bgp peers and never tries to install if the locally installed route is injected first. Admin distance isn't in play in this case. If the BGP prefix is learned first and installed in the rib, then zebra will use admin distance to chose. Definitely non-deterministic. Here is a snippet of the first three steps of the bestpath algorithm. Prefer the path with the highest WEIGHT. Prefer the path with the highest LOCAL_PREF. Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP. Local paths that are sourced by the network or redistribute commands are preferred over local aggregates that are sourced by the aggregate-address command. |
I believe if you don't have a need to redistribute the static into bgp, the behavior would become deterministic because zebra would be doing the deciding. |
As mentioned by Don Slice, admin distance is not a parameter in bgp route selection process (as per the standards), therefore the existing behavior is correct and the issue raised is not a defect. |
Analysis 1st Scenario: Configure static route followed by configuration for BGP.
2nd Scenario: Configure BGP followed by configuration for static route
Conclusion Fix proposed: Other routing stacks behavior: Cisco also behaves like FRR stack. i.e. in the above scenario, Cisco equipment also doesn’t honor admin distance. |
This isn't a bug. Coming to the part of getting FRR to behave the way it is described above, I believe the desired behavior can be achieved if a route-map is applied to modify the weight of BGP paths to be greater than 32,768. |
Hi All, Why cant we just Ignore the default Weight (32768) while calculating the Best route in BGP table, If we ignore the default weight then the next Best path algo would kick-in and there IGP/EGP won the battle VS Unknown (Redistributed Static has UNKOWN TYPE) and BGP route would be selected as Best and triggered to Update Zebra. I would suggest to always Ignore default parameters (Such as Weight and Local Preference) while calculating Best Paths in BGP. These are default set by System and not configured by User.. we should honour user configured parameter over default set. -Manas |
=> meeting this week |
Hello everyone, |
Hello,
We've faced following problem with latest frr of 4.0-1~ubuntu16.04+1
When we add static null route with distance 200, frr does not accept route received from BGP.
Below is the relevant configuration.
As you can see below, default route received from neighbor is not being accepted.
However, if we are adding blackhole route after bgp neighbor is established, distance is being honored.
Though after peer restart default route is not accepted from peer anymore and blackhole route is left as preferred one.
The text was updated successfully, but these errors were encountered: