Bgp Multihoming
Scenario to validate BGP multihoming capability using dual GRE tunnels over separate VRFs. Verifies that BGP sessions (iBGP and eBGP) can establish multiple paths to the same destination through different tunnel interfaces (tun1/tun2), enabling redundancy and load balancing via ECMP routing.
Test iBGP - Dynamic neighbors multihoming
Description
Test to check iBGP protocol with dynamic neighbors
Scenario
Step 1: Set the following configuration in DUT1 :
set interfaces dummy dum0 address 1.1.1.1/24 set interfaces ethernet eth0 address 172.1.0.3/24 set interfaces tunnel tun1 address 10.1.0.3/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.3 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp set protocols bgp 20 peer-group overlay listen range 10.1.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 172.1.0.1/24 set interfaces ethernet eth0 vrf VRF0 set interfaces ethernet eth1 address 172.1.0.2/24 set interfaces ethernet eth1 vrf VRF1 set interfaces tunnel tun1 address 10.1.0.1/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.1 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set interfaces tunnel tun2 address 10.1.0.2/32 set interfaces tunnel tun2 encapsulation gre set interfaces tunnel tun2 local-address 172.1.0.2 set interfaces tunnel tun2 local-interface eth1 set interfaces tunnel tun2 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system vrf VRF0 set system vrf VRF1
Step 3: Ping IP address 10.1.0.3 from DUT0:
admin@DUT0$ ping 10.1.0.3 local-address 10.1.0.1 count 1 size 56 timeout 1Show output
PING 10.1.0.3 (10.1.0.3) from 10.1.0.1 : 56(84) bytes of data. 64 bytes from 10.1.0.3: icmp_seq=1 ttl=64 time=0.360 ms --- 10.1.0.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.360/0.360/0.360/0.000 ms
Step 4: Ping IP address 10.1.0.3 from DUT0:
admin@DUT0$ ping 10.1.0.3 local-address 10.1.0.2 count 1 size 56 timeout 1Show output
PING 10.1.0.3 (10.1.0.3) from 10.1.0.2 : 56(84) bytes of data. 64 bytes from 10.1.0.3: icmp_seq=1 ttl=64 time=0.287 ms --- 10.1.0.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.287/0.287/0.287/0.000 ms
Step 5: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.1.0.1/24 set interfaces ethernet eth0 vrf VRF0 set interfaces ethernet eth1 address 172.1.0.2/24 set interfaces ethernet eth1 vrf VRF1 set interfaces tunnel tun1 address 10.1.0.1/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.1 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set interfaces tunnel tun2 address 10.1.0.2/32 set interfaces tunnel tun2 encapsulation gre set interfaces tunnel tun2 local-address 172.1.0.2 set interfaces tunnel tun2 local-interface eth1 set interfaces tunnel tun2 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set protocols bgp 20 neighbor peer1 local-address 10.1.0.1 set protocols bgp 20 neighbor peer1 remote-address 10.1.0.3 set protocols bgp 20 neighbor peer1 remote-as 20 set protocols bgp 20 neighbor peer2 local-address 10.1.0.2 set protocols bgp 20 neighbor peer2 remote-address 10.1.0.3 set protocols bgp 20 neighbor peer2 remote-as 20 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system vrf VRF0 set system vrf VRF1
Step 6: Run command protocols bgp show ip summary at DUT0 and check if output does not match the following regular expressions:
10.1.0\.3\s+10.1.0\.1\s+4\s+20.*never.* 10.1.0\.3\s+10.1.0\.2\s+4\s+20.*never.*Show output
IPv4 Unicast Summary: BGP router identifier 10.1.0.2, local AS number 20 VRF default vrf-id 0 BGP table version 1 RIB entries 1, using 128 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.1.0.3 10.1.0.1 4 20 4 3 1 0 0 00:00:01 Established 1 0 FRRouting/10.4.1 10.1.0.3 10.1.0.2 4 20 4 3 1 0 0 00:00:01 Established 1 0 FRRouting/10.4.1 Total number of neighbors 2
Step 7: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:
\*[> = \s]i\s1.1.1\.0/24\s+10.1.0\.3.* \*[> = \s]i\s+10.1.0\.3.*Show output
BGP table version is 1, local router ID is 10.1.0.2, 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.1.0.3 0 100 0 ? *=i 10.1.0.3 0 100 0 ? Displayed 1 routes and 2 total paths
Step 8: Run command protocols ip show route bgp at DUT0 and check if output matches the following regular expressions:
B>.*1.1.1\.0/24.*200/0.*via.*10.1.0\.3.*(recursive).* .*via 10.1.0\.3,.*tun1.*onlink,.* .*via 10.1.0\.3,.*tun2.*onlink,.*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.1.0.3 (recursive), weight 1, 00:00:00 * via 10.1.0.3, tun2 onlink, weight 1, 00:00:00 * via 10.1.0.3, tun1 onlink, weight 1, 00:00:00 via 10.1.0.3 (recursive), weight 1, 00:00:00 via 10.1.0.3, tun2 onlink, weight 1, 00:00:00 via 10.1.0.3, tun1 onlink, weight 1, 00:00:00
Step 9: Ping IP address 1.1.1.1 from DUT0:
admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1Show 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.276 ms --- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.276/0.276/0.276/0.000 ms
Test eBGP - Dynamic neighbors multihoming
Description
Test to check eBGP protocol with dynamic neighbors
Scenario
Step 1: Set the following configuration in DUT1 :
set interfaces dummy dum0 address 1.1.1.1/24 set interfaces ethernet eth0 address 172.1.0.3/24 set interfaces tunnel tun1 address 10.1.0.3/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.3 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp set protocols bgp 20 peer-group overlay listen range 10.1.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 system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.1.0.1/24 set interfaces ethernet eth0 vrf VRF0 set interfaces ethernet eth1 address 172.1.0.2/24 set interfaces ethernet eth1 vrf VRF1 set interfaces tunnel tun1 address 10.1.0.1/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.1 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set interfaces tunnel tun2 address 10.1.0.2/32 set interfaces tunnel tun2 encapsulation gre set interfaces tunnel tun2 local-address 172.1.0.2 set interfaces tunnel tun2 local-interface eth1 set interfaces tunnel tun2 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set system vrf VRF0 set system vrf VRF1
Step 3: Ping IP address 10.1.0.3 from DUT0:
admin@DUT0$ ping 10.1.0.3 local-address 10.1.0.1 count 1 size 56 timeout 1Show output
PING 10.1.0.3 (10.1.0.3) from 10.1.0.1 : 56(84) bytes of data. 64 bytes from 10.1.0.3: icmp_seq=1 ttl=64 time=0.462 ms --- 10.1.0.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.462/0.462/0.462/0.000 ms
Step 4: Ping IP address 10.1.0.3 from DUT0:
admin@DUT0$ ping 10.1.0.3 local-address 10.1.0.2 count 1 size 56 timeout 1Show output
PING 10.1.0.3 (10.1.0.3) from 10.1.0.2 : 56(84) bytes of data. 64 bytes from 10.1.0.3: icmp_seq=1 ttl=64 time=0.348 ms --- 10.1.0.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.348/0.348/0.348/0.000 ms
Step 5: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 172.1.0.1/24 set interfaces ethernet eth0 vrf VRF0 set interfaces ethernet eth1 address 172.1.0.2/24 set interfaces ethernet eth1 vrf VRF1 set interfaces tunnel tun1 address 10.1.0.1/32 set interfaces tunnel tun1 encapsulation gre set interfaces tunnel tun1 local-address 172.1.0.1 set interfaces tunnel tun1 local-interface eth0 set interfaces tunnel tun1 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set interfaces tunnel tun2 address 10.1.0.2/32 set interfaces tunnel tun2 encapsulation gre set interfaces tunnel tun2 local-address 172.1.0.2 set interfaces tunnel tun2 local-interface eth1 set interfaces tunnel tun2 nhrp nhs 10.1.0.3 nbma 172.1.0.3 set protocols bgp 10 neighbor peer1 disable-connected-check set protocols bgp 10 neighbor peer1 local-address 10.1.0.1 set protocols bgp 10 neighbor peer1 remote-address 10.1.0.3 set protocols bgp 10 neighbor peer1 remote-as 20 set protocols bgp 10 neighbor peer1 route-map import PERMIT set protocols bgp 10 neighbor peer2 disable-connected-check set protocols bgp 10 neighbor peer2 local-address 10.1.0.2 set protocols bgp 10 neighbor peer2 remote-address 10.1.0.3 set protocols bgp 10 neighbor peer2 remote-as 20 set protocols bgp 10 neighbor peer2 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' set system vrf VRF0 set system vrf VRF1
Step 6: Run command protocols bgp show ip summary at DUT0 and check if output does not match the following regular expressions:
10.1.0\.3\s+10.1.0\.1\s+4\s+20.*never.* 10.1.0\.3\s+10.1.0\.2\s+4\s+20.*never.*Show output
IPv4 Unicast Summary: BGP router identifier 10.1.0.2, local AS number 10 VRF default vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.1.0.3 10.1.0.1 4 20 2 2 0 0 0 00:00:00 Established 0 (Policy) N/A 10.1.0.3 10.1.0.2 4 20 2 2 0 0 0 00:00:00 Established 0 (Policy) N/A Total number of neighbors 2
Step 7: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:
\*[> =]\s+1.1.1\.0/24\s+10.1.0\.3.* \*[> =]\s+10.1.0\.3.*Show output
BGP table version is 2, local router ID is 10.1.0.2, 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.1.0.3 0 0 20 ? *= 10.1.0.3 0 0 20 ? Displayed 1 routes and 2 total paths
Step 8: Run command protocols ip show route bgp at DUT0 and check if output matches the following regular expressions:
B>.*1.1.1\.0/24.*20/0.*via.*10.1.0\.3.*(recursive).* .*via 10.1.0\.3,.*tun1.*onlink,.* .*via 10.1.0\.3,.*tun2.*onlink,.*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.1.0.3 (recursive), weight 1, 00:00:01 * via 10.1.0.3, tun2 onlink, weight 1, 00:00:01 * via 10.1.0.3, tun1 onlink, weight 1, 00:00:01 via 10.1.0.3 (recursive), weight 1, 00:00:01 via 10.1.0.3, tun2 onlink, weight 1, 00:00:01 via 10.1.0.3, tun1 onlink, weight 1, 00:00:01
Step 9: Ping IP address 1.1.1.1 from DUT0:
admin@DUT0$ ping 1.1.1.1 count 1 size 56 timeout 1Show 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.500 ms --- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.500/0.500/0.500/0.000 ms