@@ -527,6 +527,40 @@ save_bgp_neighbor() {
527
527
done
528
528
}
529
529
530
+ # ##############################################################################
531
+ # Iterates all EVPN neighbors and runs save_vtysh to save each neighbor's
532
+ # advertised-routes and received-routes
533
+ # On multi ASIC platform, collects information from all namespaces
534
+ # Globals:
535
+ # None
536
+ # Arguments:
537
+ # Optional arg namespace
538
+ # Returns:
539
+ # None
540
+ # ##############################################################################
541
+ save_bgp_evpn_neighbor () {
542
+ trap ' handle_error $? $LINENO' ERR
543
+ local timeout_cmd=" timeout --foreground ${TIMEOUT_MIN} m"
544
+ local asic_id=${1:- " " }
545
+ local ns=$( get_vtysh_namespace $asic_id )
546
+
547
+ evpn_neighbors=$( ${timeout_cmd} bash -c " vtysh -c 'show bgp l2vpn evpn summary' | cut -d ' ' -f1" )
548
+ local parse_neighbors=false
549
+ for word in $evpn_neighbors ; do
550
+ if [[ $word == " Neighbor" ]]; then
551
+ parse_neighbors=true
552
+ continue
553
+ elif [[ $word == " Total" ]]; then
554
+ parse_neighbors=false
555
+ continue
556
+ fi
557
+ if [ " $parse_neighbors " = true ]; then
558
+ save_cmd " vtysh $ns -c \" show bgp l2vpn evpn neighbors $word advertised-routes\" " " bgp.evpn.neighbor.$word .adv$asic_id "
559
+ save_cmd " vtysh $ns -c \" show bgp l2vpn evpn neighbors $word routes\" " " bgp.evpn.neighbor.$word .rcv$asic_id "
560
+ fi
561
+ done
562
+ }
563
+
530
564
# ##############################################################################
531
565
# Iterates all ASIC namespaces on multi ASIC platform and on default (host)
532
566
# namespace on single ASIC platform
@@ -549,6 +583,28 @@ save_bgp_neighbor_all_ns() {
549
583
fi
550
584
}
551
585
586
+ # ##############################################################################
587
+ # Iterates all ASIC namespaces on multi ASIC platform and on default (host)
588
+ # namespace on single ASIC platform
589
+ # Globals:
590
+ # NUM_ASICS
591
+ # Arguments:
592
+ # None
593
+ # Returns:
594
+ # None
595
+ # ##############################################################################
596
+ save_bgp_evpn_neighbor_all_ns () {
597
+ trap ' handle_error $? $LINENO' ERR
598
+ if [[ ( " $NUM_ASICS " == 1 ) ]] ; then
599
+ save_bgp_evpn_neighbor
600
+ else
601
+ for (( i= 0 ; i< $NUM_ASICS ; i++ ))
602
+ do
603
+ save_bgp_evpn_neighbor $i
604
+ done
605
+ fi
606
+ }
607
+
552
608
# ##############################################################################
553
609
# Dump the nat config, iptables rules and conntrack nat entries
554
610
# Globals:
@@ -624,6 +680,23 @@ save_bgp_info() {
624
680
save_bgp_neighbor_all_ns
625
681
}
626
682
683
+ # ##############################################################################
684
+ # Save EVPN related info
685
+ # Globals:
686
+ # None
687
+ # Arguments:
688
+ # None
689
+ # Returns:
690
+ # None
691
+ # ##############################################################################
692
+ save_evpn_info () {
693
+ trap ' handle_error $? $LINENO' ERR
694
+ save_vtysh " show bgp l2vpn evpn" " bgp.l2vpn.evpn"
695
+ save_vtysh " show bgp l2vpn evpn route detail" " bgp.evpn.route"
696
+ save_vtysh " show evpn vni detail" " bgp.evpn.vni"
697
+ save_vtysh " show evpn arp-cache vni all" " bgp.evpn.arp"
698
+ save_bgp_evpn_neighbor_all_ns
699
+ }
627
700
# ##############################################################################
628
701
# Save FRR related info
629
702
# Globals:
@@ -1323,6 +1396,7 @@ main() {
1323
1396
1324
1397
save_frr_info
1325
1398
save_bgp_info
1399
+ save_evpn_info
1326
1400
1327
1401
save_cmd " show interface status -d all" " interface.status"
1328
1402
save_cmd " show interface transceiver presence" " interface.xcvrs.presence"
0 commit comments