Bgp Basic

Test to check BGP protocol

Test iBGP - Static neighbors

Description

Test to check iBGP protocol with static neighbors

Scenario

Step 1: 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 2: 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 neighbor peer remote-address 10.10.0.100
set protocols bgp 20 neighbor peer remote-as 20
set protocols bgp 20 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 3: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:

10.10.0.200.*Established
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         4         5        0    0    0 00:00:00  Established        0        0 FRRouting/10.4.1

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

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 matches the following regular expressions:

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:01
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:04
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:04
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:04

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.533 ms

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

Test iBGP - Dynamic neighbors

Description

Test to check iBGP protocol with dynamic neighbors

Scenario

Step 1: 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 2: 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 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 3: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:

10.10.0.200.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 20 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 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         4         3        1    0    0 00:00:02  Established        1        0 FRRouting/10.4.1

Total number of neighbors 1

Step 4: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

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 matches the following regular expressions:

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:01
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:04
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:04
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:04

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.561 ms

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

Test eBGP - Static neighbors

Description

Test to check eBGP protocol with static neighbors

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 10 neighbor peer ebgp-multihop 2
set protocols bgp 10 neighbor peer remote-address 20.20.0.200
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set protocols static route 20.20.0.0/24 next-hop 10.10.0.101
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 20.20.0.200/24
set protocols bgp 20 neighbor peer ebgp-multihop 2
set protocols bgp 20 neighbor peer remote-address 10.10.0.100
set protocols bgp 20 neighbor peer remote-as 10
set protocols bgp 20 neighbor peer route-map export PERMIT
set protocols bgp 20 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 protocols static route 10.10.0.0/24 next-hop 20.20.0.201
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth0 address 10.10.0.101/24
set interfaces ethernet eth1 address 20.20.0.201/24
set protocols static route 1.1.1.0/24 next-hop 20.20.0.200
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:

20.20.0.200.*Established
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
20.20.0.200     10.10.0.100     4         20         3         5        0    0    0 00:00:00  Established        0 (Policy) N/A

Total number of neighbors 1

Step 5: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

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       20.20.0.200              0             0 20 ?

Displayed 1 routes and 1 total paths

Step 6: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

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 20.20.0.200 (recursive), weight 1, 00:00:01
  *                     via 10.10.0.101, eth0, weight 1, 00:00:01
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:05
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:05
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:05
S>* 20.20.0.0/24 [1/0] via 10.10.0.101, eth0, weight 1, 00:00:05

Step 7: 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=63 time=0.558 ms

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

Test eBGP - Dynamic neighbors

Description

Test to check eBGP protocol with dynamic neighbors

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.10.0.100/24
set protocols bgp 10 neighbor peer ebgp-multihop 2
set protocols bgp 10 neighbor peer remote-address 20.20.0.200
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set protocols static route 20.20.0.0/24 next-hop 10.10.0.101
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 1.1.1.1/24
set interfaces ethernet eth0 address 20.20.0.200/24
set protocols bgp 20 peer-group overlay ebgp-multihop 2
set protocols bgp 20 peer-group overlay listen range 10.10.0.0/24
set protocols bgp 20 peer-group overlay remote-as 10
set protocols bgp 20 peer-group overlay route-map export PERMIT
set protocols bgp 20 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 protocols static route 10.10.0.0/24 next-hop 20.20.0.201
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth0 address 10.10.0.101/24
set interfaces ethernet eth1 address 20.20.0.201/24
set protocols static route 1.1.1.0/24 next-hop 20.20.0.200
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:

20.20.0.200.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.10.0.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 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
20.20.0.200     10.10.0.100     4         20         4         3        1    0    0 00:00:01  Established        1 (Policy) N/A

Total number of neighbors 1

Step 5: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

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       20.20.0.200              0             0 20 ?

Displayed 1 routes and 1 total paths

Step 6: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

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 20.20.0.200 (recursive), weight 1, 00:00:01
  *                     via 10.10.0.101, eth0, weight 1, 00:00:01
C>* 10.10.0.0/24 is directly connected, eth0, weight 1, 00:00:35
K * 10.10.0.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:35
L>* 10.10.0.100/32 is directly connected, eth0, weight 1, 00:00:35
S>* 20.20.0.0/24 [1/0] via 10.10.0.101, eth0, weight 1, 00:00:35

Step 7: 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=63 time=0.537 ms

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