Bgp Monitor Db

This scenario validates the BGP extended metrics exposed via monitor-db command. Tests the show monitor-db ip bgp command with and without local-address configuration. The monitor-db command displays BGP peer metrics in a structured format similar to VRF output.

../../../_images/topology26.svg

Test iBGP Monitor-DB With Local Address

Description

Validate show monitor-db ip bgp displays all extended BGP peer metrics when BGP neighbor is configured with explicit local-address. Expected metrics: bgpPeerLocalAddr, bgpPeerLocalAs, bgpPeerRemoteAddr, bgpPeerRemoteAs, bgpPeerState, bgpPeerInUpdates, bgpPeerOutUpdates, bgpPeerInTotalMessages, bgpPeerOutTotalMessages, bgpPeerFsmEstablishedTime, bgpPeerFsmEstablishedTransitions.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 10.10.0.200/24
set protocols bgp 20 peer-group overlay listen range 10.10.0.0/24
set protocols bgp 20 peer-group overlay remote-as 20
set protocols bgp 20 redistribute connected route-map REDIS
set protocols route-map REDIS rule 1 action permit
set protocols route-map REDIS rule 1 match interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 20 neighbor peer local-address 10.10.0.100
set protocols bgp 20 neighbor peer remote-address 10.10.0.200
set protocols bgp 20 neighbor peer remote-as 20
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command protocols bgp show ip summary at DUT0 and check if output contains the following tokens:

10.10.0.200
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 20 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.10.0.200     10.10.0.100     4         20         0         0        0    0    0    never         Idle        0        0 N/A

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
BGP table version is 1, local router ID is 10.10.0.100, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.0/24       10.10.0.200              0    100      0 ?

Displayed 1 routes and 1 total paths

Step 5: Run command protocols ip show route at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
B>* 1.1.1.0/24 [200/0] via 10.10.0.200, eth0, weight 1, 00:00:00
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:02
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:02
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:02

Step 6: Ping IP address 1.1.1.1 from DUT0:

admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1
Show output
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.259 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.259/0.259/0.259/0.000 ms

Step 7: Run command show monitor-db ip bgp at DUT0 and check if output matches the following regular expressions:

bgpPeerLocalAddr:\s*10.10.0.100
bgpPeerLocalAs:\s*20
bgpPeerRemoteAddr:\s*10.10.0.200
bgpPeerRemoteAs:\s*20
bgpPeerState:\s*Established
bgpPeerInUpdates:\s*\d+
bgpPeerOutUpdates:\s*\d+
bgpPeerInTotalMessages:\s*\d+
bgpPeerOutTotalMessages:\s*\d+
bgpPeerFsmEstablishedTransitions:\s*\d+
bgpPeerFsmEstablishedTime:\s*\d+
Show output
vrf
  main
    neighbors
      peer
        bgpPeerFsmEstablishedTime: 2
        bgpPeerFsmEstablishedTransitions: 1
        bgpPeerInTotalMessages: 4
        bgpPeerInUpdates: 2
        bgpPeerLocalAddr: 10.10.0.100
        bgpPeerLocalAs: 20
        bgpPeerOutTotalMessages: 3
        bgpPeerOutUpdates: 1
        bgpPeerRemoteAddr: 10.10.0.200
        bgpPeerRemoteAs: 20
        bgpPeerState: Established

Test iBGP Monitor-DB Without Local Address

Description

Validate show monitor-db ip bgp correctly displays bgpPeerLocalAddr when BGP neighbor is configured WITHOUT explicit local-address. The local address should be obtained automatically from the connection.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 10.10.0.200/24
set protocols bgp 20 peer-group overlay listen range 10.10.0.0/24
set protocols bgp 20 peer-group overlay remote-as 20
set protocols bgp 20 redistribute connected route-map REDIS
set protocols route-map REDIS rule 1 action permit
set protocols route-map REDIS rule 1 match interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 20 neighbor peer remote-address 10.10.0.200
set protocols bgp 20 neighbor peer remote-as 20
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command protocols bgp show ip summary at DUT0 and check if output contains the following tokens:

