Mailing List Archive

[PATCH 32/57] bgpd: vty commands added for EVPN address family
Enhancement of the following show vty evpn commands:

show bgp l2vpn all A.B.C.D
show bgp l2vpn evpn rd ASN:nn_or_IP-address:nn A.B.C.D/M
show bgp l2vpn evpn rd ASN:nn_or_IP-address:nn A.B.C.D
show bgp l2vpn evpn all summary
show bgp l2vpn evpn all neighbors
show bgp l2vpn evpn all neighbors A.B.C.D

Additionaly, soft-reconfiguration flag can be set for EVPN address
family. This configuration command permits to handle incoming BGP updates
in a separate ADJ-RIB-IN table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
---
bgpd/bgp_route.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
bgpd/bgp_vty.c | 42 +++++++++++++++++++++++++++++
2 files changed, 121 insertions(+), 1 deletion(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e90760aad9ec..c6225c9e35eb 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7877,7 +7877,7 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp,

match.family = afi2family (afi);

- if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP))
+ if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi == SAFI_INTERNAL_EVPN))
{
for (rn = bgp_table_top (rib); rn; rn = bgp_route_next (rn))
{
@@ -8151,6 +8151,18 @@ DEFUN (show_ip_bgp_vpnv4_all_route,
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 0, BGP_PATH_ALL);
}

+DEFUN (show_bgp_l2vpn_evpn_all_route,
+ show_bgp_l2vpn_evpn_all_route_cmd,
+ "show bgp l2vpn all A.B.C.D",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display information about all VPNv4 NLRIs\n"
+ "Network in the BGP routing table to display\n")
+{
+ return bgp_show_route (vty, NULL, argv[0], AFI_INTERNAL_L2VPN, SAFI_INTERNAL_EVPN, NULL, 0, BGP_PATH_ALL);
+}

DEFUN (show_ip_bgp_vpnv4_rd_route,
show_ip_bgp_vpnv4_rd_route_cmd,
@@ -8269,6 +8281,19 @@ DEFUN (show_ip_bgp_vpnv4_all_prefix,
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 1, BGP_PATH_ALL);
}

+DEFUN (show_bgp_l2vpn_evpn_all_prefix,
+ show_bgp_l2vpn_evpn_all_prefix_cmd,
+ "show bgp l2vpn evpn all A.B.C.D/M",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display information about all VPNv4 NLRIs\n"
+ "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+ return bgp_show_route (vty, NULL, argv[0], AFI_INTERNAL_L2VPN, SAFI_INTERNAL_EVPN, NULL, 1, BGP_PATH_ALL);
+}
+
DEFUN (show_ip_bgp_vpnv4_rd_prefix,
show_ip_bgp_vpnv4_rd_prefix_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn A.B.C.D/M",
@@ -8292,6 +8317,29 @@ DEFUN (show_ip_bgp_vpnv4_rd_prefix,
return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MPLS_VPN, &prd, 1, BGP_PATH_ALL);
}

+DEFUN (show_bgp_l2vpn_evpn_rd_prefix,
+ show_bgp_l2vpn_evpn_rd_prefix_cmd,
+ "show bgp l2vpn evpn rd ASN:nn_or_IP-address:nn A.B.C.D/M",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display information for a route distinguisher\n"
+ "VPN Route Distinguisher\n"
+ "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
+{
+ int ret;
+ struct prefix_rd prd;
+
+ ret = str2prefix_rd (argv[0], &prd);
+ if (! ret)
+ {
+ vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ return bgp_show_route (vty, NULL, argv[1], AFI_INTERNAL_L2VPN, SAFI_INTERNAL_EVPN, &prd, 1, BGP_PATH_ALL);
+}
+
DEFUN (show_ip_bgp_view,
show_ip_bgp_view_cmd,
"show ip bgp view WORD",
@@ -8507,6 +8555,29 @@ DEFUN (show_bgp_ipv4_vpn_rd_route,
return bgp_show_route (vty, NULL, argv[1], AFI_IP, SAFI_MPLS_VPN, &prd, 0, BGP_PATH_ALL);
}

+DEFUN (show_bgp_l2vpn_evpn_rd_route,
+ show_bgp_l2vpn_evpn_rd_route_cmd,
+ "show bgp l2vpn evpn rd ASN:nn_or_IP-address:nn A.B.C.D",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display information for a route distinguisher\n"
+ "VPN Route Distinguisher\n"
+ "Network in the BGP routing table to display\n")
+{
+ int ret;
+ struct prefix_rd prd;
+
+ ret = str2prefix_rd (argv[0], &prd);
+ if (! ret)
+ {
+ vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ return bgp_show_route (vty, NULL, argv[1], AFI_INTERNAL_L2VPN, SAFI_INTERNAL_EVPN, &prd, 0, BGP_PATH_ALL);
+}
+
DEFUN (show_bgp_ipv6_vpn_rd_route,
show_bgp_ipv6_vpn_rd_route_cmd,
"show bgp ipv6 vpn rd ASN:nn_or_IP-address:nn X:X::X:X",
@@ -17427,6 +17498,7 @@ bgp_route_init (void)
install_element (VIEW_NODE, &show_bgp_ipv4_vpn_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_vpn_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_route_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_rd_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_route_cmd);
@@ -17542,6 +17614,7 @@ bgp_route_init (void)
/* Restricted node: VIEW_NODE - (set of dangerous commands) */
install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_route_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv4_vpn_rd_route_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_rd_route_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv6_vpn_rd_route_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_rd_route_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_rd_route_cmd);
@@ -17782,6 +17855,7 @@ bgp_route_init (void)
install_element (VIEW_NODE, &show_ip_bgp_vrf_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_route_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_all_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_prefix_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_cmd);
@@ -17789,6 +17863,7 @@ bgp_route_init (void)
install_element (VIEW_NODE, &show_bgp_ipv4_safi_prefix_pathtype_cmd);
install_element (VIEW_NODE, &show_ip_bgp_prefix_pathtype_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_prefix_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_all_prefix_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_prefix_cmd);
install_element (VIEW_NODE, &show_ip_bgp_view_cmd);
install_element (VIEW_NODE, &show_ip_bgp_view_route_cmd);
@@ -17873,6 +17948,8 @@ bgp_route_init (void)
install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_route_pathtype_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vrf_route_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_route_cmd);
+ install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_route_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_all_route_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_route_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_prefix_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_prefix_cmd);
@@ -17880,6 +17957,7 @@ bgp_route_init (void)
install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_prefix_pathtype_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_prefix_pathtype_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_prefix_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_all_prefix_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_prefix_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_view_route_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_view_prefix_cmd);
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 6b40bf41b663..ea00149ba0a1 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7774,6 +7774,20 @@ DEFUN (show_bgp_ipv4_vpn_summary,
return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
}

+DEFUN (show_bgp_l2vpn_evpn_all_summary,
+ show_bgp_l2vpn_evpn_all_summary_cmd,
+ "show bgp l2vpn evpn all summary",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display information about all EVPN\n"
+ "Summary of BGP neighbor status\n")
+{
+ return bgp_show_summary_vty (vty, NULL, AFI_INTERNAL_L2VPN, SAFI_INTERNAL_EVPN);
+}
+
+
/* `show ip bgp summary' commands. */
DEFUN (show_bgp_ipv6_vpn_summary,
show_bgp_ipv6_vpn_summary_cmd,
@@ -8863,6 +8877,16 @@ ALIAS (show_ip_bgp_neighbors,
"Detailed information on TCP and BGP neighbor connections\n")

ALIAS (show_ip_bgp_neighbors,
+ show_bgp_l2vpn_evpn_all_neighbors_cmd,
+ "show bgp l2vpn evpn all neighbors",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display all information about EVPN\n"
+ "Detailed information on TCP and BGP neighbor connections\n")
+
+ALIAS (show_ip_bgp_neighbors,
show_ip_bgp_vpnv4_rd_neighbors_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
SHOW_STR
@@ -8919,6 +8943,17 @@ ALIAS (show_ip_bgp_neighbors_peer,
"Neighbor to display information about\n")

ALIAS (show_ip_bgp_neighbors_peer,
+ show_bgp_l2vpn_evpn_all_neighbors_peer_cmd,
+ "show bgp l2vpn evpn all neighbors A.B.C.D",
+ SHOW_STR
+ BGP_STR
+ "Display L2VPN AFI information\n"
+ "Display EVPN NLRI specific information\n"
+ "Display all information about EVPN\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n")
+
+ALIAS (show_ip_bgp_neighbors_peer,
show_ip_bgp_vpnv4_rd_neighbors_peer_cmd,
"show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
SHOW_STR
@@ -10491,6 +10526,8 @@ bgp_vty_init (void)
install_element (BGP_ENCAP_NODE, &no_neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
+ install_element (BGP_EVPN_NODE, &neighbor_soft_reconfiguration_cmd);
+ install_element (BGP_EVPN_NODE, &no_neighbor_soft_reconfiguration_cmd);

/* "neighbor attribute-unchanged" commands. */
install_element (BGP_NODE, &neighbor_attr_unchanged_cmd);
@@ -11559,6 +11596,7 @@ bgp_vty_init (void)
install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_all_summary_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd);
@@ -11566,20 +11604,24 @@ bgp_vty_init (void)
install_element (RESTRICTED_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_all_summary_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_all_neighbors_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
+ install_element (VIEW_NODE, &show_bgp_l2vpn_evpn_all_neighbors_peer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd);
install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_neighbors_peer_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_l2vpn_evpn_all_neighbors_peer_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd);
--
2.1.4


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev