FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.34k stars 1.25k forks source link

show bgp summary shows incorrect local AS number #6234

Closed hydro-b closed 4 years ago

hydro-b commented 4 years ago

show bgp summary shows incorrect local AS number in " IPv4 Unicast Summary" when "local-as $ASN-2 no-prepend replace-as" rule is used in a "router bgp $ASN-1" section.

example:

router bgp 65101
 no bgp default ipv4-unicast
 neighbor leafs-v4 peer-group
 neighbor leafs-v4 local-as 65301 no-prepend replace-as
 neighbor leafs-v4 description BITED leafs ipv4 peer-group
 neighbor spines-evpn peer-group
 neighbor spines-evpn remote-as 65101

Will give the following output:

IPv4 Unicast Summary:
BGP router identifier $router-ip, local AS number 65101 vrf-id 0

Instead of:

IPv4 Unicast Summary:
BGP router identifier $router-ip, local AS number 65301 vrf-id 0

Behaviour as seen on FRRouting: version 7.4-dev-20200410-00-g4aa0f5cb1 (compiled from source)

ton31337 commented 4 years ago

@hydro-b sorry, don't understand your question. The summary gives the output about the global scope, not per neighbor. Or what do you mean actually?

hydro-b commented 4 years ago

When the AS is replaced (see config example earlier), it should show the correct "local AS number", now it shows AS 65101 for both instances, which is technically not correct, right?

show bgp summary 

IPv4 Unicast Summary:
BGP router identifier $router-id, local AS number 65101 vrf-id 0
BGP table version 87
RIB entries 99, using 19 KiB of memory
Peers 2, using 43 KiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
neighbour-ip1   4      65121      1783      1456        0    0    0 1d00h11m           50
neighbour-ip2   4      65121      1790      1456        0    0    0 1d00h11m           50

Total number of neighbors 2

L2VPN EVPN Summary:
BGP router identifier $router-id, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 3663, using 687 KiB of memory
Peers 2, using 43 KiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
 neighbour-ip1    4      65101     85443      1458        0    0    0 1d00h11m        13344
 neighbour-ip2    4      65101     85456      1458        0    0    0 1d00h11m        13344

Total number of neighbors 2
ton31337 commented 4 years ago

It shows exactly what you have under router bgp 65101.

hydro-b commented 4 years ago

The "local-as 65301 no-prepend replace-as" statement removes the local AS, and replaces it with another AS number. The eBGP peer needs to peer with the replaced AS number and not the original AS.

Following this reasoning, there is a session with "65301" and not "65101".

A show bgp neighbors does show this difference:

BGP neighbor is neighbour-ip1, remote AS 65121, local AS 65301 no-prepend replace-as, external link
ton31337 commented 4 years ago

Imagine you have a config like this:

router bgp 65000
  neighbor leafs-1 local-as 65001 no-prepend replace-as
  neighbor leafs-2 local-as 65002 no-prepend replace-as
  neighbor leafs-3 local-as 65003 no-prepend replace-as

which AS number should be printed in BGP summary?

hydro-b commented 4 years ago

I would suggest the summary shows neighbors per local-as. So three in your example.

ton31337 commented 4 years ago

Could you show the output how do you imagine that?

hydro-b commented 4 years ago

If you want to keep it comparable to the current output you could do like this:

IPv4 Unicast Summary:
BGP router identifier $router-id, local AS number 65001 vrf-id 0
BGP table version 51
RIB entries 99, using 19 KiB of memory
Peers 2, using 43 KiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
neighbour-ip1   4      65121      1543      1294        0    0    0 21:29:21           50
neighbour-ip2   4      65121      1538      1294        0    0    0 21:29:21           50

Total number of neighbors 2

BGP router identifier $router-id, local AS number 65002 vrf-id 0
BGP table version 51
RIB entries 99, using 19 KiB of memory
Peers 2, using 43 KiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
neighbour-ip1   4      65121      1543      1294        0    0    0 21:29:21           50
neighbour-ip2   4      65121      1538      1294        0    0    0 21:29:21           50

BGP router identifier $router-id, local AS number 65003 vrf-id 0
BGP table version 51
RIB entries 99, using 19 KiB of memory
Peers 2, using 43 KiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
neighbour-ip1   4      65121      1543      1294        0    0    0 21:29:21           50
neighbour-ip2   4      65121      1538      1294        0    0    0 21:29:21           50
ton31337 commented 4 years ago

Sorry, but no, that's not the way to go.

ton31337 commented 4 years ago

@polychaeta autoclose in 1 day.