10.10.0.200
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 20 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.10.0.200     -               4         20         0         0        0    0    0    never         Idle        0        0 N/A

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
BGP table version is 1, local router ID is 10.10.0.100, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.0/24       10.10.0.200              0    100      0 ?

Displayed 1 routes and 1 total paths

Step 5: Run command protocols ip show route at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
B>* 1.1.1.0/24 [200/0] via 10.10.0.200, eth0, weight 1, 00:00:00
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:02
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:02
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:02

Step 6: Ping IP address 1.1.1.1 from DUT0:

admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1
Show output
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.228 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.228/0.228/0.228/0.000 ms

Step 7: Run command show monitor-db ip bgp at DUT0 and check if output matches the following regular expressions:

bgpPeerLocalAddr:\s*10.10.0.100
bgpPeerLocalAs:\s*20
bgpPeerRemoteAddr:\s*10.10.0.200
bgpPeerRemoteAs:\s*20
bgpPeerState:\s*Established
bgpPeerInUpdates:\s*\d+
bgpPeerOutUpdates:\s*\d+
bgpPeerInTotalMessages:\s*\d+
bgpPeerOutTotalMessages:\s*\d+
bgpPeerFsmEstablishedTransitions:\s*\d+
bgpPeerFsmEstablishedTime:\s*\d+
Show output
vrf
  main
    neighbors
      peer
        bgpPeerFsmEstablishedTime: 2
        bgpPeerFsmEstablishedTransitions: 1
        bgpPeerInTotalMessages: 4
        bgpPeerInUpdates: 2
        bgpPeerLocalAddr: 10.10.0.100
        bgpPeerLocalAs: 20
        bgpPeerOutTotalMessages: 3
        bgpPeerOutUpdates: 1
        bgpPeerRemoteAddr: 10.10.0.200
        bgpPeerRemoteAs: 20
        bgpPeerState: Established

Test eBGP Monitor-DB With Local Address

Description

Validate show monitor-db ip bgp displays all extended BGP peer metrics for eBGP scenario with explicit local-address configured. Uses disable-connected-check instead of ebgp-multihop (incompatible with local-address).

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 10.10.0.200/24
set protocols bgp 30 peer-group overlay listen range 10.10.0.0/24
set protocols bgp 30 peer-group overlay remote-as 10
set protocols bgp 30 peer-group overlay route-map export PERMIT
set protocols bgp 30 redistribute connected route-map REDIS
set protocols route-map PERMIT rule 1 action permit
set protocols route-map REDIS rule 1 action permit
set protocols route-map REDIS rule 1 match interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 10 neighbor peer disable-connected-check
set protocols bgp 10 neighbor peer local-address 10.10.0.100
set protocols bgp 10 neighbor peer remote-address 10.10.0.200
set protocols bgp 10 neighbor peer remote-as 30
set protocols bgp 10 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command protocols bgp show ip summary at DUT0 and check if output contains the following tokens:

10.10.0.200
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 10 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.10.0.200     10.10.0.100     4         30         2         2        0    0    0 00:00:00  Established        0 (Policy) N/A

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
BGP table version is 1, local router ID is 10.10.0.100, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       10.10.0.200              0             0 30 ?

Displayed 1 routes and 1 total paths

Step 5: Run command protocols ip show route at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
B>* 1.1.1.0/24 [20/0] via 10.10.0.200, eth0, weight 1, 00:00:02
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:03
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:03
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:03

Step 6: Ping IP address 1.1.1.1 from DUT0:

admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1
Show output
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.235 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.235/0.235/0.235/0.000 ms

Step 7: Run command show monitor-db ip bgp at DUT0 and check if output matches the following regular expressions:

bgpPeerLocalAddr:\s*10.10.0.100
bgpPeerLocalAs:\s*10
bgpPeerRemoteAddr:\s*10.10.0.200
bgpPeerRemoteAs:\s*30
bgpPeerState:\s*Established
bgpPeerInUpdates:\s*\d+
bgpPeerOutUpdates:\s*\d+
bgpPeerInTotalMessages:\s*\d+
bgpPeerOutTotalMessages:\s*\d+
bgpPeerFsmEstablishedTransitions:\s*\d+
bgpPeerFsmEstablishedTime:\s*\d+
Show output
vrf
  main
    neighbors
      peer
        bgpPeerFsmEstablishedTime: 3
        bgpPeerFsmEstablishedTransitions: 1
        bgpPeerInTotalMessages: 7
        bgpPeerInUpdates: 3
        bgpPeerLocalAddr: 10.10.0.100
        bgpPeerLocalAs: 10
        bgpPeerOutTotalMessages: 4
        bgpPeerOutUpdates: 1
        bgpPeerRemoteAddr: 10.10.0.200
        bgpPeerRemoteAs: 30
        bgpPeerState: Established

Test eBGP Monitor-DB Without Local Address

Description

Validate show monitor-db ip bgp correctly displays bgpPeerLocalAddr for eBGP scenario when configured WITHOUT explicit local-address.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 10.10.0.200/24
set protocols bgp 30 peer-group overlay listen range 10.10.0.0/24
set protocols bgp 30 peer-group overlay remote-as 10
set protocols bgp 30 peer-group overlay route-map export PERMIT
set protocols bgp 30 redistribute connected route-map REDIS
set protocols route-map PERMIT rule 1 action permit
set protocols route-map REDIS rule 1 action permit
set protocols route-map REDIS rule 1 match interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 10 neighbor peer remote-address 10.10.0.200
set protocols bgp 10 neighbor peer remote-as 30
set protocols bgp 10 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command protocols bgp show ip summary at DUT0 and check if output contains the following tokens:

10.10.0.200
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 10 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.10.0.200     10.10.0.100     4         30         2         2        0    0    0 00:00:00  Established        0 (Policy) N/A

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
BGP table version is 1, local router ID is 10.10.0.100, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.0/24       10.10.0.200              0             0 30 ?

Displayed 1 routes and 1 total paths

Step 5: Run command protocols ip show route at DUT0 and check if output contains the following tokens:

1.1.1.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
B>* 1.1.1.0/24 [20/0] via 10.10.0.200, eth0, weight 1, 00:00:01
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:02
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:02
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:02

Step 6: Ping IP address 1.1.1.1 from DUT0:

admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1
Show output
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.258 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.258/0.258/0.258/0.000 ms

Step 7: Run command show monitor-db ip bgp at DUT0 and check if output matches the following regular expressions:

bgpPeerLocalAddr:\s*10.10.0.100
bgpPeerLocalAs:\s*10
bgpPeerRemoteAddr:\s*10.10.0.200
bgpPeerRemoteAs:\s*30
bgpPeerState:\s*Established
bgpPeerInUpdates:\s*\d+
bgpPeerOutUpdates:\s*\d+
bgpPeerInTotalMessages:\s*\d+
bgpPeerOutTotalMessages:\s*\d+
bgpPeerFsmEstablishedTransitions:\s*\d+
bgpPeerFsmEstablishedTime:\s*\d+
Show output
vrf
  main
    neighbors
      peer
        bgpPeerFsmEstablishedTime: 3
        bgpPeerFsmEstablishedTransitions: 1
        bgpPeerInTotalMessages: 7
        bgpPeerInUpdates: 3
        bgpPeerLocalAddr: 10.10.0.100
        bgpPeerLocalAs: 10
        bgpPeerOutTotalMessages: 4
        bgpPeerOutUpdates: 1
        bgpPeerRemoteAddr: 10.10.0.200
        bgpPeerRemoteAs: 30
        bgpPeerState: Established