2 Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
4 This file is part of GNU Zebra.
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
32 #include "bgpd/bgpd.h"
33 #include "bgpd/bgp_attr.h"
34 #include "bgpd/bgp_aspath.h"
35 #include "bgpd/bgp_community.h"
36 #include "bgpd/bgp_debug.h"
37 #include "bgpd/bgp_mplsvpn.h"
38 #include "bgpd/bgp_open.h"
39 #include "bgpd/bgp_route.h"
40 #include "bgpd/bgp_zebra.h"
42 /* Utility function to get address family from current node. */
44 bgp_node_afi (struct vty
*vty
)
46 if (vty
->node
== BGP_IPV6_NODE
)
51 /* Utility function to get subsequent address family from current
54 bgp_node_safi (struct vty
*vty
)
56 if (vty
->node
== BGP_VPNV4_NODE
)
58 if (vty
->node
== BGP_IPV4M_NODE
)
59 return SAFI_MULTICAST
;
64 peer_address_self_check (union sockunion
*su
)
66 struct interface
*ifp
= NULL
;
68 if (su
->sa
.sa_family
== AF_INET
)
69 ifp
= if_lookup_by_ipv4_exact (&su
->sin
.sin_addr
);
71 else if (su
->sa
.sa_family
== AF_INET6
)
72 ifp
= if_lookup_by_ipv6_exact (&su
->sin6
.sin6_addr
);
73 #endif /* HAVE IPV6 */
81 /* Utility function for looking up peer from VTY. */
83 peer_lookup_vty (struct vty
*vty
, char *ip_str
)
92 ret
= str2sockunion (ip_str
, &su
);
95 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
99 peer
= peer_lookup (bgp
, &su
);
102 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE
);
108 /* Utility function for looking up peer or peer group. */
110 peer_and_group_lookup_vty (struct vty
*vty
, char *peer_str
)
116 struct peer_group
*group
;
120 ret
= str2sockunion (peer_str
, &su
);
123 peer
= peer_lookup (bgp
, &su
);
129 group
= peer_group_lookup (bgp
, peer_str
);
134 vty_out (vty
, "%% Specify remote-as or peer-group commands first%s",
141 bgp_vty_return (struct vty
*vty
, int ret
)
147 case BGP_ERR_INVALID_VALUE
:
148 str
= "Invalid value";
150 case BGP_ERR_INVALID_FLAG
:
151 str
= "Invalid flag";
153 case BGP_ERR_PEER_INACTIVE
:
154 str
= "Activate the neighbor for the address family first";
156 case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER
:
157 str
= "Invalid command for a peer-group member";
159 case BGP_ERR_PEER_GROUP_SHUTDOWN
:
160 str
= "Peer-group has been shutdown. Activate the peer-group first";
162 case BGP_ERR_PEER_GROUP_HAS_THE_FLAG
:
163 str
= "This peer is a peer-group member. Please change peer-group configuration";
165 case BGP_ERR_PEER_FLAG_CONFLICT
:
166 str
= "Can't set override-capability and strict-capability-match at the same time";
168 case BGP_ERR_PEER_GROUP_MEMBER_EXISTS
:
169 str
= "No activate for peergroup can be given only if peer-group has no members";
171 case BGP_ERR_PEER_BELONGS_TO_GROUP
:
172 str
= "No activate for an individual peer-group member is invalid";
174 case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED
:
175 str
= "Activate the peer-group for the address family first";
177 case BGP_ERR_PEER_GROUP_NO_REMOTE_AS
:
178 str
= "Specify remote-as or peer-group remote AS first";
180 case BGP_ERR_PEER_GROUP_CANT_CHANGE
:
181 str
= "Cannot change the peer-group. Deconfigure first";
183 case BGP_ERR_PEER_GROUP_MISMATCH
:
184 str
= "Cannot have different peer-group for the neighbor";
186 case BGP_ERR_PEER_FILTER_CONFLICT
:
187 str
= "Prefix/distribute list can not co-exist";
189 case BGP_ERR_NOT_INTERNAL_PEER
:
190 str
= "Invalid command. Not an internal neighbor";
192 case BGP_ERR_REMOVE_PRIVATE_AS
:
193 str
= "Private AS cannot be removed for IBGP peers";
195 case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP
:
196 str
= "Local-AS allowed only for EBGP peers";
198 case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS
:
199 str
= "Cannot have local-as same as BGP AS number";
204 vty_out (vty
, "%% %s%s", str
, VTY_NEWLINE
);
210 /* BGP global configuration. */
212 DEFUN (bgp_multiple_instance_func
,
213 bgp_multiple_instance_cmd
,
214 "bgp multiple-instance",
216 "Enable bgp multiple instance\n")
218 bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE
);
222 DEFUN (no_bgp_multiple_instance
,
223 no_bgp_multiple_instance_cmd
,
224 "no bgp multiple-instance",
227 "BGP multiple instance\n")
231 ret
= bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE
);
234 vty_out (vty
, "%% There are more than two BGP instances%s", VTY_NEWLINE
);
240 DEFUN (bgp_config_type
,
242 "bgp config-type (cisco|zebra)",
244 "Configuration type\n"
248 if (strncmp (argv
[0], "c", 1) == 0)
249 bgp_option_set (BGP_OPT_CONFIG_CISCO
);
251 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
256 DEFUN (no_bgp_config_type
,
257 no_bgp_config_type_cmd
,
258 "no bgp config-type",
261 "Display configuration type\n")
263 bgp_option_unset (BGP_OPT_CONFIG_CISCO
);
267 DEFUN (no_synchronization
,
268 no_synchronization_cmd
,
269 "no synchronization",
271 "Perform IGP synchronization\n")
276 DEFUN (no_auto_summary
,
280 "Enable automatic network number summarization\n")
285 /* "router bgp" commands. */
288 "router bgp <1-65535>",
298 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
303 ret
= bgp_get (&bgp
, &as
, name
);
306 case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET
:
307 vty_out (vty
, "Please specify 'bgp multiple-instance' first%s",
311 case BGP_ERR_AS_MISMATCH
:
312 vty_out (vty
, "BGP is already running; AS is %d%s", as
, VTY_NEWLINE
);
315 case BGP_ERR_INSTANCE_MISMATCH
:
316 vty_out (vty
, "BGP view name and AS number mismatch%s", VTY_NEWLINE
);
317 vty_out (vty
, "BGP instance is already running; AS is %d%s",
323 vty
->node
= BGP_NODE
;
331 "router bgp <1-65535> view WORD",
338 /* "no router bgp" commands. */
339 DEFUN (no_router_bgp
,
341 "no router bgp <1-65535>",
351 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[0], 1, 65535);
356 /* Lookup bgp structure. */
357 bgp
= bgp_lookup (as
, name
);
360 vty_out (vty
, "%% Can't find BGP instance%s", VTY_NEWLINE
);
369 ALIAS (no_router_bgp
,
370 no_router_bgp_view_cmd
,
371 "no router bgp <1-65535> view WORD",
381 DEFUN (bgp_router_id
,
383 "bgp router-id A.B.C.D",
385 "Override configured router identifier\n"
386 "Manually configured router identifier\n")
394 ret
= inet_aton (argv
[0], &id
);
397 vty_out (vty
, "%% Malformed bgp router identifier%s", VTY_NEWLINE
);
401 bgp_router_id_set (bgp
, &id
);
406 DEFUN (no_bgp_router_id
,
407 no_bgp_router_id_cmd
,
411 "Override configured router identifier\n")
421 ret
= inet_aton (argv
[0], &id
);
424 vty_out (vty
, "%% Malformed BGP router identifier%s", VTY_NEWLINE
);
428 if (! IPV4_ADDR_SAME (&bgp
->router_id
, &id
))
430 vty_out (vty
, "%% BGP router-id doesn't match%s", VTY_NEWLINE
);
435 bgp_router_id_unset (bgp
);
440 ALIAS (no_bgp_router_id
,
441 no_bgp_router_id_val_cmd
,
442 "no bgp router-id A.B.C.D",
445 "Override configured router identifier\n"
446 "Manually configured router identifier\n")
448 /* BGP Cluster ID. */
450 DEFUN (bgp_cluster_id
,
452 "bgp cluster-id A.B.C.D",
454 "Configure Route-Reflector Cluster-id\n"
455 "Route-Reflector Cluster-id in IP address format\n")
459 struct in_addr cluster
;
463 ret
= inet_aton (argv
[0], &cluster
);
466 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
470 bgp_cluster_id_set (bgp
, &cluster
);
475 ALIAS (bgp_cluster_id
,
476 bgp_cluster_id32_cmd
,
477 "bgp cluster-id <1-4294967295>",
479 "Configure Route-Reflector Cluster-id\n"
480 "Route-Reflector Cluster-id as 32 bit quantity\n")
482 DEFUN (no_bgp_cluster_id
,
483 no_bgp_cluster_id_cmd
,
487 "Configure Route-Reflector Cluster-id\n")
491 struct in_addr cluster
;
497 ret
= inet_aton (argv
[0], &cluster
);
500 vty_out (vty
, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE
);
505 bgp_cluster_id_unset (bgp
);
510 ALIAS (no_bgp_cluster_id
,
511 no_bgp_cluster_id_arg_cmd
,
512 "no bgp cluster-id A.B.C.D",
515 "Configure Route-Reflector Cluster-id\n"
516 "Route-Reflector Cluster-id in IP address format\n")
518 DEFUN (bgp_confederation_identifier
,
519 bgp_confederation_identifier_cmd
,
520 "bgp confederation identifier <1-65535>",
521 "BGP specific commands\n"
522 "AS confederation parameters\n"
524 "Set routing domain confederation AS\n")
531 VTY_GET_INTEGER ("AS", as
, argv
[0]);
533 bgp_confederation_id_set (bgp
, as
);
538 DEFUN (no_bgp_confederation_identifier
,
539 no_bgp_confederation_identifier_cmd
,
540 "no bgp confederation identifier",
542 "BGP specific commands\n"
543 "AS confederation parameters\n"
552 VTY_GET_INTEGER ("AS", as
, argv
[0]);
554 bgp_confederation_id_unset (bgp
);
559 ALIAS (no_bgp_confederation_identifier
,
560 no_bgp_confederation_identifier_arg_cmd
,
561 "no bgp confederation identifier <1-65535>",
563 "BGP specific commands\n"
564 "AS confederation parameters\n"
566 "Set routing domain confederation AS\n")
568 DEFUN (bgp_confederation_peers
,
569 bgp_confederation_peers_cmd
,
570 "bgp confederation peers .<1-65535>",
571 "BGP specific commands\n"
572 "AS confederation parameters\n"
573 "Peer ASs in BGP confederation\n"
582 for (i
= 0; i
< argc
; i
++)
584 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
588 vty_out (vty
, "%% Local member-AS not allowed in confed peer list%s",
593 bgp_confederation_peers_add (bgp
, as
);
598 DEFUN (no_bgp_confederation_peers
,
599 no_bgp_confederation_peers_cmd
,
600 "no bgp confederation peers .<1-65535>",
602 "BGP specific commands\n"
603 "AS confederation parameters\n"
604 "Peer ASs in BGP confederation\n"
613 for (i
= 0; i
< argc
; i
++)
615 VTY_GET_INTEGER_RANGE ("AS", as
, argv
[i
], 1, 65535);
617 bgp_confederation_peers_remove (bgp
, as
);
626 "timers bgp <0-65535> <0-65535>",
627 "Adjust routing timers\n"
629 "Keepalive interval\n"
633 unsigned long keepalive
= 0;
634 unsigned long holdtime
= 0;
638 VTY_GET_INTEGER ("keepalive", keepalive
, argv
[0]);
639 VTY_GET_INTEGER ("holdtime", holdtime
, argv
[1]);
641 /* Holdtime value check. */
642 if (holdtime
< 3 && holdtime
!= 0)
644 vty_out (vty
, "%% hold time value must be either 0 or greater than 3%s",
649 bgp_timers_set (bgp
, keepalive
, holdtime
);
654 DEFUN (no_bgp_timers
,
658 "Adjust routing timers\n"
664 bgp_timers_unset (bgp
);
669 ALIAS (no_bgp_timers
,
670 no_bgp_timers_arg_cmd
,
671 "no timers bgp <0-65535> <0-65535>",
673 "Adjust routing timers\n"
675 "Keepalive interval\n"
678 DEFUN (bgp_client_to_client_reflection
,
679 bgp_client_to_client_reflection_cmd
,
680 "bgp client-to-client reflection",
681 "BGP specific commands\n"
682 "Configure client to client route reflection\n"
683 "reflection of routes allowed\n")
688 bgp_flag_unset (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
692 DEFUN (no_bgp_client_to_client_reflection
,
693 no_bgp_client_to_client_reflection_cmd
,
694 "no bgp client-to-client reflection",
696 "BGP specific commands\n"
697 "Configure client to client route reflection\n"
698 "reflection of routes allowed\n")
703 bgp_flag_set (bgp
, BGP_FLAG_NO_CLIENT_TO_CLIENT
);
707 /* "bgp always-compare-med" configuration. */
708 DEFUN (bgp_always_compare_med
,
709 bgp_always_compare_med_cmd
,
710 "bgp always-compare-med",
711 "BGP specific commands\n"
712 "Allow comparing MED from different neighbors\n")
717 bgp_flag_set (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
721 DEFUN (no_bgp_always_compare_med
,
722 no_bgp_always_compare_med_cmd
,
723 "no bgp always-compare-med",
725 "BGP specific commands\n"
726 "Allow comparing MED from different neighbors\n")
731 bgp_flag_unset (bgp
, BGP_FLAG_ALWAYS_COMPARE_MED
);
735 /* "bgp deterministic-med" configuration. */
736 DEFUN (bgp_deterministic_med
,
737 bgp_deterministic_med_cmd
,
738 "bgp deterministic-med",
739 "BGP specific commands\n"
740 "Pick the best-MED path among paths advertised from the neighboring AS\n")
745 bgp_flag_set (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
749 DEFUN (no_bgp_deterministic_med
,
750 no_bgp_deterministic_med_cmd
,
751 "no bgp deterministic-med",
753 "BGP specific commands\n"
754 "Pick the best-MED path among paths advertised from the neighboring AS\n")
759 bgp_flag_unset (bgp
, BGP_FLAG_DETERMINISTIC_MED
);
763 /* "bgp fast-external-failover" configuration. */
764 DEFUN (bgp_fast_external_failover
,
765 bgp_fast_external_failover_cmd
,
766 "bgp fast-external-failover",
768 "Immediately reset session if a link to a directly connected external peer goes down\n")
773 bgp_flag_unset (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
777 DEFUN (no_bgp_fast_external_failover
,
778 no_bgp_fast_external_failover_cmd
,
779 "no bgp fast-external-failover",
782 "Immediately reset session if a link to a directly connected external peer goes down\n")
787 bgp_flag_set (bgp
, BGP_FLAG_NO_FAST_EXT_FAILOVER
);
791 /* "bgp enforce-first-as" configuration. */
792 DEFUN (bgp_enforce_first_as
,
793 bgp_enforce_first_as_cmd
,
794 "bgp enforce-first-as",
796 "Enforce the first AS for EBGP routes\n")
801 bgp_flag_set (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
805 DEFUN (no_bgp_enforce_first_as
,
806 no_bgp_enforce_first_as_cmd
,
807 "no bgp enforce-first-as",
810 "Enforce the first AS for EBGP routes\n")
815 bgp_flag_unset (bgp
, BGP_FLAG_ENFORCE_FIRST_AS
);
819 /* "bgp bestpath compare-routerid" configuration. */
820 DEFUN (bgp_bestpath_compare_router_id
,
821 bgp_bestpath_compare_router_id_cmd
,
822 "bgp bestpath compare-routerid",
823 "BGP specific commands\n"
824 "Change the default bestpath selection\n"
825 "Compare router-id for identical EBGP paths\n")
830 bgp_flag_set (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
834 DEFUN (no_bgp_bestpath_compare_router_id
,
835 no_bgp_bestpath_compare_router_id_cmd
,
836 "no bgp bestpath compare-routerid",
838 "BGP specific commands\n"
839 "Change the default bestpath selection\n"
840 "Compare router-id for identical EBGP paths\n")
845 bgp_flag_unset (bgp
, BGP_FLAG_COMPARE_ROUTER_ID
);
849 /* "bgp bestpath as-path ignore" configuration. */
850 DEFUN (bgp_bestpath_aspath_ignore
,
851 bgp_bestpath_aspath_ignore_cmd
,
852 "bgp bestpath as-path ignore",
853 "BGP specific commands\n"
854 "Change the default bestpath selection\n"
855 "AS-path attribute\n"
856 "Ignore as-path length in selecting a route\n")
861 bgp_flag_set (bgp
, BGP_FLAG_ASPATH_IGNORE
);
865 DEFUN (no_bgp_bestpath_aspath_ignore
,
866 no_bgp_bestpath_aspath_ignore_cmd
,
867 "no bgp bestpath as-path ignore",
869 "BGP specific commands\n"
870 "Change the default bestpath selection\n"
871 "AS-path attribute\n"
872 "Ignore as-path length in selecting a route\n")
877 bgp_flag_unset (bgp
, BGP_FLAG_ASPATH_IGNORE
);
881 /* "bgp log-neighbor-changes" configuration. */
882 DEFUN (bgp_log_neighbor_changes
,
883 bgp_log_neighbor_changes_cmd
,
884 "bgp log-neighbor-changes",
885 "BGP specific commands\n"
886 "Log neighbor up/down and reset reason\n")
891 bgp_flag_set (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
895 DEFUN (no_bgp_log_neighbor_changes
,
896 no_bgp_log_neighbor_changes_cmd
,
897 "no bgp log-neighbor-changes",
899 "BGP specific commands\n"
900 "Log neighbor up/down and reset reason\n")
905 bgp_flag_unset (bgp
, BGP_FLAG_LOG_NEIGHBOR_CHANGES
);
909 /* "bgp bestpath med" configuration. */
910 DEFUN (bgp_bestpath_med
,
911 bgp_bestpath_med_cmd
,
912 "bgp bestpath med (confed|missing-as-worst)",
913 "BGP specific commands\n"
914 "Change the default bestpath selection\n"
916 "Compare MED among confederation paths\n"
917 "Treat missing MED as the least preferred one\n")
923 if (strncmp (argv
[0], "confed", 1) == 0)
924 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
926 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
931 DEFUN (bgp_bestpath_med2
,
932 bgp_bestpath_med2_cmd
,
933 "bgp bestpath med confed missing-as-worst",
934 "BGP specific commands\n"
935 "Change the default bestpath selection\n"
937 "Compare MED among confederation paths\n"
938 "Treat missing MED as the least preferred one\n")
943 bgp_flag_set (bgp
, BGP_FLAG_MED_CONFED
);
944 bgp_flag_set (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
948 ALIAS (bgp_bestpath_med2
,
949 bgp_bestpath_med3_cmd
,
950 "bgp bestpath med missing-as-worst confed",
951 "BGP specific commands\n"
952 "Change the default bestpath selection\n"
954 "Treat missing MED as the least preferred one\n"
955 "Compare MED among confederation paths\n")
957 DEFUN (no_bgp_bestpath_med
,
958 no_bgp_bestpath_med_cmd
,
959 "no bgp bestpath med (confed|missing-as-worst)",
961 "BGP specific commands\n"
962 "Change the default bestpath selection\n"
964 "Compare MED among confederation paths\n"
965 "Treat missing MED as the least preferred one\n")
971 if (strncmp (argv
[0], "confed", 1) == 0)
972 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
974 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
979 DEFUN (no_bgp_bestpath_med2
,
980 no_bgp_bestpath_med2_cmd
,
981 "no bgp bestpath med confed missing-as-worst",
983 "BGP specific commands\n"
984 "Change the default bestpath selection\n"
986 "Compare MED among confederation paths\n"
987 "Treat missing MED as the least preferred one\n")
992 bgp_flag_unset (bgp
, BGP_FLAG_MED_CONFED
);
993 bgp_flag_unset (bgp
, BGP_FLAG_MED_MISSING_AS_WORST
);
997 ALIAS (no_bgp_bestpath_med2
,
998 no_bgp_bestpath_med3_cmd
,
999 "no bgp bestpath med missing-as-worst confed",
1001 "BGP specific commands\n"
1002 "Change the default bestpath selection\n"
1004 "Treat missing MED as the least preferred one\n"
1005 "Compare MED among confederation paths\n")
1007 /* "no bgp default ipv4-unicast". */
1008 DEFUN (no_bgp_default_ipv4_unicast
,
1009 no_bgp_default_ipv4_unicast_cmd
,
1010 "no bgp default ipv4-unicast",
1012 "BGP specific commands\n"
1013 "Configure BGP defaults\n"
1014 "Activate ipv4-unicast for a peer by default\n")
1019 bgp_flag_set (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1023 DEFUN (bgp_default_ipv4_unicast
,
1024 bgp_default_ipv4_unicast_cmd
,
1025 "bgp default ipv4-unicast",
1026 "BGP specific commands\n"
1027 "Configure BGP defaults\n"
1028 "Activate ipv4-unicast for a peer by default\n")
1033 bgp_flag_unset (bgp
, BGP_FLAG_NO_DEFAULT_IPV4
);
1037 /* "bgp import-check" configuration. */
1038 DEFUN (bgp_network_import_check
,
1039 bgp_network_import_check_cmd
,
1040 "bgp network import-check",
1041 "BGP specific commands\n"
1042 "BGP network command\n"
1043 "Check BGP network route exists in IGP\n")
1048 bgp_flag_set (bgp
, BGP_FLAG_IMPORT_CHECK
);
1052 DEFUN (no_bgp_network_import_check
,
1053 no_bgp_network_import_check_cmd
,
1054 "no bgp network import-check",
1056 "BGP specific commands\n"
1057 "BGP network command\n"
1058 "Check BGP network route exists in IGP\n")
1063 bgp_flag_unset (bgp
, BGP_FLAG_IMPORT_CHECK
);
1067 DEFUN (bgp_default_local_preference
,
1068 bgp_default_local_preference_cmd
,
1069 "bgp default local-preference <0-4294967295>",
1070 "BGP specific commands\n"
1071 "Configure BGP defaults\n"
1072 "local preference (higher=more preferred)\n"
1073 "Configure default local preference value\n")
1076 u_int32_t local_pref
;
1080 VTY_GET_INTEGER ("local preference", local_pref
, argv
[0]);
1082 bgp_default_local_preference_set (bgp
, local_pref
);
1087 DEFUN (no_bgp_default_local_preference
,
1088 no_bgp_default_local_preference_cmd
,
1089 "no bgp default local-preference",
1091 "BGP specific commands\n"
1092 "Configure BGP defaults\n"
1093 "local preference (higher=more preferred)\n")
1098 bgp_default_local_preference_unset (bgp
);
1102 ALIAS (no_bgp_default_local_preference
,
1103 no_bgp_default_local_preference_val_cmd
,
1104 "no bgp default local-preference <0-4294967295>",
1106 "BGP specific commands\n"
1107 "Configure BGP defaults\n"
1108 "local preference (higher=more preferred)\n"
1109 "Configure default local preference value\n")
1112 peer_remote_as_vty (struct vty
*vty
, char *peer_str
, char *as_str
, afi_t afi
,
1122 /* Get AS number. */
1123 VTY_GET_INTEGER_RANGE ("AS", as
, as_str
, 1, 65535);
1125 /* If peer is peer group, call proper function. */
1126 ret
= str2sockunion (peer_str
, &su
);
1129 ret
= peer_group_remote_as (bgp
, peer_str
, &as
);
1132 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1138 if (peer_address_self_check (&su
))
1140 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1145 ret
= peer_remote_as (bgp
, &su
, &as
, afi
, safi
);
1147 /* This peer belongs to peer group. */
1150 case BGP_ERR_PEER_GROUP_MEMBER
:
1151 vty_out (vty
, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as
, VTY_NEWLINE
);
1154 case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
:
1155 vty_out (vty
, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as
, as_str
, VTY_NEWLINE
);
1159 return bgp_vty_return (vty
, ret
);
1162 DEFUN (neighbor_remote_as
,
1163 neighbor_remote_as_cmd
,
1164 NEIGHBOR_CMD2
"remote-as <1-65535>",
1167 "Specify a BGP neighbor\n"
1170 return peer_remote_as_vty (vty
, argv
[0], argv
[1], AFI_IP
, SAFI_UNICAST
);
1173 DEFUN (neighbor_peer_group
,
1174 neighbor_peer_group_cmd
,
1175 "neighbor WORD peer-group",
1178 "Configure peer-group\n")
1181 struct peer_group
*group
;
1185 group
= peer_group_get (bgp
, argv
[0]);
1201 struct peer_group
*group
;
1204 ret
= str2sockunion (argv
[0], &su
);
1207 group
= peer_group_lookup (vty
->index
, argv
[0]);
1209 peer_group_delete (group
);
1212 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1218 peer
= peer_lookup (vty
->index
, &su
);
1227 no_neighbor_remote_as_cmd
,
1228 NO_NEIGHBOR_CMD
"remote-as <1-65535>",
1232 "Specify a BGP neighbor\n"
1235 DEFUN (no_neighbor_peer_group
,
1236 no_neighbor_peer_group_cmd
,
1237 "no neighbor WORD peer-group",
1241 "Configure peer-group\n")
1243 struct peer_group
*group
;
1245 group
= peer_group_lookup (vty
->index
, argv
[0]);
1247 peer_group_delete (group
);
1250 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1256 DEFUN (no_neighbor_peer_group_remote_as
,
1257 no_neighbor_peer_group_remote_as_cmd
,
1258 "no neighbor WORD remote-as <1-65535>",
1262 "Specify a BGP neighbor\n"
1265 struct peer_group
*group
;
1267 group
= peer_group_lookup (vty
->index
, argv
[0]);
1269 peer_group_remote_as_delete (group
);
1272 vty_out (vty
, "%% Create the peer-group first%s", VTY_NEWLINE
);
1278 DEFUN (neighbor_local_as
,
1279 neighbor_local_as_cmd
,
1280 NEIGHBOR_CMD2
"local-as <1-65535>",
1283 "Specify a local-as number\n"
1284 "AS number used as local AS\n")
1289 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1293 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 0);
1294 return bgp_vty_return (vty
, ret
);
1297 DEFUN (neighbor_local_as_no_prepend
,
1298 neighbor_local_as_no_prepend_cmd
,
1299 NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1302 "Specify a local-as number\n"
1303 "AS number used as local AS\n"
1304 "Do not prepend local-as to updates from ebgp peers\n")
1309 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1313 ret
= peer_local_as_set (peer
, atoi (argv
[1]), 1);
1314 return bgp_vty_return (vty
, ret
);
1317 DEFUN (no_neighbor_local_as
,
1318 no_neighbor_local_as_cmd
,
1319 NO_NEIGHBOR_CMD2
"local-as",
1323 "Specify a local-as number\n")
1328 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1332 ret
= peer_local_as_unset (peer
);
1333 return bgp_vty_return (vty
, ret
);
1336 ALIAS (no_neighbor_local_as
,
1337 no_neighbor_local_as_val_cmd
,
1338 NO_NEIGHBOR_CMD2
"local-as <1-65535>",
1342 "Specify a local-as number\n"
1343 "AS number used as local AS\n")
1345 ALIAS (no_neighbor_local_as
,
1346 no_neighbor_local_as_val2_cmd
,
1347 NO_NEIGHBOR_CMD2
"local-as <1-65535> no-prepend",
1351 "Specify a local-as number\n"
1352 "AS number used as local AS\n"
1353 "Do not prepend local-as to updates from ebgp peers\n")
1355 DEFUN (neighbor_activate
,
1356 neighbor_activate_cmd
,
1357 NEIGHBOR_CMD2
"activate",
1360 "Enable the Address Family for this Neighbor\n")
1364 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1368 peer_activate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1373 DEFUN (no_neighbor_activate
,
1374 no_neighbor_activate_cmd
,
1375 NO_NEIGHBOR_CMD2
"activate",
1379 "Enable the Address Family for this Neighbor\n")
1385 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1389 ret
= peer_deactivate (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
1391 return bgp_vty_return (vty
, ret
);
1394 DEFUN (neighbor_set_peer_group
,
1395 neighbor_set_peer_group_cmd
,
1396 NEIGHBOR_CMD
"peer-group WORD",
1399 "Member of the peer-group\n"
1400 "peer-group name\n")
1406 struct peer_group
*group
;
1410 ret
= str2sockunion (argv
[0], &su
);
1413 vty_out (vty
, "%% Malformed address: %s%s", argv
[0], VTY_NEWLINE
);
1417 group
= peer_group_lookup (bgp
, argv
[1]);
1420 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1424 if (peer_address_self_check (&su
))
1426 vty_out (vty
, "%% Can not configure the local system as neighbor%s",
1431 ret
= peer_group_bind (bgp
, &su
, group
, bgp_node_afi (vty
),
1432 bgp_node_safi (vty
), &as
);
1434 if (ret
== BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
)
1436 vty_out (vty
, "%% Peer with AS %d cannot be in this peer-group, members must be all internal or all external%s", as
, VTY_NEWLINE
);
1440 return bgp_vty_return (vty
, ret
);
1443 DEFUN (no_neighbor_set_peer_group
,
1444 no_neighbor_set_peer_group_cmd
,
1445 NO_NEIGHBOR_CMD
"peer-group WORD",
1449 "Member of the peer-group\n"
1450 "peer-group name\n")
1455 struct peer_group
*group
;
1459 peer
= peer_lookup_vty (vty
, argv
[0]);
1463 group
= peer_group_lookup (bgp
, argv
[1]);
1466 vty_out (vty
, "%% Configure the peer-group first%s", VTY_NEWLINE
);
1470 ret
= peer_group_unbind (bgp
, peer
, group
, bgp_node_afi (vty
),
1471 bgp_node_safi (vty
));
1473 return bgp_vty_return (vty
, ret
);
1477 peer_flag_modify_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
, int set
)
1482 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
1487 ret
= peer_flag_set (peer
, flag
);
1489 ret
= peer_flag_unset (peer
, flag
);
1491 return bgp_vty_return (vty
, ret
);
1495 peer_flag_set_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
)
1497 return peer_flag_modify_vty (vty
, ip_str
, flag
, 1);
1501 peer_flag_unset_vty (struct vty
*vty
, char *ip_str
, u_int16_t flag
)
1503 return peer_flag_modify_vty (vty
, ip_str
, flag
, 0);
1506 /* neighbor passive. */
1507 DEFUN (neighbor_passive
,
1508 neighbor_passive_cmd
,
1509 NEIGHBOR_CMD2
"passive",
1512 "Don't send open messages to this neighbor\n")
1514 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1517 DEFUN (no_neighbor_passive
,
1518 no_neighbor_passive_cmd
,
1519 NO_NEIGHBOR_CMD2
"passive",
1523 "Don't send open messages to this neighbor\n")
1525 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_PASSIVE
);
1528 /* neighbor shutdown. */
1529 DEFUN (neighbor_shutdown
,
1530 neighbor_shutdown_cmd
,
1531 NEIGHBOR_CMD2
"shutdown",
1534 "Administratively shut down this neighbor\n")
1536 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1539 DEFUN (no_neighbor_shutdown
,
1540 no_neighbor_shutdown_cmd
,
1541 NO_NEIGHBOR_CMD2
"shutdown",
1545 "Administratively shut down this neighbor\n")
1547 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_SHUTDOWN
);
1550 /* neighbor capability route-refresh. */
1551 DEFUN (neighbor_capability_route_refresh
,
1552 neighbor_capability_route_refresh_cmd
,
1553 NEIGHBOR_CMD2
"capability route-refresh",
1556 "Advertise capability to the peer\n"
1557 "Advertise route-refresh capability to this neighbor\n")
1559 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_NO_ROUTE_REFRESH_CAP
);
1562 DEFUN (no_neighbor_capability_route_refresh
,
1563 no_neighbor_capability_route_refresh_cmd
,
1564 NO_NEIGHBOR_CMD2
"capability route-refresh",
1568 "Advertise capability to the peer\n"
1569 "Advertise route-refresh capability to this neighbor\n")
1571 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_NO_ROUTE_REFRESH_CAP
);
1574 /* neighbor capability dynamic. */
1575 DEFUN (neighbor_capability_dynamic
,
1576 neighbor_capability_dynamic_cmd
,
1577 NEIGHBOR_CMD2
"capability dynamic",
1580 "Advertise capability to the peer\n"
1581 "Advertise dynamic capability to this neighbor\n")
1583 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1586 DEFUN (no_neighbor_capability_dynamic
,
1587 no_neighbor_capability_dynamic_cmd
,
1588 NO_NEIGHBOR_CMD2
"capability dynamic",
1592 "Advertise capability to the peer\n"
1593 "Advertise dynamic capability to this neighbor\n")
1595 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DYNAMIC_CAPABILITY
);
1598 /* neighbor dont-capability-negotiate */
1599 DEFUN (neighbor_dont_capability_negotiate
,
1600 neighbor_dont_capability_negotiate_cmd
,
1601 NEIGHBOR_CMD2
"dont-capability-negotiate",
1604 "Do not perform capability negotiation\n")
1606 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1609 DEFUN (no_neighbor_dont_capability_negotiate
,
1610 no_neighbor_dont_capability_negotiate_cmd
,
1611 NO_NEIGHBOR_CMD2
"dont-capability-negotiate",
1615 "Do not perform capability negotiation\n")
1617 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_DONT_CAPABILITY
);
1621 peer_af_flag_modify_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1622 safi_t safi
, u_int16_t flag
, int set
)
1627 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
1632 ret
= peer_af_flag_set (peer
, afi
, safi
, flag
);
1634 ret
= peer_af_flag_unset (peer
, afi
, safi
, flag
);
1636 return bgp_vty_return (vty
, ret
);
1640 peer_af_flag_set_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1641 safi_t safi
, u_int16_t flag
)
1643 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 1);
1647 peer_af_flag_unset_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
1648 safi_t safi
, u_int16_t flag
)
1650 return peer_af_flag_modify_vty (vty
, peer_str
, afi
, safi
, flag
, 0);
1653 /* neighbor capability orf prefix-list. */
1654 DEFUN (neighbor_capability_orf_prefix
,
1655 neighbor_capability_orf_prefix_cmd
,
1656 NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1659 "Advertise capability to the peer\n"
1660 "Advertise ORF capability to the peer\n"
1661 "Advertise prefixlist ORF capability to this neighbor\n"
1662 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1663 "Capability to RECEIVE the ORF from this neighbor\n"
1664 "Capability to SEND the ORF to this neighbor\n")
1668 if (strncmp (argv
[1], "s", 1) == 0)
1669 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1670 else if (strncmp (argv
[1], "r", 1) == 0)
1671 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1672 else if (strncmp (argv
[1], "b", 1) == 0)
1673 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1677 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1678 bgp_node_safi (vty
), flag
);
1681 DEFUN (no_neighbor_capability_orf_prefix
,
1682 no_neighbor_capability_orf_prefix_cmd
,
1683 NO_NEIGHBOR_CMD2
"capability orf prefix-list (both|send|receive)",
1687 "Advertise capability to the peer\n"
1688 "Advertise ORF capability to the peer\n"
1689 "Advertise prefixlist ORF capability to this neighbor\n"
1690 "Capability to SEND and RECEIVE the ORF to/from this neighbor\n"
1691 "Capability to RECEIVE the ORF from this neighbor\n"
1692 "Capability to SEND the ORF to this neighbor\n")
1696 if (strncmp (argv
[1], "s", 1) == 0)
1697 flag
= PEER_FLAG_ORF_PREFIX_SM
;
1698 else if (strncmp (argv
[1], "r", 1) == 0)
1699 flag
= PEER_FLAG_ORF_PREFIX_RM
;
1700 else if (strncmp (argv
[1], "b", 1) == 0)
1701 flag
= PEER_FLAG_ORF_PREFIX_SM
|PEER_FLAG_ORF_PREFIX_RM
;
1705 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1706 bgp_node_safi (vty
), flag
);
1709 /* neighbor next-hop-self. */
1710 DEFUN (neighbor_nexthop_self
,
1711 neighbor_nexthop_self_cmd
,
1712 NEIGHBOR_CMD2
"next-hop-self",
1715 "Disable the next hop calculation for this neighbor\n")
1717 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1718 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1721 DEFUN (no_neighbor_nexthop_self
,
1722 no_neighbor_nexthop_self_cmd
,
1723 NO_NEIGHBOR_CMD2
"next-hop-self",
1727 "Disable the next hop calculation for this neighbor\n")
1729 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1730 bgp_node_safi (vty
), PEER_FLAG_NEXTHOP_SELF
);
1733 /* neighbor remove-private-AS. */
1734 DEFUN (neighbor_remove_private_as
,
1735 neighbor_remove_private_as_cmd
,
1736 NEIGHBOR_CMD2
"remove-private-AS",
1739 "Remove private AS number from outbound updates\n")
1741 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1742 bgp_node_safi (vty
),
1743 PEER_FLAG_REMOVE_PRIVATE_AS
);
1746 DEFUN (no_neighbor_remove_private_as
,
1747 no_neighbor_remove_private_as_cmd
,
1748 NO_NEIGHBOR_CMD2
"remove-private-AS",
1752 "Remove private AS number from outbound updates\n")
1754 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1755 bgp_node_safi (vty
),
1756 PEER_FLAG_REMOVE_PRIVATE_AS
);
1759 /* neighbor send-community. */
1760 DEFUN (neighbor_send_community
,
1761 neighbor_send_community_cmd
,
1762 NEIGHBOR_CMD2
"send-community",
1765 "Send Community attribute to this neighbor\n")
1767 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1768 bgp_node_safi (vty
),
1769 PEER_FLAG_SEND_COMMUNITY
);
1772 DEFUN (no_neighbor_send_community
,
1773 no_neighbor_send_community_cmd
,
1774 NO_NEIGHBOR_CMD2
"send-community",
1778 "Send Community attribute to this neighbor\n")
1780 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1781 bgp_node_safi (vty
),
1782 PEER_FLAG_SEND_COMMUNITY
);
1785 /* neighbor send-community extended. */
1786 DEFUN (neighbor_send_community_type
,
1787 neighbor_send_community_type_cmd
,
1788 NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1791 "Send Community attribute to this neighbor\n"
1792 "Send Standard and Extended Community attributes\n"
1793 "Send Extended Community attributes\n"
1794 "Send Standard Community attributes\n")
1796 if (strncmp (argv
[1], "s", 1) == 0)
1797 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1798 bgp_node_safi (vty
),
1799 PEER_FLAG_SEND_COMMUNITY
);
1800 if (strncmp (argv
[1], "e", 1) == 0)
1801 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1802 bgp_node_safi (vty
),
1803 PEER_FLAG_SEND_EXT_COMMUNITY
);
1805 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1806 bgp_node_safi (vty
),
1807 (PEER_FLAG_SEND_COMMUNITY
|
1808 PEER_FLAG_SEND_EXT_COMMUNITY
));
1811 DEFUN (no_neighbor_send_community_type
,
1812 no_neighbor_send_community_type_cmd
,
1813 NO_NEIGHBOR_CMD2
"send-community (both|extended|standard)",
1817 "Send Community attribute to this neighbor\n"
1818 "Send Standard and Extended Community attributes\n"
1819 "Send Extended Community attributes\n"
1820 "Send Standard Community attributes\n")
1822 if (strncmp (argv
[1], "s", 1) == 0)
1823 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1824 bgp_node_safi (vty
),
1825 PEER_FLAG_SEND_COMMUNITY
);
1826 if (strncmp (argv
[1], "e", 1) == 0)
1827 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1828 bgp_node_safi (vty
),
1829 PEER_FLAG_SEND_EXT_COMMUNITY
);
1831 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1832 bgp_node_safi (vty
),
1833 (PEER_FLAG_SEND_COMMUNITY
|
1834 PEER_FLAG_SEND_EXT_COMMUNITY
));
1837 /* neighbor soft-reconfig. */
1838 DEFUN (neighbor_soft_reconfiguration
,
1839 neighbor_soft_reconfiguration_cmd
,
1840 NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1843 "Per neighbor soft reconfiguration\n"
1844 "Allow inbound soft reconfiguration for this neighbor\n")
1846 return peer_af_flag_set_vty (vty
, argv
[0],
1847 bgp_node_afi (vty
), bgp_node_safi (vty
),
1848 PEER_FLAG_SOFT_RECONFIG
);
1851 DEFUN (no_neighbor_soft_reconfiguration
,
1852 no_neighbor_soft_reconfiguration_cmd
,
1853 NO_NEIGHBOR_CMD2
"soft-reconfiguration inbound",
1857 "Per neighbor soft reconfiguration\n"
1858 "Allow inbound soft reconfiguration for this neighbor\n")
1860 return peer_af_flag_unset_vty (vty
, argv
[0],
1861 bgp_node_afi (vty
), bgp_node_safi (vty
),
1862 PEER_FLAG_SOFT_RECONFIG
);
1865 DEFUN (neighbor_route_reflector_client
,
1866 neighbor_route_reflector_client_cmd
,
1867 NEIGHBOR_CMD2
"route-reflector-client",
1870 "Configure a neighbor as Route Reflector client\n")
1875 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
1879 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1880 bgp_node_safi (vty
),
1881 PEER_FLAG_REFLECTOR_CLIENT
);
1884 DEFUN (no_neighbor_route_reflector_client
,
1885 no_neighbor_route_reflector_client_cmd
,
1886 NO_NEIGHBOR_CMD2
"route-reflector-client",
1890 "Configure a neighbor as Route Reflector client\n")
1892 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1893 bgp_node_safi (vty
),
1894 PEER_FLAG_REFLECTOR_CLIENT
);
1897 /* neighbor route-server-client. */
1898 DEFUN (neighbor_route_server_client
,
1899 neighbor_route_server_client_cmd
,
1900 NEIGHBOR_CMD2
"route-server-client",
1903 "Configure a neighbor as Route Server client\n")
1905 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1906 bgp_node_safi (vty
),
1907 PEER_FLAG_RSERVER_CLIENT
);
1910 DEFUN (no_neighbor_route_server_client
,
1911 no_neighbor_route_server_client_cmd
,
1912 NO_NEIGHBOR_CMD2
"route-server-client",
1916 "Configure a neighbor as Route Server client\n")
1918 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
1919 bgp_node_safi (vty
),
1920 PEER_FLAG_RSERVER_CLIENT
);
1923 DEFUN (neighbor_attr_unchanged
,
1924 neighbor_attr_unchanged_cmd
,
1925 NEIGHBOR_CMD2
"attribute-unchanged",
1928 "BGP attribute is propagated unchanged to this neighbor\n")
1930 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1931 bgp_node_safi (vty
),
1932 (PEER_FLAG_AS_PATH_UNCHANGED
|
1933 PEER_FLAG_NEXTHOP_UNCHANGED
|
1934 PEER_FLAG_MED_UNCHANGED
));
1937 DEFUN (neighbor_attr_unchanged1
,
1938 neighbor_attr_unchanged1_cmd
,
1939 NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
1942 "BGP attribute is propagated unchanged to this neighbor\n"
1943 "As-path attribute\n"
1944 "Nexthop attribute\n"
1947 u_int16_t flags
= 0;
1949 if (strncmp (argv
[1], "as-path", 1) == 0)
1950 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
1951 else if (strncmp (argv
[1], "next-hop", 1) == 0)
1952 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
1953 else if (strncmp (argv
[1], "med", 1) == 0)
1954 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
1956 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1957 bgp_node_safi (vty
), flags
);
1960 DEFUN (neighbor_attr_unchanged2
,
1961 neighbor_attr_unchanged2_cmd
,
1962 NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
1965 "BGP attribute is propagated unchanged to this neighbor\n"
1966 "As-path attribute\n"
1967 "Nexthop attribute\n"
1970 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
1972 if (strncmp (argv
[1], "next-hop", 1) == 0)
1973 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
1974 else if (strncmp (argv
[1], "med", 1) == 0)
1975 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
1977 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
1978 bgp_node_safi (vty
), flags
);
1982 DEFUN (neighbor_attr_unchanged3
,
1983 neighbor_attr_unchanged3_cmd
,
1984 NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
1987 "BGP attribute is propagated unchanged to this neighbor\n"
1988 "Nexthop attribute\n"
1989 "As-path attribute\n"
1992 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
1994 if (strncmp (argv
[1], "as-path", 1) == 0)
1995 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
1996 else if (strncmp (argv
[1], "med", 1) == 0)
1997 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
1999 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2000 bgp_node_safi (vty
), flags
);
2003 DEFUN (neighbor_attr_unchanged4
,
2004 neighbor_attr_unchanged4_cmd
,
2005 NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2008 "BGP attribute is propagated unchanged to this neighbor\n"
2010 "As-path attribute\n"
2011 "Nexthop attribute\n")
2013 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2015 if (strncmp (argv
[1], "as-path", 1) == 0)
2016 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2017 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2018 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2020 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2021 bgp_node_safi (vty
), flags
);
2024 ALIAS (neighbor_attr_unchanged
,
2025 neighbor_attr_unchanged5_cmd
,
2026 NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2029 "BGP attribute is propagated unchanged to this neighbor\n"
2030 "As-path attribute\n"
2031 "Nexthop attribute\n"
2034 ALIAS (neighbor_attr_unchanged
,
2035 neighbor_attr_unchanged6_cmd
,
2036 NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2039 "BGP attribute is propagated unchanged to this neighbor\n"
2040 "As-path attribute\n"
2042 "Nexthop attribute\n")
2044 ALIAS (neighbor_attr_unchanged
,
2045 neighbor_attr_unchanged7_cmd
,
2046 NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2049 "BGP attribute is propagated unchanged to this neighbor\n"
2050 "Nexthop attribute\n"
2052 "As-path attribute\n")
2054 ALIAS (neighbor_attr_unchanged
,
2055 neighbor_attr_unchanged8_cmd
,
2056 NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2059 "BGP attribute is propagated unchanged to this neighbor\n"
2060 "Nexthop attribute\n"
2061 "As-path attribute\n"
2064 ALIAS (neighbor_attr_unchanged
,
2065 neighbor_attr_unchanged9_cmd
,
2066 NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2069 "BGP attribute is propagated unchanged to this neighbor\n"
2071 "Nexthop attribute\n"
2072 "As-path attribute\n")
2074 ALIAS (neighbor_attr_unchanged
,
2075 neighbor_attr_unchanged10_cmd
,
2076 NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2079 "BGP attribute is propagated unchanged to this neighbor\n"
2081 "As-path attribute\n"
2082 "Nexthop attribute\n")
2084 DEFUN (no_neighbor_attr_unchanged
,
2085 no_neighbor_attr_unchanged_cmd
,
2086 NO_NEIGHBOR_CMD2
"attribute-unchanged",
2090 "BGP attribute is propagated unchanged to this neighbor\n")
2092 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2093 bgp_node_safi (vty
),
2094 (PEER_FLAG_AS_PATH_UNCHANGED
|
2095 PEER_FLAG_NEXTHOP_UNCHANGED
|
2096 PEER_FLAG_MED_UNCHANGED
));
2099 DEFUN (no_neighbor_attr_unchanged1
,
2100 no_neighbor_attr_unchanged1_cmd
,
2101 NO_NEIGHBOR_CMD2
"attribute-unchanged (as-path|next-hop|med)",
2105 "BGP attribute is propagated unchanged to this neighbor\n"
2106 "As-path attribute\n"
2107 "Nexthop attribute\n"
2110 u_int16_t flags
= 0;
2112 if (strncmp (argv
[1], "as-path", 1) == 0)
2113 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2114 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2115 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2116 else if (strncmp (argv
[1], "med", 1) == 0)
2117 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2119 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2120 bgp_node_safi (vty
), flags
);
2123 DEFUN (no_neighbor_attr_unchanged2
,
2124 no_neighbor_attr_unchanged2_cmd
,
2125 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path (next-hop|med)",
2129 "BGP attribute is propagated unchanged to this neighbor\n"
2130 "As-path attribute\n"
2131 "Nexthop attribute\n"
2134 u_int16_t flags
= PEER_FLAG_AS_PATH_UNCHANGED
;
2136 if (strncmp (argv
[1], "next-hop", 1) == 0)
2137 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2138 else if (strncmp (argv
[1], "med", 1) == 0)
2139 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2141 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2142 bgp_node_safi (vty
), flags
);
2145 DEFUN (no_neighbor_attr_unchanged3
,
2146 no_neighbor_attr_unchanged3_cmd
,
2147 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop (as-path|med)",
2151 "BGP attribute is propagated unchanged to this neighbor\n"
2152 "Nexthop attribute\n"
2153 "As-path attribute\n"
2156 u_int16_t flags
= PEER_FLAG_NEXTHOP_UNCHANGED
;
2158 if (strncmp (argv
[1], "as-path", 1) == 0)
2159 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2160 else if (strncmp (argv
[1], "med", 1) == 0)
2161 SET_FLAG (flags
, PEER_FLAG_MED_UNCHANGED
);
2163 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2164 bgp_node_safi (vty
), flags
);
2167 DEFUN (no_neighbor_attr_unchanged4
,
2168 no_neighbor_attr_unchanged4_cmd
,
2169 NO_NEIGHBOR_CMD2
"attribute-unchanged med (as-path|next-hop)",
2173 "BGP attribute is propagated unchanged to this neighbor\n"
2175 "As-path attribute\n"
2176 "Nexthop attribute\n")
2178 u_int16_t flags
= PEER_FLAG_MED_UNCHANGED
;
2180 if (strncmp (argv
[1], "as-path", 1) == 0)
2181 SET_FLAG (flags
, PEER_FLAG_AS_PATH_UNCHANGED
);
2182 else if (strncmp (argv
[1], "next-hop", 1) == 0)
2183 SET_FLAG (flags
, PEER_FLAG_NEXTHOP_UNCHANGED
);
2185 return peer_af_flag_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
2186 bgp_node_safi (vty
), flags
);
2189 ALIAS (no_neighbor_attr_unchanged
,
2190 no_neighbor_attr_unchanged5_cmd
,
2191 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path next-hop med",
2195 "BGP attribute is propagated unchanged to this neighbor\n"
2196 "As-path attribute\n"
2197 "Nexthop attribute\n"
2200 ALIAS (no_neighbor_attr_unchanged
,
2201 no_neighbor_attr_unchanged6_cmd
,
2202 NO_NEIGHBOR_CMD2
"attribute-unchanged as-path med next-hop",
2206 "BGP attribute is propagated unchanged to this neighbor\n"
2207 "As-path attribute\n"
2209 "Nexthop attribute\n")
2211 ALIAS (no_neighbor_attr_unchanged
,
2212 no_neighbor_attr_unchanged7_cmd
,
2213 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop med as-path",
2217 "BGP attribute is propagated unchanged to this neighbor\n"
2218 "Nexthop attribute\n"
2220 "As-path attribute\n")
2222 ALIAS (no_neighbor_attr_unchanged
,
2223 no_neighbor_attr_unchanged8_cmd
,
2224 NO_NEIGHBOR_CMD2
"attribute-unchanged next-hop as-path med",
2228 "BGP attribute is propagated unchanged to this neighbor\n"
2229 "Nexthop attribute\n"
2230 "As-path attribute\n"
2233 ALIAS (no_neighbor_attr_unchanged
,
2234 no_neighbor_attr_unchanged9_cmd
,
2235 NO_NEIGHBOR_CMD2
"attribute-unchanged med next-hop as-path",
2239 "BGP attribute is propagated unchanged to this neighbor\n"
2241 "Nexthop attribute\n"
2242 "As-path attribute\n")
2244 ALIAS (no_neighbor_attr_unchanged
,
2245 no_neighbor_attr_unchanged10_cmd
,
2246 NO_NEIGHBOR_CMD2
"attribute-unchanged med as-path next-hop",
2250 "BGP attribute is propagated unchanged to this neighbor\n"
2252 "As-path attribute\n"
2253 "Nexthop attribute\n")
2255 /* For old version Zebra compatibility. */
2256 DEFUN (neighbor_transparent_as
,
2257 neighbor_transparent_as_cmd
,
2258 NEIGHBOR_CMD
"transparent-as",
2261 "Do not append my AS number even peer is EBGP peer\n")
2263 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2264 bgp_node_safi (vty
),
2265 PEER_FLAG_AS_PATH_UNCHANGED
);
2268 DEFUN (neighbor_transparent_nexthop
,
2269 neighbor_transparent_nexthop_cmd
,
2270 NEIGHBOR_CMD
"transparent-nexthop",
2273 "Do not change nexthop even peer is EBGP peer\n")
2275 return peer_af_flag_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2276 bgp_node_safi (vty
),
2277 PEER_FLAG_NEXTHOP_UNCHANGED
);
2280 /* EBGP multihop configuration. */
2282 peer_ebgp_multihop_set_vty (struct vty
*vty
, char *ip_str
, char *ttl_str
)
2287 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2294 VTY_GET_INTEGER_RANGE ("TTL", ttl
, ttl_str
, 1, 255);
2296 peer_ebgp_multihop_set (peer
, ttl
);
2302 peer_ebgp_multihop_unset_vty (struct vty
*vty
, char *ip_str
)
2306 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2310 peer_ebgp_multihop_unset (peer
);
2315 /* neighbor ebgp-multihop. */
2316 DEFUN (neighbor_ebgp_multihop
,
2317 neighbor_ebgp_multihop_cmd
,
2318 NEIGHBOR_CMD2
"ebgp-multihop",
2321 "Allow EBGP neighbors not on directly connected networks\n")
2323 return peer_ebgp_multihop_set_vty (vty
, argv
[0], NULL
);
2326 DEFUN (neighbor_ebgp_multihop_ttl
,
2327 neighbor_ebgp_multihop_ttl_cmd
,
2328 NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2331 "Allow EBGP neighbors not on directly connected networks\n"
2332 "maximum hop count\n")
2334 return peer_ebgp_multihop_set_vty (vty
, argv
[0], argv
[1]);
2337 DEFUN (no_neighbor_ebgp_multihop
,
2338 no_neighbor_ebgp_multihop_cmd
,
2339 NO_NEIGHBOR_CMD2
"ebgp-multihop",
2343 "Allow EBGP neighbors not on directly connected networks\n")
2345 return peer_ebgp_multihop_unset_vty (vty
, argv
[0]);
2348 ALIAS (no_neighbor_ebgp_multihop
,
2349 no_neighbor_ebgp_multihop_ttl_cmd
,
2350 NO_NEIGHBOR_CMD2
"ebgp-multihop <1-255>",
2354 "Allow EBGP neighbors not on directly connected networks\n"
2355 "maximum hop count\n")
2357 /* Enforce multihop. */
2358 DEFUN (neighbor_enforce_multihop
,
2359 neighbor_enforce_multihop_cmd
,
2360 NEIGHBOR_CMD2
"enforce-multihop",
2363 "Enforce EBGP neighbors perform multihop\n")
2365 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_ENFORCE_MULTIHOP
);
2368 DEFUN (no_neighbor_enforce_multihop
,
2369 no_neighbor_enforce_multihop_cmd
,
2370 NO_NEIGHBOR_CMD2
"enforce-multihop",
2374 "Enforce EBGP neighbors perform multihop\n")
2376 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_ENFORCE_MULTIHOP
);
2379 DEFUN (neighbor_description
,
2380 neighbor_description_cmd
,
2381 NEIGHBOR_CMD2
"description .LINE",
2384 "Neighbor specific description\n"
2385 "Up to 80 characters describing this neighbor\n")
2392 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2399 /* Make string from buffer. This function should be provided by
2401 b
= buffer_new (1024);
2402 for (i
= 1; i
< argc
; i
++)
2404 buffer_putstr (b
, (u_char
*)argv
[i
]);
2405 buffer_putc (b
, ' ');
2407 buffer_putc (b
, '\0');
2408 str
= buffer_getstr (b
);
2411 peer_description_set (peer
, str
);
2418 DEFUN (no_neighbor_description
,
2419 no_neighbor_description_cmd
,
2420 NO_NEIGHBOR_CMD2
"description",
2424 "Neighbor specific description\n")
2428 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
2432 peer_description_unset (peer
);
2437 ALIAS (no_neighbor_description
,
2438 no_neighbor_description_val_cmd
,
2439 NO_NEIGHBOR_CMD2
"description .LINE",
2443 "Neighbor specific description\n"
2444 "Up to 80 characters describing this neighbor\n")
2446 /* Neighbor update-source. */
2448 peer_update_source_vty (struct vty
*vty
, char *peer_str
, char *source_str
)
2451 union sockunion
*su
;
2453 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2459 su
= sockunion_str2su (source_str
);
2462 peer_update_source_addr_set (peer
, su
);
2463 sockunion_free (su
);
2466 peer_update_source_if_set (peer
, source_str
);
2469 peer_update_source_unset (peer
);
2474 DEFUN (neighbor_update_source
,
2475 neighbor_update_source_cmd
,
2476 NEIGHBOR_CMD2
"update-source WORD",
2479 "Source of routing updates\n"
2482 return peer_update_source_vty (vty
, argv
[0], argv
[1]);
2485 DEFUN (no_neighbor_update_source
,
2486 no_neighbor_update_source_cmd
,
2487 NO_NEIGHBOR_CMD2
"update-source",
2491 "Source of routing updates\n"
2494 return peer_update_source_vty (vty
, argv
[0], NULL
);
2498 peer_default_originate_set_vty (struct vty
*vty
, char *peer_str
, afi_t afi
,
2499 safi_t safi
, char *rmap
, int set
)
2504 peer
= peer_and_group_lookup_vty (vty
, peer_str
);
2509 ret
= peer_default_originate_set (peer
, afi
, safi
, rmap
);
2511 ret
= peer_default_originate_unset (peer
, afi
, safi
);
2513 return bgp_vty_return (vty
, ret
);
2516 /* neighbor default-originate. */
2517 DEFUN (neighbor_default_originate
,
2518 neighbor_default_originate_cmd
,
2519 NEIGHBOR_CMD2
"default-originate",
2522 "Originate default route to this neighbor\n")
2524 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2525 bgp_node_safi (vty
), NULL
, 1);
2528 DEFUN (neighbor_default_originate_rmap
,
2529 neighbor_default_originate_rmap_cmd
,
2530 NEIGHBOR_CMD2
"default-originate route-map WORD",
2533 "Originate default route to this neighbor\n"
2534 "Route-map to specify criteria to originate default\n"
2537 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2538 bgp_node_safi (vty
), argv
[1], 1);
2541 DEFUN (no_neighbor_default_originate
,
2542 no_neighbor_default_originate_cmd
,
2543 NO_NEIGHBOR_CMD2
"default-originate",
2547 "Originate default route to this neighbor\n")
2549 return peer_default_originate_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
2550 bgp_node_safi (vty
), NULL
, 0);
2553 ALIAS (no_neighbor_default_originate
,
2554 no_neighbor_default_originate_rmap_cmd
,
2555 NO_NEIGHBOR_CMD2
"default-originate route-map WORD",
2559 "Originate default route to this neighbor\n"
2560 "Route-map to specify criteria to originate default\n"
2563 /* Set neighbor's BGP port. */
2565 peer_port_vty (struct vty
*vty
, char *ip_str
, int afi
, char *port_str
)
2571 peer
= peer_lookup_vty (vty
, ip_str
);
2577 sp
= getservbyname ("bgp", "tcp");
2578 port
= (sp
== NULL
) ? BGP_PORT_DEFAULT
: ntohs (sp
->s_port
);
2582 VTY_GET_INTEGER("port", port
, port_str
);
2585 peer_port_set (peer
, port
);
2590 /* Set specified peer's BGP version. */
2591 DEFUN (neighbor_port
,
2593 NEIGHBOR_CMD
"port <0-65535>",
2596 "Neighbor's BGP port\n"
2597 "TCP port number\n")
2599 return peer_port_vty (vty
, argv
[0], AFI_IP
, argv
[1]);
2602 DEFUN (no_neighbor_port
,
2603 no_neighbor_port_cmd
,
2604 NO_NEIGHBOR_CMD
"port",
2608 "Neighbor's BGP port\n")
2610 return peer_port_vty (vty
, argv
[0], AFI_IP
, NULL
);
2613 ALIAS (no_neighbor_port
,
2614 no_neighbor_port_val_cmd
,
2615 NO_NEIGHBOR_CMD
"port <0-65535>",
2619 "Neighbor's BGP port\n"
2620 "TCP port number\n")
2622 /* neighbor weight. */
2624 peer_weight_set_vty (struct vty
*vty
, char *ip_str
, char *weight_str
)
2628 unsigned long weight
;
2630 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2634 VTY_GET_INTEGER_RANGE("weight", weight
, weight_str
, 0, 65535);
2636 ret
= peer_weight_set (peer
, weight
);
2642 peer_weight_unset_vty (struct vty
*vty
, char *ip_str
)
2646 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2650 peer_weight_unset (peer
);
2655 DEFUN (neighbor_weight
,
2656 neighbor_weight_cmd
,
2657 NEIGHBOR_CMD2
"weight <0-65535>",
2660 "Set default weight for routes from this neighbor\n"
2663 return peer_weight_set_vty (vty
, argv
[0], argv
[1]);
2666 DEFUN (no_neighbor_weight
,
2667 no_neighbor_weight_cmd
,
2668 NO_NEIGHBOR_CMD2
"weight",
2672 "Set default weight for routes from this neighbor\n")
2674 return peer_weight_unset_vty (vty
, argv
[0]);
2677 ALIAS (no_neighbor_weight
,
2678 no_neighbor_weight_val_cmd
,
2679 NO_NEIGHBOR_CMD2
"weight <0-65535>",
2683 "Set default weight for routes from this neighbor\n"
2686 /* Override capability negotiation. */
2687 DEFUN (neighbor_override_capability
,
2688 neighbor_override_capability_cmd
,
2689 NEIGHBOR_CMD2
"override-capability",
2692 "Override capability negotiation result\n")
2694 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
2697 DEFUN (no_neighbor_override_capability
,
2698 no_neighbor_override_capability_cmd
,
2699 NO_NEIGHBOR_CMD2
"override-capability",
2703 "Override capability negotiation result\n")
2705 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_OVERRIDE_CAPABILITY
);
2708 DEFUN (neighbor_strict_capability
,
2709 neighbor_strict_capability_cmd
,
2710 NEIGHBOR_CMD
"strict-capability-match",
2713 "Strict capability negotiation match\n")
2715 return peer_flag_set_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
2718 DEFUN (no_neighbor_strict_capability
,
2719 no_neighbor_strict_capability_cmd
,
2720 NO_NEIGHBOR_CMD
"strict-capability-match",
2724 "Strict capability negotiation match\n")
2726 return peer_flag_unset_vty (vty
, argv
[0], PEER_FLAG_STRICT_CAP_MATCH
);
2730 peer_timers_set_vty (struct vty
*vty
, char *ip_str
, char *keep_str
,
2735 u_int32_t keepalive
;
2738 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2742 VTY_GET_INTEGER_RANGE ("Keepalive", keepalive
, keep_str
, 0, 65535);
2743 VTY_GET_INTEGER_RANGE ("Holdtime", holdtime
, hold_str
, 0, 65535);
2745 ret
= peer_timers_set (peer
, keepalive
, holdtime
);
2747 return bgp_vty_return (vty
, ret
);
2751 peer_timers_unset_vty (struct vty
*vty
, char *ip_str
)
2756 peer
= peer_lookup_vty (vty
, ip_str
);
2760 ret
= peer_timers_unset (peer
);
2762 return bgp_vty_return (vty
, ret
);
2765 DEFUN (neighbor_timers
,
2766 neighbor_timers_cmd
,
2767 NEIGHBOR_CMD2
"timers <0-65535> <0-65535>",
2770 "BGP per neighbor timers\n"
2771 "Keepalive interval\n"
2774 return peer_timers_set_vty (vty
, argv
[0], argv
[1], argv
[2]);
2777 DEFUN (no_neighbor_timers
,
2778 no_neighbor_timers_cmd
,
2779 NO_NEIGHBOR_CMD2
"timers",
2783 "BGP per neighbor timers\n")
2785 return peer_timers_unset_vty (vty
, argv
[0]);
2789 peer_timers_connect_set_vty (struct vty
*vty
, char *ip_str
, char *time_str
)
2795 peer
= peer_lookup_vty (vty
, ip_str
);
2799 VTY_GET_INTEGER_RANGE ("Connect time", connect
, time_str
, 0, 65535);
2801 ret
= peer_timers_connect_set (peer
, connect
);
2807 peer_timers_connect_unset_vty (struct vty
*vty
, char *ip_str
)
2812 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
2816 ret
= peer_timers_connect_unset (peer
);
2821 DEFUN (neighbor_timers_connect
,
2822 neighbor_timers_connect_cmd
,
2823 NEIGHBOR_CMD
"timers connect <0-65535>",
2826 "BGP per neighbor timers\n"
2827 "BGP connect timer\n"
2830 return peer_timers_connect_set_vty (vty
, argv
[0], argv
[1]);
2833 DEFUN (no_neighbor_timers_connect
,
2834 no_neighbor_timers_connect_cmd
,
2835 NO_NEIGHBOR_CMD
"timers connect",
2839 "BGP per neighbor timers\n"
2840 "BGP connect timer\n")
2842 return peer_timers_connect_unset_vty (vty
, argv
[0]);
2845 ALIAS (no_neighbor_timers_connect
,
2846 no_neighbor_timers_connect_val_cmd
,
2847 NO_NEIGHBOR_CMD
"timers connect <0-65535>",
2851 "BGP per neighbor timers\n"
2852 "BGP connect timer\n"
2856 peer_advertise_interval_vty (struct vty
*vty
, char *ip_str
, char *time_str
,
2861 u_int32_t routeadv
= 0;
2863 peer
= peer_lookup_vty (vty
, ip_str
);
2868 VTY_GET_INTEGER_RANGE ("advertise interval", routeadv
, time_str
, 0, 600);
2871 ret
= peer_advertise_interval_set (peer
, routeadv
);
2873 ret
= peer_advertise_interval_unset (peer
);
2878 DEFUN (neighbor_advertise_interval
,
2879 neighbor_advertise_interval_cmd
,
2880 NEIGHBOR_CMD
"advertisement-interval <0-600>",
2883 "Minimum interval between sending BGP routing updates\n"
2884 "time in seconds\n")
2886 return peer_advertise_interval_vty (vty
, argv
[0], argv
[1], 1);
2889 DEFUN (no_neighbor_advertise_interval
,
2890 no_neighbor_advertise_interval_cmd
,
2891 NO_NEIGHBOR_CMD
"advertisement-interval",
2895 "Minimum interval between sending BGP routing updates\n")
2897 return peer_advertise_interval_vty (vty
, argv
[0], NULL
, 0);
2900 ALIAS (no_neighbor_advertise_interval
,
2901 no_neighbor_advertise_interval_val_cmd
,
2902 NO_NEIGHBOR_CMD
"advertisement-interval <0-600>",
2906 "Minimum interval between sending BGP routing updates\n"
2907 "time in seconds\n")
2910 peer_version_vty (struct vty
*vty
, char *ip_str
, char *str
)
2914 int version
= BGP_VERSION_4
;
2916 peer
= peer_lookup_vty (vty
, ip_str
);
2920 /* BGP version string check. */
2923 if (strcmp (str
, "4") == 0)
2924 version
= BGP_VERSION_4
;
2925 else if (strcmp (str
, "4-") == 0)
2926 version
= BGP_VERSION_MP_4_DRAFT_00
;
2928 ret
= peer_version_set (peer
, version
);
2931 ret
= peer_version_unset (peer
);
2936 DEFUN (neighbor_version
,
2937 neighbor_version_cmd
,
2938 NEIGHBOR_CMD
"version (4|4-)",
2941 "Neighbor's BGP version\n"
2942 "Border Gateway Protocol 4\n"
2943 "Multiprotocol Extensions for BGP-4(Old Draft)\n")
2945 return peer_version_vty (vty
, argv
[0], argv
[1]);
2948 DEFUN (no_neighbor_version
,
2949 no_neighbor_version_cmd
,
2950 NO_NEIGHBOR_CMD
"version",
2954 "Neighbor's BGP version\n")
2956 return peer_version_vty (vty
, argv
[0], NULL
);
2959 /* neighbor interface */
2961 peer_interface_vty (struct vty
*vty
, char *ip_str
, char *str
)
2966 peer
= peer_lookup_vty (vty
, ip_str
);
2971 ret
= peer_interface_set (peer
, str
);
2973 ret
= peer_interface_unset (peer
);
2978 DEFUN (neighbor_interface
,
2979 neighbor_interface_cmd
,
2980 NEIGHBOR_CMD
"interface WORD",
2986 return peer_interface_vty (vty
, argv
[0], argv
[1]);
2989 DEFUN (no_neighbor_interface
,
2990 no_neighbor_interface_cmd
,
2991 NO_NEIGHBOR_CMD
"interface WORD",
2998 return peer_interface_vty (vty
, argv
[0], NULL
);
3001 /* Set distribute list to the peer. */
3003 peer_distribute_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3004 char *name_str
, char *direct_str
)
3008 int direct
= FILTER_IN
;
3010 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3014 /* Check filter direction. */
3015 if (strncmp (direct_str
, "i", 1) == 0)
3017 else if (strncmp (direct_str
, "o", 1) == 0)
3018 direct
= FILTER_OUT
;
3020 ret
= peer_distribute_set (peer
, afi
, safi
, direct
, name_str
);
3022 return bgp_vty_return (vty
, ret
);
3026 peer_distribute_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3027 safi_t safi
, char *direct_str
)
3031 int direct
= FILTER_IN
;
3033 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3037 /* Check filter direction. */
3038 if (strncmp (direct_str
, "i", 1) == 0)
3040 else if (strncmp (direct_str
, "o", 1) == 0)
3041 direct
= FILTER_OUT
;
3043 ret
= peer_distribute_unset (peer
, afi
, safi
, direct
);
3045 return bgp_vty_return (vty
, ret
);
3048 DEFUN (neighbor_distribute_list
,
3049 neighbor_distribute_list_cmd
,
3050 NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3053 "Filter updates to/from this neighbor\n"
3054 "IP access-list number\n"
3055 "IP access-list number (expanded range)\n"
3056 "IP Access-list name\n"
3057 "Filter incoming updates\n"
3058 "Filter outgoing updates\n")
3060 return peer_distribute_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3061 bgp_node_safi (vty
), argv
[1], argv
[2]);
3064 DEFUN (no_neighbor_distribute_list
,
3065 no_neighbor_distribute_list_cmd
,
3066 NO_NEIGHBOR_CMD2
"distribute-list (<1-199>|<1300-2699>|WORD) (in|out)",
3070 "Filter updates to/from this neighbor\n"
3071 "IP access-list number\n"
3072 "IP access-list number (expanded range)\n"
3073 "IP Access-list name\n"
3074 "Filter incoming updates\n"
3075 "Filter outgoing updates\n")
3077 return peer_distribute_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3078 bgp_node_safi (vty
), argv
[2]);
3081 /* Set prefix list to the peer. */
3083 peer_prefix_list_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3084 safi_t safi
, char *name_str
, char *direct_str
)
3088 int direct
= FILTER_IN
;
3090 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3094 /* Check filter direction. */
3095 if (strncmp (direct_str
, "i", 1) == 0)
3097 else if (strncmp (direct_str
, "o", 1) == 0)
3098 direct
= FILTER_OUT
;
3100 ret
= peer_prefix_list_set (peer
, afi
, safi
, direct
, name_str
);
3102 return bgp_vty_return (vty
, ret
);
3106 peer_prefix_list_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3107 safi_t safi
, char *direct_str
)
3111 int direct
= FILTER_IN
;
3113 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3117 /* Check filter direction. */
3118 if (strncmp (direct_str
, "i", 1) == 0)
3120 else if (strncmp (direct_str
, "o", 1) == 0)
3121 direct
= FILTER_OUT
;
3123 ret
= peer_prefix_list_unset (peer
, afi
, safi
, direct
);
3125 return bgp_vty_return (vty
, ret
);
3128 DEFUN (neighbor_prefix_list
,
3129 neighbor_prefix_list_cmd
,
3130 NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3133 "Filter updates to/from this neighbor\n"
3134 "Name of a prefix list\n"
3135 "Filter incoming updates\n"
3136 "Filter outgoing updates\n")
3138 return peer_prefix_list_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3139 bgp_node_safi (vty
), argv
[1], argv
[2]);
3142 DEFUN (no_neighbor_prefix_list
,
3143 no_neighbor_prefix_list_cmd
,
3144 NO_NEIGHBOR_CMD2
"prefix-list WORD (in|out)",
3148 "Filter updates to/from this neighbor\n"
3149 "Name of a prefix list\n"
3150 "Filter incoming updates\n"
3151 "Filter outgoing updates\n")
3153 return peer_prefix_list_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3154 bgp_node_safi (vty
), argv
[2]);
3158 peer_aslist_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3159 char *name_str
, char *direct_str
)
3163 int direct
= FILTER_IN
;
3165 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3169 /* Check filter direction. */
3170 if (strncmp (direct_str
, "i", 1) == 0)
3172 else if (strncmp (direct_str
, "o", 1) == 0)
3173 direct
= FILTER_OUT
;
3175 ret
= peer_aslist_set (peer
, afi
, safi
, direct
, name_str
);
3177 return bgp_vty_return (vty
, ret
);
3181 peer_aslist_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3186 int direct
= FILTER_IN
;
3188 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3192 /* Check filter direction. */
3193 if (strncmp (direct_str
, "i", 1) == 0)
3195 else if (strncmp (direct_str
, "o", 1) == 0)
3196 direct
= FILTER_OUT
;
3198 ret
= peer_aslist_unset (peer
, afi
, safi
, direct
);
3200 return bgp_vty_return (vty
, ret
);
3203 DEFUN (neighbor_filter_list
,
3204 neighbor_filter_list_cmd
,
3205 NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3208 "Establish BGP filters\n"
3209 "AS path access-list name\n"
3210 "Filter incoming routes\n"
3211 "Filter outgoing routes\n")
3213 return peer_aslist_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3214 bgp_node_safi (vty
), argv
[1], argv
[2]);
3217 DEFUN (no_neighbor_filter_list
,
3218 no_neighbor_filter_list_cmd
,
3219 NO_NEIGHBOR_CMD2
"filter-list WORD (in|out)",
3223 "Establish BGP filters\n"
3224 "AS path access-list name\n"
3225 "Filter incoming routes\n"
3226 "Filter outgoing routes\n")
3228 return peer_aslist_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3229 bgp_node_safi (vty
), argv
[2]);
3232 /* Set route-map to the peer. */
3234 peer_route_map_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
, safi_t safi
,
3235 char *name_str
, char *direct_str
)
3239 int direct
= FILTER_IN
;
3241 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3245 /* Check filter direction. */
3246 if (strncmp (direct_str
, "i", 1) == 0)
3248 else if (strncmp (direct_str
, "o", 1) == 0)
3249 direct
= FILTER_OUT
;
3251 ret
= peer_route_map_set (peer
, afi
, safi
, direct
, name_str
);
3253 return bgp_vty_return (vty
, ret
);
3257 peer_route_map_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3258 safi_t safi
, char *direct_str
)
3262 int direct
= FILTER_IN
;
3264 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3268 /* Check filter direction. */
3269 if (strncmp (direct_str
, "i", 1) == 0)
3271 else if (strncmp (direct_str
, "o", 1) == 0)
3273 direct
= FILTER_OUT
;
3275 ret
= peer_route_map_unset (peer
, afi
, safi
, direct
);
3277 return bgp_vty_return (vty
, ret
);
3280 DEFUN (neighbor_route_map
,
3281 neighbor_route_map_cmd
,
3282 NEIGHBOR_CMD2
"route-map WORD (in|out)",
3285 "Apply route map to neighbor\n"
3286 "Name of route map\n"
3287 "Apply map to incoming routes\n"
3288 "Apply map to outbound routes\n")
3290 return peer_route_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3291 bgp_node_safi (vty
), argv
[1], argv
[2]);
3294 DEFUN (no_neighbor_route_map
,
3295 no_neighbor_route_map_cmd
,
3296 NO_NEIGHBOR_CMD2
"route-map WORD (in|out)",
3300 "Apply route map to neighbor\n"
3301 "Name of route map\n"
3302 "Apply map to incoming routes\n"
3303 "Apply map to outbound routes\n")
3305 return peer_route_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3306 bgp_node_safi (vty
), argv
[2]);
3309 /* Set unsuppress-map to the peer. */
3311 peer_unsuppress_map_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3312 safi_t safi
, char *name_str
)
3317 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3321 ret
= peer_unsuppress_map_set (peer
, afi
, safi
, name_str
);
3323 return bgp_vty_return (vty
, ret
);
3326 /* Unset route-map from the peer. */
3328 peer_unsuppress_map_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3334 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3338 ret
= peer_unsuppress_map_unset (peer
, afi
, safi
);
3340 return bgp_vty_return (vty
, ret
);
3343 DEFUN (neighbor_unsuppress_map
,
3344 neighbor_unsuppress_map_cmd
,
3345 NEIGHBOR_CMD2
"unsuppress-map WORD",
3348 "Route-map to selectively unsuppress suppressed routes\n"
3349 "Name of route map\n")
3351 return peer_unsuppress_map_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3352 bgp_node_safi (vty
), argv
[1]);
3355 DEFUN (no_neighbor_unsuppress_map
,
3356 no_neighbor_unsuppress_map_cmd
,
3357 NO_NEIGHBOR_CMD2
"unsuppress-map WORD",
3361 "Route-map to selectively unsuppress suppressed routes\n"
3362 "Name of route map\n")
3364 return peer_unsuppress_map_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3365 bgp_node_safi (vty
));
3369 peer_maximum_prefix_set_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3370 safi_t safi
, char *num_str
, int warning
)
3376 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3380 VTY_GET_INTEGER ("maxmum number", max
, num_str
);
3382 ret
= peer_maximum_prefix_set (peer
, afi
, safi
, max
, warning
);
3384 return bgp_vty_return (vty
, ret
);
3388 peer_maximum_prefix_unset_vty (struct vty
*vty
, char *ip_str
, afi_t afi
,
3394 peer
= peer_and_group_lookup_vty (vty
, ip_str
);
3398 ret
= peer_maximum_prefix_unset (peer
, afi
, safi
);
3400 return bgp_vty_return (vty
, ret
);
3403 /* Maximum number of prefix configuration. prefix count is different
3404 for each peer configuration. So this configuration can be set for
3405 each peer configuration. */
3406 DEFUN (neighbor_maximum_prefix
,
3407 neighbor_maximum_prefix_cmd
,
3408 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3411 "Maximum number of prefix accept from this peer\n"
3412 "maximum no. of prefix limit\n")
3414 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3415 bgp_node_safi (vty
), argv
[1], 0);
3418 DEFUN (neighbor_maximum_prefix_warning
,
3419 neighbor_maximum_prefix_warning_cmd
,
3420 NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3423 "Maximum number of prefix accept from this peer\n"
3424 "maximum no. of prefix limit\n"
3425 "Only give warning message when limit is exceeded\n")
3427 return peer_maximum_prefix_set_vty (vty
, argv
[0], bgp_node_afi (vty
),
3428 bgp_node_safi (vty
), argv
[1], 1);
3431 DEFUN (no_neighbor_maximum_prefix
,
3432 no_neighbor_maximum_prefix_cmd
,
3433 NO_NEIGHBOR_CMD2
"maximum-prefix",
3437 "Maximum number of prefix accept from this peer\n")
3439 return peer_maximum_prefix_unset_vty (vty
, argv
[0], bgp_node_afi (vty
),
3440 bgp_node_safi (vty
));
3443 ALIAS (no_neighbor_maximum_prefix
,
3444 no_neighbor_maximum_prefix_val_cmd
,
3445 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295>",
3449 "Maximum number of prefix accept from this peer\n"
3450 "maximum no. of prefix limit\n")
3452 ALIAS (no_neighbor_maximum_prefix
,
3453 no_neighbor_maximum_prefix_val2_cmd
,
3454 NO_NEIGHBOR_CMD2
"maximum-prefix <1-4294967295> warning-only",
3458 "Maximum number of prefix accept from this peer\n"
3459 "maximum no. of prefix limit\n"
3460 "Only give warning message when limit is exceeded\n")
3462 /* "neighbor allowas-in" */
3463 DEFUN (neighbor_allowas_in
,
3464 neighbor_allowas_in_cmd
,
3465 NEIGHBOR_CMD2
"allowas-in",
3468 "Accept as-path with my AS present in it\n")
3474 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3481 VTY_GET_INTEGER_RANGE ("AS number", allow_num
, argv
[1], 1, 10);
3483 ret
= peer_allowas_in_set (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
),
3486 return bgp_vty_return (vty
, ret
);
3489 ALIAS (neighbor_allowas_in
,
3490 neighbor_allowas_in_arg_cmd
,
3491 NEIGHBOR_CMD2
"allowas-in <1-10>",
3494 "Accept as-path with my AS present in it\n"
3495 "Number of occurances of AS number\n")
3497 DEFUN (no_neighbor_allowas_in
,
3498 no_neighbor_allowas_in_cmd
,
3499 NO_NEIGHBOR_CMD2
"allowas-in",
3503 "allow local ASN appears in aspath attribute\n")
3508 peer
= peer_and_group_lookup_vty (vty
, argv
[0]);
3512 ret
= peer_allowas_in_unset (peer
, bgp_node_afi (vty
), bgp_node_safi (vty
));
3514 return bgp_vty_return (vty
, ret
);
3517 /* Address family configuration. */
3518 DEFUN (address_family_ipv4
,
3519 address_family_ipv4_cmd
,
3520 "address-family ipv4",
3521 "Enter Address Family command mode\n"
3524 vty
->node
= BGP_IPV4_NODE
;
3528 DEFUN (address_family_ipv4_safi
,
3529 address_family_ipv4_safi_cmd
,
3530 "address-family ipv4 (unicast|multicast)",
3531 "Enter Address Family command mode\n"
3533 "Address Family modifier\n"
3534 "Address Family modifier\n")
3536 if (strncmp (argv
[0], "m", 1) == 0)
3537 vty
->node
= BGP_IPV4M_NODE
;
3539 vty
->node
= BGP_IPV4_NODE
;
3544 DEFUN (address_family_ipv6_unicast
,
3545 address_family_ipv6_unicast_cmd
,
3546 "address-family ipv6 unicast",
3547 "Enter Address Family command mode\n"
3551 vty
->node
= BGP_IPV6_NODE
;
3555 ALIAS (address_family_ipv6_unicast
,
3556 address_family_ipv6_cmd
,
3557 "address-family ipv6",
3558 "Enter Address Family command mode\n"
3561 DEFUN (address_family_vpnv4
,
3562 address_family_vpnv4_cmd
,
3563 "address-family vpnv4",
3564 "Enter Address Family command mode\n"
3567 vty
->node
= BGP_VPNV4_NODE
;
3571 ALIAS (address_family_vpnv4
,
3572 address_family_vpnv4_unicast_cmd
,
3573 "address-family vpnv4 unicast",
3574 "Enter Address Family command mode\n"
3576 "Address Family Modifier\n")
3578 DEFUN (exit_address_family
,
3579 exit_address_family_cmd
,
3580 "exit-address-family",
3581 "Exit from Address Family configuration mode\n")
3583 if (vty
->node
== BGP_IPV4M_NODE
3584 || vty
->node
== BGP_VPNV4_NODE
3585 || vty
->node
== BGP_IPV6_NODE
)
3586 vty
->node
= BGP_NODE
;
3590 /* BGP clear sort. */
3601 bgp_clear_vty_error (struct vty
*vty
, struct peer
*peer
, afi_t afi
,
3602 safi_t safi
, int error
)
3606 case BGP_ERR_AF_UNCONFIGURED
:
3608 "%%BGP: Enable %s %s address family for the neighbor %s%s",
3609 afi
== AFI_IP6
? "IPv6" : safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
3610 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
3611 peer
->host
, VTY_NEWLINE
);
3613 case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED
:
3614 vty_out (vty
, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer
->host
, VTY_NEWLINE
, VTY_NEWLINE
);
3621 /* `clear ip bgp' functions. */
3623 bgp_clear (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
, safi_t safi
,
3624 enum clear_sort sort
,enum bgp_clear_type stype
, char *arg
)
3628 struct listnode
*nn
;
3630 /* Clear all neighbors. */
3631 if (sort
== clear_all
)
3633 LIST_LOOP (bgp
->peer
, peer
, nn
)
3635 if (stype
== BGP_CLEAR_SOFT_NONE
)
3636 ret
= peer_clear (peer
);
3638 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3641 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3646 /* Clear specified neighbors. */
3647 if (sort
== clear_peer
)
3652 /* Make sockunion for lookup. */
3653 ret
= str2sockunion (arg
, &su
);
3656 vty_out (vty
, "Malformed address: %s%s", arg
, VTY_NEWLINE
);
3659 peer
= peer_lookup (bgp
, &su
);
3662 vty_out (vty
, "%%BGP: Unknown neighbor - \"%s\"%s", arg
, VTY_NEWLINE
);
3666 if (stype
== BGP_CLEAR_SOFT_NONE
)
3667 ret
= peer_clear (peer
);
3669 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3672 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3677 /* Clear all peer-group members. */
3678 if (sort
== clear_group
)
3680 struct peer_group
*group
;
3682 group
= peer_group_lookup (bgp
, arg
);
3685 vty_out (vty
, "%%BGP: No such peer-group %s%s", arg
, VTY_NEWLINE
);
3689 LIST_LOOP (group
->peer
, peer
, nn
)
3691 if (stype
== BGP_CLEAR_SOFT_NONE
)
3693 ret
= peer_clear (peer
);
3697 if (! peer
->af_group
[afi
][safi
])
3700 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3703 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3708 if (sort
== clear_external
)
3710 LIST_LOOP (bgp
->peer
, peer
, nn
)
3712 if (peer_sort (peer
) == BGP_PEER_IBGP
)
3715 if (stype
== BGP_CLEAR_SOFT_NONE
)
3716 ret
= peer_clear (peer
);
3718 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3721 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3726 if (sort
== clear_as
)
3729 unsigned long as_ul
;
3730 char *endptr
= NULL
;
3733 as_ul
= strtoul(arg
, &endptr
, 10);
3735 if ((as_ul
== ULONG_MAX
) || (*endptr
!= '\0') || (as_ul
> USHRT_MAX
))
3737 vty_out (vty
, "Invalid AS number%s", VTY_NEWLINE
);
3742 LIST_LOOP (bgp
->peer
, peer
, nn
)
3748 if (stype
== BGP_CLEAR_SOFT_NONE
)
3749 ret
= peer_clear (peer
);
3751 ret
= peer_clear_soft (peer
, afi
, safi
, stype
);
3754 bgp_clear_vty_error (vty
, peer
, afi
, safi
, ret
);
3757 vty_out (vty
, "%%BGP: No peer is configured with AS %s%s", arg
,
3766 bgp_clear_vty (struct vty
*vty
, char *name
, afi_t afi
, safi_t safi
,
3767 enum clear_sort sort
, enum bgp_clear_type stype
, char *arg
)
3772 /* BGP structure lookup. */
3775 bgp
= bgp_lookup_by_name (name
);
3778 vty_out (vty
, "Can't find BGP view %s%s", name
, VTY_NEWLINE
);
3784 bgp
= bgp_get_default ();
3787 vty_out (vty
, "No BGP process is configured%s", VTY_NEWLINE
);
3792 ret
= bgp_clear (vty
, bgp
, afi
, safi
, sort
, stype
, arg
);
3799 DEFUN (clear_ip_bgp_all
,
3800 clear_ip_bgp_all_cmd
,
3805 "Clear all peers\n")
3808 return bgp_clear_vty (vty
, argv
[0], 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
3810 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_all
, BGP_CLEAR_SOFT_NONE
, NULL
);
3813 ALIAS (clear_ip_bgp_all
,
3818 "Clear all peers\n")
3820 ALIAS (clear_ip_bgp_all
,
3821 clear_bgp_ipv6_all_cmd
,
3826 "Clear all peers\n")
3828 ALIAS (clear_ip_bgp_all
,
3829 clear_ip_bgp_instance_all_cmd
,
3830 "clear ip bgp view WORD *",
3836 "Clear all peers\n")
3838 ALIAS (clear_ip_bgp_all
,
3839 clear_bgp_instance_all_cmd
,
3840 "clear bgp view WORD *",
3845 "Clear all peers\n")
3847 DEFUN (clear_ip_bgp_peer
,
3848 clear_ip_bgp_peer_cmd
,
3849 "clear ip bgp (A.B.C.D|X:X::X:X)",
3853 "BGP neighbor IP address to clear\n"
3854 "BGP IPv6 neighbor to clear\n")
3856 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_peer
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
3859 ALIAS (clear_ip_bgp_peer
,
3861 "clear bgp (A.B.C.D|X:X::X:X)",
3864 "BGP neighbor address to clear\n"
3865 "BGP IPv6 neighbor to clear\n")
3867 ALIAS (clear_ip_bgp_peer
,
3868 clear_bgp_ipv6_peer_cmd
,
3869 "clear bgp ipv6 (A.B.C.D|X:X::X:X)",
3873 "BGP neighbor address to clear\n"
3874 "BGP IPv6 neighbor to clear\n")
3876 DEFUN (clear_ip_bgp_peer_group
,
3877 clear_ip_bgp_peer_group_cmd
,
3878 "clear ip bgp peer-group WORD",
3882 "Clear all members of peer-group\n"
3883 "BGP peer-group name\n")
3885 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_group
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
3888 ALIAS (clear_ip_bgp_peer_group
,
3889 clear_bgp_peer_group_cmd
,
3890 "clear bgp peer-group WORD",
3893 "Clear all members of peer-group\n"
3894 "BGP peer-group name\n")
3896 ALIAS (clear_ip_bgp_peer_group
,
3897 clear_bgp_ipv6_peer_group_cmd
,
3898 "clear bgp ipv6 peer-group WORD",
3902 "Clear all members of peer-group\n"
3903 "BGP peer-group name\n")
3905 DEFUN (clear_ip_bgp_external
,
3906 clear_ip_bgp_external_cmd
,
3907 "clear ip bgp external",
3911 "Clear all external peers\n")
3913 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_external
, BGP_CLEAR_SOFT_NONE
, NULL
);
3916 ALIAS (clear_ip_bgp_external
,
3917 clear_bgp_external_cmd
,
3918 "clear bgp external",
3921 "Clear all external peers\n")
3923 ALIAS (clear_ip_bgp_external
,
3924 clear_bgp_ipv6_external_cmd
,
3925 "clear bgp ipv6 external",
3929 "Clear all external peers\n")
3931 DEFUN (clear_ip_bgp_as
,
3932 clear_ip_bgp_as_cmd
,
3933 "clear ip bgp <1-65535>",
3937 "Clear peers with the AS number\n")
3939 return bgp_clear_vty (vty
, NULL
, 0, 0, clear_as
, BGP_CLEAR_SOFT_NONE
, argv
[0]);
3942 ALIAS (clear_ip_bgp_as
,
3944 "clear bgp <1-65535>",
3947 "Clear peers with the AS number\n")
3949 ALIAS (clear_ip_bgp_as
,
3950 clear_bgp_ipv6_as_cmd
,
3951 "clear bgp ipv6 <1-65535>",
3955 "Clear peers with the AS number\n")
3957 /* Outbound soft-reconfiguration */
3958 DEFUN (clear_ip_bgp_all_soft_out
,
3959 clear_ip_bgp_all_soft_out_cmd
,
3960 "clear ip bgp * soft out",
3966 "Soft reconfig outbound update\n")
3969 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
3970 BGP_CLEAR_SOFT_OUT
, NULL
);
3972 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
3973 BGP_CLEAR_SOFT_OUT
, NULL
);
3976 ALIAS (clear_ip_bgp_all_soft_out
,
3977 clear_ip_bgp_all_out_cmd
,
3978 "clear ip bgp * out",
3983 "Soft reconfig outbound update\n")
3985 ALIAS (clear_ip_bgp_all_soft_out
,
3986 clear_ip_bgp_instance_all_soft_out_cmd
,
3987 "clear ip bgp view WORD * soft out",
3995 "Soft reconfig outbound update\n")
3997 DEFUN (clear_ip_bgp_all_ipv4_soft_out
,
3998 clear_ip_bgp_all_ipv4_soft_out_cmd
,
3999 "clear ip bgp * ipv4 (unicast|multicast) soft out",
4005 "Address Family modifier\n"
4006 "Address Family modifier\n"
4008 "Soft reconfig outbound update\n")
4010 if (strncmp (argv
[0], "m", 1) == 0)
4011 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4012 BGP_CLEAR_SOFT_OUT
, NULL
);
4014 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4015 BGP_CLEAR_SOFT_OUT
, NULL
);
4018 ALIAS (clear_ip_bgp_all_ipv4_soft_out
,
4019 clear_ip_bgp_all_ipv4_out_cmd
,
4020 "clear ip bgp * ipv4 (unicast|multicast) out",
4026 "Address Family modifier\n"
4027 "Address Family modifier\n"
4028 "Soft reconfig outbound update\n")
4030 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out
,
4031 clear_ip_bgp_instance_all_ipv4_soft_out_cmd
,
4032 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out",
4040 "Address Family modifier\n"
4041 "Address Family modifier\n"
4042 "Soft reconfig outbound update\n")
4044 if (strncmp (argv
[1], "m", 1) == 0)
4045 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4046 BGP_CLEAR_SOFT_OUT
, NULL
);
4048 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4049 BGP_CLEAR_SOFT_OUT
, NULL
);
4052 DEFUN (clear_ip_bgp_all_vpnv4_soft_out
,
4053 clear_ip_bgp_all_vpnv4_soft_out_cmd
,
4054 "clear ip bgp * vpnv4 unicast soft out",
4060 "Address Family Modifier\n"
4062 "Soft reconfig outbound update\n")
4064 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4065 BGP_CLEAR_SOFT_OUT
, NULL
);
4068 ALIAS (clear_ip_bgp_all_vpnv4_soft_out
,
4069 clear_ip_bgp_all_vpnv4_out_cmd
,
4070 "clear ip bgp * vpnv4 unicast out",
4076 "Address Family Modifier\n"
4077 "Soft reconfig outbound update\n")
4079 DEFUN (clear_bgp_all_soft_out
,
4080 clear_bgp_all_soft_out_cmd
,
4081 "clear bgp * soft out",
4086 "Soft reconfig outbound update\n")
4089 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4090 BGP_CLEAR_SOFT_OUT
, NULL
);
4092 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4093 BGP_CLEAR_SOFT_OUT
, NULL
);
4096 ALIAS (clear_bgp_all_soft_out
,
4097 clear_bgp_instance_all_soft_out_cmd
,
4098 "clear bgp view WORD * soft out",
4105 "Soft reconfig outbound update\n")
4107 ALIAS (clear_bgp_all_soft_out
,
4108 clear_bgp_all_out_cmd
,
4113 "Soft reconfig outbound update\n")
4115 ALIAS (clear_bgp_all_soft_out
,
4116 clear_bgp_ipv6_all_soft_out_cmd
,
4117 "clear bgp ipv6 * soft out",
4123 "Soft reconfig outbound update\n")
4125 ALIAS (clear_bgp_all_soft_out
,
4126 clear_bgp_ipv6_all_out_cmd
,
4127 "clear bgp ipv6 * out",
4132 "Soft reconfig outbound update\n")
4134 DEFUN (clear_ip_bgp_peer_soft_out
,
4135 clear_ip_bgp_peer_soft_out_cmd
,
4136 "clear ip bgp A.B.C.D soft out",
4140 "BGP neighbor address to clear\n"
4142 "Soft reconfig outbound update\n")
4144 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4145 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4148 ALIAS (clear_ip_bgp_peer_soft_out
,
4149 clear_ip_bgp_peer_out_cmd
,
4150 "clear ip bgp A.B.C.D out",
4154 "BGP neighbor address to clear\n"
4155 "Soft reconfig outbound update\n")
4157 DEFUN (clear_ip_bgp_peer_ipv4_soft_out
,
4158 clear_ip_bgp_peer_ipv4_soft_out_cmd
,
4159 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out",
4163 "BGP neighbor address to clear\n"
4165 "Address Family modifier\n"
4166 "Address Family modifier\n"
4168 "Soft reconfig outbound update\n")
4170 if (strncmp (argv
[1], "m", 1) == 0)
4171 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4172 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4174 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4175 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4178 ALIAS (clear_ip_bgp_peer_ipv4_soft_out
,
4179 clear_ip_bgp_peer_ipv4_out_cmd
,
4180 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out",
4184 "BGP neighbor address to clear\n"
4186 "Address Family modifier\n"
4187 "Address Family modifier\n"
4188 "Soft reconfig outbound update\n")
4190 DEFUN (clear_ip_bgp_peer_vpnv4_soft_out
,
4191 clear_ip_bgp_peer_vpnv4_soft_out_cmd
,
4192 "clear ip bgp A.B.C.D vpnv4 unicast soft out",
4196 "BGP neighbor address to clear\n"
4198 "Address Family Modifier\n"
4200 "Soft reconfig outbound update\n")
4202 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4203 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4206 ALIAS (clear_ip_bgp_peer_vpnv4_soft_out
,
4207 clear_ip_bgp_peer_vpnv4_out_cmd
,
4208 "clear ip bgp A.B.C.D vpnv4 unicast out",
4212 "BGP neighbor address to clear\n"
4214 "Address Family Modifier\n"
4215 "Soft reconfig outbound update\n")
4217 DEFUN (clear_bgp_peer_soft_out
,
4218 clear_bgp_peer_soft_out_cmd
,
4219 "clear bgp (A.B.C.D|X:X::X:X) soft out",
4222 "BGP neighbor address to clear\n"
4223 "BGP IPv6 neighbor to clear\n"
4225 "Soft reconfig outbound update\n")
4227 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4228 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4231 ALIAS (clear_bgp_peer_soft_out
,
4232 clear_bgp_ipv6_peer_soft_out_cmd
,
4233 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out",
4237 "BGP neighbor address to clear\n"
4238 "BGP IPv6 neighbor to clear\n"
4240 "Soft reconfig outbound update\n")
4242 ALIAS (clear_bgp_peer_soft_out
,
4243 clear_bgp_peer_out_cmd
,
4244 "clear bgp (A.B.C.D|X:X::X:X) out",
4247 "BGP neighbor address to clear\n"
4248 "BGP IPv6 neighbor to clear\n"
4249 "Soft reconfig outbound update\n")
4251 ALIAS (clear_bgp_peer_soft_out
,
4252 clear_bgp_ipv6_peer_out_cmd
,
4253 "clear bgp ipv6 (A.B.C.D|X:X::X:X) out",
4257 "BGP neighbor address to clear\n"
4258 "BGP IPv6 neighbor to clear\n"
4259 "Soft reconfig outbound update\n")
4261 DEFUN (clear_ip_bgp_peer_group_soft_out
,
4262 clear_ip_bgp_peer_group_soft_out_cmd
,
4263 "clear ip bgp peer-group WORD soft out",
4267 "Clear all members of peer-group\n"
4268 "BGP peer-group name\n"
4270 "Soft reconfig outbound update\n")
4272 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4273 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4276 ALIAS (clear_ip_bgp_peer_group_soft_out
,
4277 clear_ip_bgp_peer_group_out_cmd
,
4278 "clear ip bgp peer-group WORD out",
4282 "Clear all members of peer-group\n"
4283 "BGP peer-group name\n"
4284 "Soft reconfig outbound update\n")
4286 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out
,
4287 clear_ip_bgp_peer_group_ipv4_soft_out_cmd
,
4288 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
4292 "Clear all members of peer-group\n"
4293 "BGP peer-group name\n"
4295 "Address Family modifier\n"
4296 "Address Family modifier\n"
4298 "Soft reconfig outbound update\n")
4300 if (strncmp (argv
[1], "m", 1) == 0)
4301 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
4302 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4304 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
4305 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4308 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out
,
4309 clear_ip_bgp_peer_group_ipv4_out_cmd
,
4310 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
4314 "Clear all members of peer-group\n"
4315 "BGP peer-group name\n"
4317 "Address Family modifier\n"
4318 "Address Family modifier\n"
4319 "Soft reconfig outbound update\n")
4321 DEFUN (clear_bgp_peer_group_soft_out
,
4322 clear_bgp_peer_group_soft_out_cmd
,
4323 "clear bgp peer-group WORD soft out",
4326 "Clear all members of peer-group\n"
4327 "BGP peer-group name\n"
4329 "Soft reconfig outbound update\n")
4331 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
4332 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4335 ALIAS (clear_bgp_peer_group_soft_out
,
4336 clear_bgp_ipv6_peer_group_soft_out_cmd
,
4337 "clear bgp ipv6 peer-group WORD soft out",
4341 "Clear all members of peer-group\n"
4342 "BGP peer-group name\n"
4344 "Soft reconfig outbound update\n")
4346 ALIAS (clear_bgp_peer_group_soft_out
,
4347 clear_bgp_peer_group_out_cmd
,
4348 "clear bgp peer-group WORD out",
4351 "Clear all members of peer-group\n"
4352 "BGP peer-group name\n"
4353 "Soft reconfig outbound update\n")
4355 ALIAS (clear_bgp_peer_group_soft_out
,
4356 clear_bgp_ipv6_peer_group_out_cmd
,
4357 "clear bgp ipv6 peer-group WORD out",
4361 "Clear all members of peer-group\n"
4362 "BGP peer-group name\n"
4363 "Soft reconfig outbound update\n")
4365 DEFUN (clear_ip_bgp_external_soft_out
,
4366 clear_ip_bgp_external_soft_out_cmd
,
4367 "clear ip bgp external soft out",
4371 "Clear all external peers\n"
4373 "Soft reconfig outbound update\n")
4375 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4376 BGP_CLEAR_SOFT_OUT
, NULL
);
4379 ALIAS (clear_ip_bgp_external_soft_out
,
4380 clear_ip_bgp_external_out_cmd
,
4381 "clear ip bgp external out",
4385 "Clear all external peers\n"
4386 "Soft reconfig outbound update\n")
4388 DEFUN (clear_ip_bgp_external_ipv4_soft_out
,
4389 clear_ip_bgp_external_ipv4_soft_out_cmd
,
4390 "clear ip bgp external ipv4 (unicast|multicast) soft out",
4394 "Clear all external peers\n"
4396 "Address Family modifier\n"
4397 "Address Family modifier\n"
4399 "Soft reconfig outbound update\n")
4401 if (strncmp (argv
[0], "m", 1) == 0)
4402 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
4403 BGP_CLEAR_SOFT_OUT
, NULL
);
4405 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
4406 BGP_CLEAR_SOFT_OUT
, NULL
);
4409 ALIAS (clear_ip_bgp_external_ipv4_soft_out
,
4410 clear_ip_bgp_external_ipv4_out_cmd
,
4411 "clear ip bgp external ipv4 (unicast|multicast) out",
4415 "Clear all external peers\n"
4417 "Address Family modifier\n"
4418 "Address Family modifier\n"
4419 "Soft reconfig outbound update\n")
4421 DEFUN (clear_bgp_external_soft_out
,
4422 clear_bgp_external_soft_out_cmd
,
4423 "clear bgp external soft out",
4426 "Clear all external peers\n"
4428 "Soft reconfig outbound update\n")
4430 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
4431 BGP_CLEAR_SOFT_OUT
, NULL
);
4434 ALIAS (clear_bgp_external_soft_out
,
4435 clear_bgp_ipv6_external_soft_out_cmd
,
4436 "clear bgp ipv6 external soft out",
4440 "Clear all external peers\n"
4442 "Soft reconfig outbound update\n")
4444 ALIAS (clear_bgp_external_soft_out
,
4445 clear_bgp_external_out_cmd
,
4446 "clear bgp external out",
4449 "Clear all external peers\n"
4450 "Soft reconfig outbound update\n")
4452 ALIAS (clear_bgp_external_soft_out
,
4453 clear_bgp_ipv6_external_out_cmd
,
4454 "clear bgp ipv6 external WORD out",
4458 "Clear all external peers\n"
4459 "Soft reconfig outbound update\n")
4461 DEFUN (clear_ip_bgp_as_soft_out
,
4462 clear_ip_bgp_as_soft_out_cmd
,
4463 "clear ip bgp <1-65535> soft out",
4467 "Clear peers with the AS number\n"
4469 "Soft reconfig outbound update\n")
4471 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4472 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4475 ALIAS (clear_ip_bgp_as_soft_out
,
4476 clear_ip_bgp_as_out_cmd
,
4477 "clear ip bgp <1-65535> out",
4481 "Clear peers with the AS number\n"
4482 "Soft reconfig outbound update\n")
4484 DEFUN (clear_ip_bgp_as_ipv4_soft_out
,
4485 clear_ip_bgp_as_ipv4_soft_out_cmd
,
4486 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft out",
4490 "Clear peers with the AS number\n"
4492 "Address Family modifier\n"
4493 "Address Family modifier\n"
4495 "Soft reconfig outbound update\n")
4497 if (strncmp (argv
[1], "m", 1) == 0)
4498 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
4499 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4501 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
4502 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4505 ALIAS (clear_ip_bgp_as_ipv4_soft_out
,
4506 clear_ip_bgp_as_ipv4_out_cmd
,
4507 "clear ip bgp <1-65535> ipv4 (unicast|multicast) out",
4511 "Clear peers with the AS number\n"
4513 "Address Family modifier\n"
4514 "Address Family modifier\n"
4515 "Soft reconfig outbound update\n")
4517 DEFUN (clear_ip_bgp_as_vpnv4_soft_out
,
4518 clear_ip_bgp_as_vpnv4_soft_out_cmd
,
4519 "clear ip bgp <1-65535> vpnv4 unicast soft out",
4523 "Clear peers with the AS number\n"
4525 "Address Family modifier\n"
4527 "Soft reconfig outbound update\n")
4529 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
4530 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4533 ALIAS (clear_ip_bgp_as_vpnv4_soft_out
,
4534 clear_ip_bgp_as_vpnv4_out_cmd
,
4535 "clear ip bgp <1-65535> vpnv4 unicast out",
4539 "Clear peers with the AS number\n"
4541 "Address Family modifier\n"
4542 "Soft reconfig outbound update\n")
4544 DEFUN (clear_bgp_as_soft_out
,
4545 clear_bgp_as_soft_out_cmd
,
4546 "clear bgp <1-65535> soft out",
4549 "Clear peers with the AS number\n"
4551 "Soft reconfig outbound update\n")
4553 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
4554 BGP_CLEAR_SOFT_OUT
, argv
[0]);
4557 ALIAS (clear_bgp_as_soft_out
,
4558 clear_bgp_ipv6_as_soft_out_cmd
,
4559 "clear bgp ipv6 <1-65535> soft out",
4563 "Clear peers with the AS number\n"
4565 "Soft reconfig outbound update\n")
4567 ALIAS (clear_bgp_as_soft_out
,
4568 clear_bgp_as_out_cmd
,
4569 "clear bgp <1-65535> out",
4572 "Clear peers with the AS number\n"
4573 "Soft reconfig outbound update\n")
4575 ALIAS (clear_bgp_as_soft_out
,
4576 clear_bgp_ipv6_as_out_cmd
,
4577 "clear bgp ipv6 <1-65535> out",
4581 "Clear peers with the AS number\n"
4582 "Soft reconfig outbound update\n")
4584 /* Inbound soft-reconfiguration */
4585 DEFUN (clear_ip_bgp_all_soft_in
,
4586 clear_ip_bgp_all_soft_in_cmd
,
4587 "clear ip bgp * soft in",
4593 "Soft reconfig inbound update\n")
4596 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4597 BGP_CLEAR_SOFT_IN
, NULL
);
4599 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4600 BGP_CLEAR_SOFT_IN
, NULL
);
4603 ALIAS (clear_ip_bgp_all_soft_in
,
4604 clear_ip_bgp_instance_all_soft_in_cmd
,
4605 "clear ip bgp view WORD * soft in",
4613 "Soft reconfig inbound update\n")
4615 ALIAS (clear_ip_bgp_all_soft_in
,
4616 clear_ip_bgp_all_in_cmd
,
4617 "clear ip bgp * in",
4622 "Soft reconfig inbound update\n")
4624 DEFUN (clear_ip_bgp_all_in_prefix_filter
,
4625 clear_ip_bgp_all_in_prefix_filter_cmd
,
4626 "clear ip bgp * in prefix-filter",
4631 "Soft reconfig inbound update\n"
4632 "Push out prefix-list ORF and do inbound soft reconfig\n")
4635 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4636 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4638 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4639 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4642 ALIAS (clear_ip_bgp_all_in_prefix_filter
,
4643 clear_ip_bgp_instance_all_in_prefix_filter_cmd
,
4644 "clear ip bgp view WORD * in prefix-filter",
4651 "Soft reconfig inbound update\n"
4652 "Push out prefix-list ORF and do inbound soft reconfig\n")
4655 DEFUN (clear_ip_bgp_all_ipv4_soft_in
,
4656 clear_ip_bgp_all_ipv4_soft_in_cmd
,
4657 "clear ip bgp * ipv4 (unicast|multicast) soft in",
4663 "Address Family modifier\n"
4664 "Address Family modifier\n"
4666 "Soft reconfig inbound update\n")
4668 if (strncmp (argv
[0], "m", 1) == 0)
4669 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4670 BGP_CLEAR_SOFT_IN
, NULL
);
4672 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4673 BGP_CLEAR_SOFT_IN
, NULL
);
4676 ALIAS (clear_ip_bgp_all_ipv4_soft_in
,
4677 clear_ip_bgp_all_ipv4_in_cmd
,
4678 "clear ip bgp * ipv4 (unicast|multicast) in",
4684 "Address Family modifier\n"
4685 "Address Family modifier\n"
4686 "Soft reconfig inbound update\n")
4688 DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in
,
4689 clear_ip_bgp_instance_all_ipv4_soft_in_cmd
,
4690 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in",
4698 "Address Family modifier\n"
4699 "Address Family modifier\n"
4701 "Soft reconfig inbound update\n")
4703 if (strncmp (argv
[1], "m", 1) == 0)
4704 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4705 BGP_CLEAR_SOFT_IN
, NULL
);
4707 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4708 BGP_CLEAR_SOFT_IN
, NULL
);
4711 DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter
,
4712 clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
,
4713 "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
4719 "Address Family modifier\n"
4720 "Address Family modifier\n"
4721 "Soft reconfig inbound update\n"
4722 "Push out prefix-list ORF and do inbound soft reconfig\n")
4724 if (strncmp (argv
[0], "m", 1) == 0)
4725 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
4726 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4728 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
4729 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4732 DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter
,
4733 clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
,
4734 "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter",
4740 "Address Family modifier\n"
4741 "Address Family modifier\n"
4742 "Soft reconfig inbound update\n"
4743 "Push out prefix-list ORF and do inbound soft reconfig\n")
4745 if (strncmp (argv
[1], "m", 1) == 0)
4746 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
, clear_all
,
4747 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4749 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
4750 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4753 DEFUN (clear_ip_bgp_all_vpnv4_soft_in
,
4754 clear_ip_bgp_all_vpnv4_soft_in_cmd
,
4755 "clear ip bgp * vpnv4 unicast soft in",
4761 "Address Family Modifier\n"
4763 "Soft reconfig inbound update\n")
4765 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
4766 BGP_CLEAR_SOFT_IN
, NULL
);
4769 ALIAS (clear_ip_bgp_all_vpnv4_soft_in
,
4770 clear_ip_bgp_all_vpnv4_in_cmd
,
4771 "clear ip bgp * vpnv4 unicast in",
4777 "Address Family Modifier\n"
4778 "Soft reconfig inbound update\n")
4780 DEFUN (clear_bgp_all_soft_in
,
4781 clear_bgp_all_soft_in_cmd
,
4782 "clear bgp * soft in",
4787 "Soft reconfig inbound update\n")
4790 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
4791 BGP_CLEAR_SOFT_IN
, NULL
);
4793 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4794 BGP_CLEAR_SOFT_IN
, NULL
);
4797 ALIAS (clear_bgp_all_soft_in
,
4798 clear_bgp_instance_all_soft_in_cmd
,
4799 "clear bgp view WORD * soft in",
4806 "Soft reconfig inbound update\n")
4808 ALIAS (clear_bgp_all_soft_in
,
4809 clear_bgp_ipv6_all_soft_in_cmd
,
4810 "clear bgp ipv6 * soft in",
4816 "Soft reconfig inbound update\n")
4818 ALIAS (clear_bgp_all_soft_in
,
4819 clear_bgp_all_in_cmd
,
4824 "Soft reconfig inbound update\n")
4826 ALIAS (clear_bgp_all_soft_in
,
4827 clear_bgp_ipv6_all_in_cmd
,
4828 "clear bgp ipv6 * in",
4833 "Soft reconfig inbound update\n")
4835 DEFUN (clear_bgp_all_in_prefix_filter
,
4836 clear_bgp_all_in_prefix_filter_cmd
,
4837 "clear bgp * in prefix-filter",
4841 "Soft reconfig inbound update\n"
4842 "Push out prefix-list ORF and do inbound soft reconfig\n")
4844 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
4845 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
4848 ALIAS (clear_bgp_all_in_prefix_filter
,
4849 clear_bgp_ipv6_all_in_prefix_filter_cmd
,
4850 "clear bgp ipv6 * in prefix-filter",
4855 "Soft reconfig inbound update\n"
4856 "Push out prefix-list ORF and do inbound soft reconfig\n")
4858 DEFUN (clear_ip_bgp_peer_soft_in
,
4859 clear_ip_bgp_peer_soft_in_cmd
,
4860 "clear ip bgp A.B.C.D soft in",
4864 "BGP neighbor address to clear\n"
4866 "Soft reconfig inbound update\n")
4868 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4869 BGP_CLEAR_SOFT_IN
, argv
[0]);
4872 ALIAS (clear_ip_bgp_peer_soft_in
,
4873 clear_ip_bgp_peer_in_cmd
,
4874 "clear ip bgp A.B.C.D in",
4878 "BGP neighbor address to clear\n"
4879 "Soft reconfig inbound update\n")
4881 DEFUN (clear_ip_bgp_peer_in_prefix_filter
,
4882 clear_ip_bgp_peer_in_prefix_filter_cmd
,
4883 "clear ip bgp A.B.C.D in prefix-filter",
4887 "BGP neighbor address to clear\n"
4888 "Soft reconfig inbound update\n"
4889 "Push out the existing ORF prefix-list\n")
4891 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4892 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
4895 DEFUN (clear_ip_bgp_peer_ipv4_soft_in
,
4896 clear_ip_bgp_peer_ipv4_soft_in_cmd
,
4897 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in",
4901 "BGP neighbor address to clear\n"
4903 "Address Family modifier\n"
4904 "Address Family modifier\n"
4906 "Soft reconfig inbound update\n")
4908 if (strncmp (argv
[1], "m", 1) == 0)
4909 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4910 BGP_CLEAR_SOFT_IN
, argv
[0]);
4912 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4913 BGP_CLEAR_SOFT_IN
, argv
[0]);
4916 ALIAS (clear_ip_bgp_peer_ipv4_soft_in
,
4917 clear_ip_bgp_peer_ipv4_in_cmd
,
4918 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in",
4922 "BGP neighbor address to clear\n"
4924 "Address Family modifier\n"
4925 "Address Family modifier\n"
4926 "Soft reconfig inbound update\n")
4928 DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter
,
4929 clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
,
4930 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter",
4934 "BGP neighbor address to clear\n"
4936 "Address Family modifier\n"
4937 "Address Family modifier\n"
4938 "Soft reconfig inbound update\n"
4939 "Push out the existing ORF prefix-list\n")
4941 if (strncmp (argv
[1], "m", 1) == 0)
4942 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
4943 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
4945 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
4946 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
4949 DEFUN (clear_ip_bgp_peer_vpnv4_soft_in
,
4950 clear_ip_bgp_peer_vpnv4_soft_in_cmd
,
4951 "clear ip bgp A.B.C.D vpnv4 unicast soft in",
4955 "BGP neighbor address to clear\n"
4957 "Address Family Modifier\n"
4959 "Soft reconfig inbound update\n")
4961 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
4962 BGP_CLEAR_SOFT_IN
, argv
[0]);
4965 ALIAS (clear_ip_bgp_peer_vpnv4_soft_in
,
4966 clear_ip_bgp_peer_vpnv4_in_cmd
,
4967 "clear ip bgp A.B.C.D vpnv4 unicast in",
4971 "BGP neighbor address to clear\n"
4973 "Address Family Modifier\n"
4974 "Soft reconfig inbound update\n")
4976 DEFUN (clear_bgp_peer_soft_in
,
4977 clear_bgp_peer_soft_in_cmd
,
4978 "clear bgp (A.B.C.D|X:X::X:X) soft in",
4981 "BGP neighbor address to clear\n"
4982 "BGP IPv6 neighbor to clear\n"
4984 "Soft reconfig inbound update\n")
4986 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
4987 BGP_CLEAR_SOFT_IN
, argv
[0]);
4990 ALIAS (clear_bgp_peer_soft_in
,
4991 clear_bgp_ipv6_peer_soft_in_cmd
,
4992 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in",
4996 "BGP neighbor address to clear\n"
4997 "BGP IPv6 neighbor to clear\n"
4999 "Soft reconfig inbound update\n")
5001 ALIAS (clear_bgp_peer_soft_in
,
5002 clear_bgp_peer_in_cmd
,
5003 "clear bgp (A.B.C.D|X:X::X:X) in",
5006 "BGP neighbor address to clear\n"
5007 "BGP IPv6 neighbor to clear\n"
5008 "Soft reconfig inbound update\n")
5010 ALIAS (clear_bgp_peer_soft_in
,
5011 clear_bgp_ipv6_peer_in_cmd
,
5012 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in",
5016 "BGP neighbor address to clear\n"
5017 "BGP IPv6 neighbor to clear\n"
5018 "Soft reconfig inbound update\n")
5020 DEFUN (clear_bgp_peer_in_prefix_filter
,
5021 clear_bgp_peer_in_prefix_filter_cmd
,
5022 "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter",
5025 "BGP neighbor address to clear\n"
5026 "BGP IPv6 neighbor to clear\n"
5027 "Soft reconfig inbound update\n"
5028 "Push out the existing ORF prefix-list\n")
5030 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5031 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5034 ALIAS (clear_bgp_peer_in_prefix_filter
,
5035 clear_bgp_ipv6_peer_in_prefix_filter_cmd
,
5036 "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter",
5040 "BGP neighbor address to clear\n"
5041 "BGP IPv6 neighbor to clear\n"
5042 "Soft reconfig inbound update\n"
5043 "Push out the existing ORF prefix-list\n")
5045 DEFUN (clear_ip_bgp_peer_group_soft_in
,
5046 clear_ip_bgp_peer_group_soft_in_cmd
,
5047 "clear ip bgp peer-group WORD soft in",
5051 "Clear all members of peer-group\n"
5052 "BGP peer-group name\n"
5054 "Soft reconfig inbound update\n")
5056 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5057 BGP_CLEAR_SOFT_IN
, argv
[0]);
5060 ALIAS (clear_ip_bgp_peer_group_soft_in
,
5061 clear_ip_bgp_peer_group_in_cmd
,
5062 "clear ip bgp peer-group WORD in",
5066 "Clear all members of peer-group\n"
5067 "BGP peer-group name\n"
5068 "Soft reconfig inbound update\n")
5070 DEFUN (clear_ip_bgp_peer_group_in_prefix_filter
,
5071 clear_ip_bgp_peer_group_in_prefix_filter_cmd
,
5072 "clear ip bgp peer-group WORD in prefix-filter",
5076 "Clear all members of peer-group\n"
5077 "BGP peer-group name\n"
5078 "Soft reconfig inbound update\n"
5079 "Push out prefix-list ORF and do inbound soft reconfig\n")
5081 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5082 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5085 DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in
,
5086 clear_ip_bgp_peer_group_ipv4_soft_in_cmd
,
5087 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
5091 "Clear all members of peer-group\n"
5092 "BGP peer-group name\n"
5094 "Address Family modifier\n"
5095 "Address Family modifier\n"
5097 "Soft reconfig inbound update\n")
5099 if (strncmp (argv
[1], "m", 1) == 0)
5100 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5101 BGP_CLEAR_SOFT_IN
, argv
[0]);
5103 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5104 BGP_CLEAR_SOFT_IN
, argv
[0]);
5107 ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in
,
5108 clear_ip_bgp_peer_group_ipv4_in_cmd
,
5109 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
5113 "Clear all members of peer-group\n"
5114 "BGP peer-group name\n"
5116 "Address Family modifier\n"
5117 "Address Family modifier\n"
5118 "Soft reconfig inbound update\n")
5120 DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter
,
5121 clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
,
5122 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
5126 "Clear all members of peer-group\n"
5127 "BGP peer-group name\n"
5129 "Address Family modifier\n"
5130 "Address Family modifier\n"
5131 "Soft reconfig inbound update\n"
5132 "Push out prefix-list ORF and do inbound soft reconfig\n")
5134 if (strncmp (argv
[1], "m", 1) == 0)
5135 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5136 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5138 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5139 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5142 DEFUN (clear_bgp_peer_group_soft_in
,
5143 clear_bgp_peer_group_soft_in_cmd
,
5144 "clear bgp peer-group WORD soft in",
5147 "Clear all members of peer-group\n"
5148 "BGP peer-group name\n"
5150 "Soft reconfig inbound update\n")
5152 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5153 BGP_CLEAR_SOFT_IN
, argv
[0]);
5156 ALIAS (clear_bgp_peer_group_soft_in
,
5157 clear_bgp_ipv6_peer_group_soft_in_cmd
,
5158 "clear bgp ipv6 peer-group WORD soft in",
5162 "Clear all members of peer-group\n"
5163 "BGP peer-group name\n"
5165 "Soft reconfig inbound update\n")
5167 ALIAS (clear_bgp_peer_group_soft_in
,
5168 clear_bgp_peer_group_in_cmd
,
5169 "clear bgp peer-group WORD in",
5172 "Clear all members of peer-group\n"
5173 "BGP peer-group name\n"
5174 "Soft reconfig inbound update\n")
5176 ALIAS (clear_bgp_peer_group_soft_in
,
5177 clear_bgp_ipv6_peer_group_in_cmd
,
5178 "clear bgp ipv6 peer-group WORD in",
5182 "Clear all members of peer-group\n"
5183 "BGP peer-group name\n"
5184 "Soft reconfig inbound update\n")
5186 DEFUN (clear_bgp_peer_group_in_prefix_filter
,
5187 clear_bgp_peer_group_in_prefix_filter_cmd
,
5188 "clear bgp peer-group WORD in prefix-filter",
5191 "Clear all members of peer-group\n"
5192 "BGP peer-group name\n"
5193 "Soft reconfig inbound update\n"
5194 "Push out prefix-list ORF and do inbound soft reconfig\n")
5196 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5197 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5200 ALIAS (clear_bgp_peer_group_in_prefix_filter
,
5201 clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
,
5202 "clear bgp ipv6 peer-group WORD in prefix-filter",
5206 "Clear all members of peer-group\n"
5207 "BGP peer-group name\n"
5208 "Soft reconfig inbound update\n"
5209 "Push out prefix-list ORF and do inbound soft reconfig\n")
5211 DEFUN (clear_ip_bgp_external_soft_in
,
5212 clear_ip_bgp_external_soft_in_cmd
,
5213 "clear ip bgp external soft in",
5217 "Clear all external peers\n"
5219 "Soft reconfig inbound update\n")
5221 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5222 BGP_CLEAR_SOFT_IN
, NULL
);
5225 ALIAS (clear_ip_bgp_external_soft_in
,
5226 clear_ip_bgp_external_in_cmd
,
5227 "clear ip bgp external in",
5231 "Clear all external peers\n"
5232 "Soft reconfig inbound update\n")
5234 DEFUN (clear_ip_bgp_external_in_prefix_filter
,
5235 clear_ip_bgp_external_in_prefix_filter_cmd
,
5236 "clear ip bgp external in prefix-filter",
5240 "Clear all external peers\n"
5241 "Soft reconfig inbound update\n"
5242 "Push out prefix-list ORF and do inbound soft reconfig\n")
5244 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5245 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5248 DEFUN (clear_ip_bgp_external_ipv4_soft_in
,
5249 clear_ip_bgp_external_ipv4_soft_in_cmd
,
5250 "clear ip bgp external ipv4 (unicast|multicast) soft in",
5254 "Clear all external peers\n"
5256 "Address Family modifier\n"
5257 "Address Family modifier\n"
5259 "Soft reconfig inbound update\n")
5261 if (strncmp (argv
[0], "m", 1) == 0)
5262 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5263 BGP_CLEAR_SOFT_IN
, NULL
);
5265 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5266 BGP_CLEAR_SOFT_IN
, NULL
);
5269 ALIAS (clear_ip_bgp_external_ipv4_soft_in
,
5270 clear_ip_bgp_external_ipv4_in_cmd
,
5271 "clear ip bgp external ipv4 (unicast|multicast) in",
5275 "Clear all external peers\n"
5277 "Address Family modifier\n"
5278 "Address Family modifier\n"
5279 "Soft reconfig inbound update\n")
5281 DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter
,
5282 clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
,
5283 "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
5287 "Clear all external peers\n"
5289 "Address Family modifier\n"
5290 "Address Family modifier\n"
5291 "Soft reconfig inbound update\n"
5292 "Push out prefix-list ORF and do inbound soft reconfig\n")
5294 if (strncmp (argv
[0], "m", 1) == 0)
5295 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5296 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5298 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5299 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5302 DEFUN (clear_bgp_external_soft_in
,
5303 clear_bgp_external_soft_in_cmd
,
5304 "clear bgp external soft in",
5307 "Clear all external peers\n"
5309 "Soft reconfig inbound update\n")
5311 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5312 BGP_CLEAR_SOFT_IN
, NULL
);
5315 ALIAS (clear_bgp_external_soft_in
,
5316 clear_bgp_ipv6_external_soft_in_cmd
,
5317 "clear bgp ipv6 external soft in",
5321 "Clear all external peers\n"
5323 "Soft reconfig inbound update\n")
5325 ALIAS (clear_bgp_external_soft_in
,
5326 clear_bgp_external_in_cmd
,
5327 "clear bgp external in",
5330 "Clear all external peers\n"
5331 "Soft reconfig inbound update\n")
5333 ALIAS (clear_bgp_external_soft_in
,
5334 clear_bgp_ipv6_external_in_cmd
,
5335 "clear bgp ipv6 external WORD in",
5339 "Clear all external peers\n"
5340 "Soft reconfig inbound update\n")
5342 DEFUN (clear_bgp_external_in_prefix_filter
,
5343 clear_bgp_external_in_prefix_filter_cmd
,
5344 "clear bgp external in prefix-filter",
5347 "Clear all external peers\n"
5348 "Soft reconfig inbound update\n"
5349 "Push out prefix-list ORF and do inbound soft reconfig\n")
5351 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5352 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, NULL
);
5355 ALIAS (clear_bgp_external_in_prefix_filter
,
5356 clear_bgp_ipv6_external_in_prefix_filter_cmd
,
5357 "clear bgp ipv6 external in prefix-filter",
5361 "Clear all external peers\n"
5362 "Soft reconfig inbound update\n"
5363 "Push out prefix-list ORF and do inbound soft reconfig\n")
5365 DEFUN (clear_ip_bgp_as_soft_in
,
5366 clear_ip_bgp_as_soft_in_cmd
,
5367 "clear ip bgp <1-65535> soft in",
5371 "Clear peers with the AS number\n"
5373 "Soft reconfig inbound update\n")
5375 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5376 BGP_CLEAR_SOFT_IN
, argv
[0]);
5379 ALIAS (clear_ip_bgp_as_soft_in
,
5380 clear_ip_bgp_as_in_cmd
,
5381 "clear ip bgp <1-65535> in",
5385 "Clear peers with the AS number\n"
5386 "Soft reconfig inbound update\n")
5388 DEFUN (clear_ip_bgp_as_in_prefix_filter
,
5389 clear_ip_bgp_as_in_prefix_filter_cmd
,
5390 "clear ip bgp <1-65535> in prefix-filter",
5394 "Clear peers with the AS number\n"
5395 "Soft reconfig inbound update\n"
5396 "Push out prefix-list ORF and do inbound soft reconfig\n")
5398 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5399 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5402 DEFUN (clear_ip_bgp_as_ipv4_soft_in
,
5403 clear_ip_bgp_as_ipv4_soft_in_cmd
,
5404 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft in",
5408 "Clear peers with the AS number\n"
5410 "Address Family modifier\n"
5411 "Address Family modifier\n"
5413 "Soft reconfig inbound update\n")
5415 if (strncmp (argv
[1], "m", 1) == 0)
5416 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5417 BGP_CLEAR_SOFT_IN
, argv
[0]);
5419 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5420 BGP_CLEAR_SOFT_IN
, argv
[0]);
5423 ALIAS (clear_ip_bgp_as_ipv4_soft_in
,
5424 clear_ip_bgp_as_ipv4_in_cmd
,
5425 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in",
5429 "Clear peers with the AS number\n"
5431 "Address Family modifier\n"
5432 "Address Family modifier\n"
5433 "Soft reconfig inbound update\n")
5435 DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter
,
5436 clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
,
5437 "clear ip bgp <1-65535> ipv4 (unicast|multicast) in prefix-filter",
5441 "Clear peers with the AS number\n"
5443 "Address Family modifier\n"
5444 "Address Family modifier\n"
5445 "Soft reconfig inbound update\n"
5446 "Push out prefix-list ORF and do inbound soft reconfig\n")
5448 if (strncmp (argv
[1], "m", 1) == 0)
5449 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5450 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5452 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5453 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5456 DEFUN (clear_ip_bgp_as_vpnv4_soft_in
,
5457 clear_ip_bgp_as_vpnv4_soft_in_cmd
,
5458 "clear ip bgp <1-65535> vpnv4 unicast soft in",
5462 "Clear peers with the AS number\n"
5464 "Address Family modifier\n"
5466 "Soft reconfig inbound update\n")
5468 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5469 BGP_CLEAR_SOFT_IN
, argv
[0]);
5472 ALIAS (clear_ip_bgp_as_vpnv4_soft_in
,
5473 clear_ip_bgp_as_vpnv4_in_cmd
,
5474 "clear ip bgp <1-65535> vpnv4 unicast in",
5478 "Clear peers with the AS number\n"
5480 "Address Family modifier\n"
5481 "Soft reconfig inbound update\n")
5483 DEFUN (clear_bgp_as_soft_in
,
5484 clear_bgp_as_soft_in_cmd
,
5485 "clear bgp <1-65535> soft in",
5488 "Clear peers with the AS number\n"
5490 "Soft reconfig inbound update\n")
5492 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5493 BGP_CLEAR_SOFT_IN
, argv
[0]);
5496 ALIAS (clear_bgp_as_soft_in
,
5497 clear_bgp_ipv6_as_soft_in_cmd
,
5498 "clear bgp ipv6 <1-65535> soft in",
5502 "Clear peers with the AS number\n"
5504 "Soft reconfig inbound update\n")
5506 ALIAS (clear_bgp_as_soft_in
,
5507 clear_bgp_as_in_cmd
,
5508 "clear bgp <1-65535> in",
5511 "Clear peers with the AS number\n"
5512 "Soft reconfig inbound update\n")
5514 ALIAS (clear_bgp_as_soft_in
,
5515 clear_bgp_ipv6_as_in_cmd
,
5516 "clear bgp ipv6 <1-65535> in",
5520 "Clear peers with the AS number\n"
5521 "Soft reconfig inbound update\n")
5523 DEFUN (clear_bgp_as_in_prefix_filter
,
5524 clear_bgp_as_in_prefix_filter_cmd
,
5525 "clear bgp <1-65535> in prefix-filter",
5528 "Clear peers with the AS number\n"
5529 "Soft reconfig inbound update\n"
5530 "Push out prefix-list ORF and do inbound soft reconfig\n")
5532 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5533 BGP_CLEAR_SOFT_IN_ORF_PREFIX
, argv
[0]);
5536 ALIAS (clear_bgp_as_in_prefix_filter
,
5537 clear_bgp_ipv6_as_in_prefix_filter_cmd
,
5538 "clear bgp ipv6 <1-65535> in prefix-filter",
5542 "Clear peers with the AS number\n"
5543 "Soft reconfig inbound update\n"
5544 "Push out prefix-list ORF and do inbound soft reconfig\n")
5546 /* Both soft-reconfiguration */
5547 DEFUN (clear_ip_bgp_all_soft
,
5548 clear_ip_bgp_all_soft_cmd
,
5549 "clear ip bgp * soft",
5557 return bgp_clear_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
, clear_all
,
5558 BGP_CLEAR_SOFT_BOTH
, NULL
);
5560 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5561 BGP_CLEAR_SOFT_BOTH
, NULL
);
5564 ALIAS (clear_ip_bgp_all_soft
,
5565 clear_ip_bgp_instance_all_soft_cmd
,
5566 "clear ip bgp view WORD * soft",
5576 DEFUN (clear_ip_bgp_all_ipv4_soft
,
5577 clear_ip_bgp_all_ipv4_soft_cmd
,
5578 "clear ip bgp * ipv4 (unicast|multicast) soft",
5584 "Address Family Modifier\n"
5585 "Address Family Modifier\n"
5588 if (strncmp (argv
[0], "m", 1) == 0)
5589 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5590 BGP_CLEAR_SOFT_BOTH
, NULL
);
5592 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5593 BGP_CLEAR_SOFT_BOTH
, NULL
);
5596 DEFUN (clear_ip_bgp_instance_all_ipv4_soft
,
5597 clear_ip_bgp_instance_all_ipv4_soft_cmd
,
5598 "clear ip bgp view WORD * ipv4 (unicast|multicast) soft",
5606 "Address Family Modifier\n"
5607 "Address Family Modifier\n"
5610 if (strncmp (argv
[1], "m", 1) == 0)
5611 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_all
,
5612 BGP_CLEAR_SOFT_BOTH
, NULL
);
5614 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_all
,
5615 BGP_CLEAR_SOFT_BOTH
, NULL
);
5618 DEFUN (clear_ip_bgp_all_vpnv4_soft
,
5619 clear_ip_bgp_all_vpnv4_soft_cmd
,
5620 "clear ip bgp * vpnv4 unicast soft",
5626 "Address Family Modifier\n"
5629 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_all
,
5630 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5633 DEFUN (clear_bgp_all_soft
,
5634 clear_bgp_all_soft_cmd
,
5642 return bgp_clear_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
, clear_all
,
5643 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5645 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_all
,
5646 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5649 ALIAS (clear_bgp_all_soft
,
5650 clear_bgp_instance_all_soft_cmd
,
5651 "clear bgp view WORD * soft",
5659 ALIAS (clear_bgp_all_soft
,
5660 clear_bgp_ipv6_all_soft_cmd
,
5661 "clear bgp ipv6 * soft",
5668 DEFUN (clear_ip_bgp_peer_soft
,
5669 clear_ip_bgp_peer_soft_cmd
,
5670 "clear ip bgp A.B.C.D soft",
5674 "BGP neighbor address to clear\n"
5677 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5678 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5681 DEFUN (clear_ip_bgp_peer_ipv4_soft
,
5682 clear_ip_bgp_peer_ipv4_soft_cmd
,
5683 "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft",
5687 "BGP neighbor address to clear\n"
5689 "Address Family Modifier\n"
5690 "Address Family Modifier\n"
5693 if (strncmp (argv
[1], "m", 1) == 0)
5694 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_peer
,
5695 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5697 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_peer
,
5698 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5701 DEFUN (clear_ip_bgp_peer_vpnv4_soft
,
5702 clear_ip_bgp_peer_vpnv4_soft_cmd
,
5703 "clear ip bgp A.B.C.D vpnv4 unicast soft",
5707 "BGP neighbor address to clear\n"
5709 "Address Family Modifier\n"
5712 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_peer
,
5713 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5716 DEFUN (clear_bgp_peer_soft
,
5717 clear_bgp_peer_soft_cmd
,
5718 "clear bgp (A.B.C.D|X:X::X:X) soft",
5721 "BGP neighbor address to clear\n"
5722 "BGP IPv6 neighbor to clear\n"
5725 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_peer
,
5726 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5729 ALIAS (clear_bgp_peer_soft
,
5730 clear_bgp_ipv6_peer_soft_cmd
,
5731 "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft",
5735 "BGP neighbor address to clear\n"
5736 "BGP IPv6 neighbor to clear\n"
5739 DEFUN (clear_ip_bgp_peer_group_soft
,
5740 clear_ip_bgp_peer_group_soft_cmd
,
5741 "clear ip bgp peer-group WORD soft",
5745 "Clear all members of peer-group\n"
5746 "BGP peer-group name\n"
5749 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5750 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5753 DEFUN (clear_ip_bgp_peer_group_ipv4_soft
,
5754 clear_ip_bgp_peer_group_ipv4_soft_cmd
,
5755 "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
5759 "Clear all members of peer-group\n"
5760 "BGP peer-group name\n"
5762 "Address Family modifier\n"
5763 "Address Family modifier\n"
5766 if (strncmp (argv
[1], "m", 1) == 0)
5767 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_group
,
5768 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5770 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_group
,
5771 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5774 DEFUN (clear_bgp_peer_group_soft
,
5775 clear_bgp_peer_group_soft_cmd
,
5776 "clear bgp peer-group WORD soft",
5779 "Clear all members of peer-group\n"
5780 "BGP peer-group name\n"
5783 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_group
,
5784 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5787 ALIAS (clear_bgp_peer_group_soft
,
5788 clear_bgp_ipv6_peer_group_soft_cmd
,
5789 "clear bgp ipv6 peer-group WORD soft",
5793 "Clear all members of peer-group\n"
5794 "BGP peer-group name\n"
5797 DEFUN (clear_ip_bgp_external_soft
,
5798 clear_ip_bgp_external_soft_cmd
,
5799 "clear ip bgp external soft",
5803 "Clear all external peers\n"
5806 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5807 BGP_CLEAR_SOFT_BOTH
, NULL
);
5810 DEFUN (clear_ip_bgp_external_ipv4_soft
,
5811 clear_ip_bgp_external_ipv4_soft_cmd
,
5812 "clear ip bgp external ipv4 (unicast|multicast) soft",
5816 "Clear all external peers\n"
5818 "Address Family modifier\n"
5819 "Address Family modifier\n"
5822 if (strncmp (argv
[0], "m", 1) == 0)
5823 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_external
,
5824 BGP_CLEAR_SOFT_BOTH
, NULL
);
5826 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_external
,
5827 BGP_CLEAR_SOFT_BOTH
, NULL
);
5830 DEFUN (clear_bgp_external_soft
,
5831 clear_bgp_external_soft_cmd
,
5832 "clear bgp external soft",
5835 "Clear all external peers\n"
5838 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_external
,
5839 BGP_CLEAR_SOFT_BOTH
, NULL
);
5842 ALIAS (clear_bgp_external_soft
,
5843 clear_bgp_ipv6_external_soft_cmd
,
5844 "clear bgp ipv6 external soft",
5848 "Clear all external peers\n"
5851 DEFUN (clear_ip_bgp_as_soft
,
5852 clear_ip_bgp_as_soft_cmd
,
5853 "clear ip bgp <1-65535> soft",
5857 "Clear peers with the AS number\n"
5860 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
, clear_as
,
5861 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5864 DEFUN (clear_ip_bgp_as_ipv4_soft
,
5865 clear_ip_bgp_as_ipv4_soft_cmd
,
5866 "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft",
5870 "Clear peers with the AS number\n"
5872 "Address Family Modifier\n"
5873 "Address Family Modifier\n"
5876 if (strncmp (argv
[1], "m", 1) == 0)
5877 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
, clear_as
,
5878 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5880 return bgp_clear_vty (vty
, NULL
,AFI_IP
, SAFI_UNICAST
, clear_as
,
5881 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5884 DEFUN (clear_ip_bgp_as_vpnv4_soft
,
5885 clear_ip_bgp_as_vpnv4_soft_cmd
,
5886 "clear ip bgp <1-65535> vpnv4 unicast soft",
5890 "Clear peers with the AS number\n"
5892 "Address Family Modifier\n"
5895 return bgp_clear_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
, clear_as
,
5896 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5899 DEFUN (clear_bgp_as_soft
,
5900 clear_bgp_as_soft_cmd
,
5901 "clear bgp <1-65535> soft",
5904 "Clear peers with the AS number\n"
5907 return bgp_clear_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
, clear_as
,
5908 BGP_CLEAR_SOFT_BOTH
, argv
[0]);
5911 ALIAS (clear_bgp_as_soft
,
5912 clear_bgp_ipv6_as_soft_cmd
,
5913 "clear bgp ipv6 <1-65535> soft",
5917 "Clear peers with the AS number\n"
5920 /* Show BGP peer's summary information. */
5922 bgp_show_summary (struct vty
*vty
, struct bgp
*bgp
, int afi
, int safi
)
5925 struct listnode
*nn
;
5927 char timebuf
[BGP_UPTIME_LEN
];
5930 /* Header string for each address family. */
5931 static char header
[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
5933 LIST_LOOP (bgp
->peer
, peer
, nn
)
5935 if (peer
->afc
[afi
][safi
])
5940 "BGP router identifier %s, local AS number %d%s",
5941 inet_ntoa (bgp
->router_id
), bgp
->as
, VTY_NEWLINE
);
5943 "%ld BGP AS-PATH entries%s", aspath_count (),
5946 "%ld BGP community entries%s", community_count (),
5949 if (CHECK_FLAG(bgp
->af_flags
[afi
][safi
], BGP_CONFIG_DAMPENING
))
5950 vty_out (vty
, "Dampening enabled.%s", VTY_NEWLINE
);
5951 vty_out (vty
, "%s", VTY_NEWLINE
);
5952 vty_out (vty
, "%s%s", header
, VTY_NEWLINE
);
5956 len
= vty_out (vty
, "%s", peer
->host
);
5959 vty_out (vty
, "%s%*s", VTY_NEWLINE
, 16, " ");
5961 vty_out (vty
, "%*s", len
, " ");
5963 switch (peer
->version
)
5966 vty_out (vty
, "4 ");
5968 case BGP_VERSION_MP_4_DRAFT_00
:
5969 vty_out (vty
, "4-");
5973 vty_out (vty
, "%5d %7d %7d %8d %4d %4ld ",
5975 peer
->open_in
+ peer
->update_in
+ peer
->keepalive_in
5976 + peer
->notify_in
+ peer
->refresh_in
+ peer
->dynamic_cap_in
,
5977 peer
->open_out
+ peer
->update_out
+ peer
->keepalive_out
5978 + peer
->notify_out
+ peer
->refresh_out
5979 + peer
->dynamic_cap_out
,
5980 0, 0, peer
->obuf
->count
);
5982 vty_out (vty
, "%8s",
5983 peer_uptime (peer
->uptime
, timebuf
, BGP_UPTIME_LEN
));
5985 if (peer
->status
== Established
)
5987 vty_out (vty
, " %8ld", peer
->pcount
[afi
][safi
]);
5991 if (CHECK_FLAG (peer
->flags
, PEER_FLAG_SHUTDOWN
))
5992 vty_out (vty
, " Idle (Admin)");
5993 else if (CHECK_FLAG (peer
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
5994 vty_out (vty
, " Idle (PfxCt)");
5996 vty_out (vty
, " %-11s", LOOKUP(bgp_status_msg
, peer
->status
));
5999 vty_out (vty
, "%s", VTY_NEWLINE
);
6004 vty_out (vty
, "%sTotal number of neighbors %d%s", VTY_NEWLINE
,
6005 count
, VTY_NEWLINE
);
6007 vty_out (vty
, "No %s neighbor is configured%s",
6008 afi
== AFI_IP
? "IPv4" : "IPv6", VTY_NEWLINE
);
6013 bgp_show_summary_vty (struct vty
*vty
, char *name
, afi_t afi
, safi_t safi
)
6019 bgp
= bgp_lookup_by_name (name
);
6023 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6027 bgp_show_summary (vty
, bgp
, afi
, safi
);
6031 bgp
= bgp_get_default ();
6034 bgp_show_summary (vty
, bgp
, afi
, safi
);
6039 /* `show ip bgp summary' commands. */
6040 DEFUN (show_ip_bgp_summary
,
6041 show_ip_bgp_summary_cmd
,
6042 "show ip bgp summary",
6046 "Summary of BGP neighbor status\n")
6048 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6051 DEFUN (show_ip_bgp_instance_summary
,
6052 show_ip_bgp_instance_summary_cmd
,
6053 "show ip bgp view WORD summary",
6059 "Summary of BGP neighbor status\n")
6061 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6064 DEFUN (show_ip_bgp_ipv4_summary
,
6065 show_ip_bgp_ipv4_summary_cmd
,
6066 "show ip bgp ipv4 (unicast|multicast) summary",
6071 "Address Family modifier\n"
6072 "Address Family modifier\n"
6073 "Summary of BGP neighbor status\n")
6075 if (strncmp (argv
[0], "m", 1) == 0)
6076 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MULTICAST
);
6078 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_UNICAST
);
6081 DEFUN (show_ip_bgp_instance_ipv4_summary
,
6082 show_ip_bgp_instance_ipv4_summary_cmd
,
6083 "show ip bgp view WORD ipv4 (unicast|multicast) summary",
6090 "Address Family modifier\n"
6091 "Address Family modifier\n"
6092 "Summary of BGP neighbor status\n")
6094 if (strncmp (argv
[1], "m", 1) == 0)
6095 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_MULTICAST
);
6097 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP
, SAFI_UNICAST
);
6100 DEFUN (show_ip_bgp_vpnv4_all_summary
,
6101 show_ip_bgp_vpnv4_all_summary_cmd
,
6102 "show ip bgp vpnv4 all summary",
6106 "Display VPNv4 NLRI specific information\n"
6107 "Display information about all VPNv4 NLRIs\n"
6108 "Summary of BGP neighbor status\n")
6110 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6113 DEFUN (show_ip_bgp_vpnv4_rd_summary
,
6114 show_ip_bgp_vpnv4_rd_summary_cmd
,
6115 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary",
6119 "Display VPNv4 NLRI specific information\n"
6120 "Display information for a route distinguisher\n"
6121 "VPN Route Distinguisher\n"
6122 "Summary of BGP neighbor status\n")
6125 struct prefix_rd prd
;
6127 ret
= str2prefix_rd (argv
[0], &prd
);
6130 vty_out (vty
, "%% Malformed Route Distinguisher%s", VTY_NEWLINE
);
6134 return bgp_show_summary_vty (vty
, NULL
, AFI_IP
, SAFI_MPLS_VPN
);
6138 DEFUN (show_bgp_summary
,
6139 show_bgp_summary_cmd
,
6143 "Summary of BGP neighbor status\n")
6145 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6148 DEFUN (show_bgp_instance_summary
,
6149 show_bgp_instance_summary_cmd
,
6150 "show bgp view WORD summary",
6155 "Summary of BGP neighbor status\n")
6157 return bgp_show_summary_vty (vty
, argv
[0], AFI_IP6
, SAFI_UNICAST
);
6160 ALIAS (show_bgp_summary
,
6161 show_bgp_ipv6_summary_cmd
,
6162 "show bgp ipv6 summary",
6166 "Summary of BGP neighbor status\n")
6168 ALIAS (show_bgp_instance_summary
,
6169 show_bgp_instance_ipv6_summary_cmd
,
6170 "show bgp view WORD ipv6 summary",
6176 "Summary of BGP neighbor status\n")
6179 DEFUN (show_ipv6_bgp_summary
,
6180 show_ipv6_bgp_summary_cmd
,
6181 "show ipv6 bgp summary",
6185 "Summary of BGP neighbor status\n")
6187 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_UNICAST
);
6191 DEFUN (show_ipv6_mbgp_summary
,
6192 show_ipv6_mbgp_summary_cmd
,
6193 "show ipv6 mbgp summary",
6197 "Summary of BGP neighbor status\n")
6199 return bgp_show_summary_vty (vty
, NULL
, AFI_IP6
, SAFI_MULTICAST
);
6201 #endif /* HAVE_IPV6 */
6203 /* Show BGP peer's information. */
6211 bgp_show_peer_afi_orf_cap (struct vty
*vty
, struct peer
*p
,
6212 afi_t afi
, safi_t safi
,
6213 u_int16_t adv_smcap
, u_int16_t adv_rmcap
,
6214 u_int16_t rcv_smcap
, u_int16_t rcv_rmcap
)
6217 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
)
6218 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6220 vty_out (vty
, " Send-mode: ");
6221 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
))
6222 vty_out (vty
, "advertised");
6223 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_smcap
))
6224 vty_out (vty
, "%sreceived",
6225 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_smcap
) ?
6227 vty_out (vty
, "%s", VTY_NEWLINE
);
6231 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
)
6232 || CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6234 vty_out (vty
, " Receive-mode: ");
6235 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
))
6236 vty_out (vty
, "advertised");
6237 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], rcv_rmcap
))
6238 vty_out (vty
, "%sreceived",
6239 CHECK_FLAG (p
->af_cap
[afi
][safi
], adv_rmcap
) ?
6241 vty_out (vty
, "%s", VTY_NEWLINE
);
6246 bgp_show_peer_afi (struct vty
*vty
, struct peer
*p
, afi_t afi
, safi_t safi
)
6248 struct bgp_filter
*filter
;
6249 char orf_pfx_name
[BUFSIZ
];
6252 filter
= &p
->filter
[afi
][safi
];
6254 vty_out (vty
, " For address family: %s %s%s",
6255 afi
== AFI_IP6
? "IPv6" :
6256 safi
== SAFI_MPLS_VPN
? "VPNv4" : "IPv4",
6257 safi
== SAFI_MULTICAST
? "Multicast" : "Unicast",
6259 if (p
->af_group
[afi
][safi
])
6260 vty_out (vty
, " %s peer-group member%s", p
->group
->name
, VTY_NEWLINE
);
6262 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6263 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6264 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6265 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6266 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
)
6267 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6268 vty_out (vty
, " AF-dependant capabilities:%s", VTY_NEWLINE
);
6270 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6271 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_RCV
)
6272 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6273 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_RCV
))
6275 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6276 ORF_TYPE_PREFIX
, VTY_NEWLINE
);
6277 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6278 PEER_CAP_ORF_PREFIX_SM_ADV
,
6279 PEER_CAP_ORF_PREFIX_RM_ADV
,
6280 PEER_CAP_ORF_PREFIX_SM_RCV
,
6281 PEER_CAP_ORF_PREFIX_RM_RCV
);
6283 if (CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_ADV
)
6284 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_SM_OLD_RCV
)
6285 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_ADV
)
6286 || CHECK_FLAG (p
->af_cap
[afi
][safi
], PEER_CAP_ORF_PREFIX_RM_OLD_RCV
))
6288 vty_out (vty
, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
6289 ORF_TYPE_PREFIX_OLD
, VTY_NEWLINE
);
6290 bgp_show_peer_afi_orf_cap (vty
, p
, afi
, safi
,
6291 PEER_CAP_ORF_PREFIX_SM_ADV
,
6292 PEER_CAP_ORF_PREFIX_RM_ADV
,
6293 PEER_CAP_ORF_PREFIX_SM_OLD_RCV
,
6294 PEER_CAP_ORF_PREFIX_RM_OLD_RCV
);
6297 sprintf (orf_pfx_name
, "%s.%d.%d", p
->host
, afi
, safi
);
6298 orf_pfx_count
= prefix_bgp_show_prefix_list (NULL
, afi
, orf_pfx_name
);
6300 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
)
6303 vty_out (vty
, " Outbound Route Filter (ORF):");
6304 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_PREFIX_SEND
))
6305 vty_out (vty
, " sent;");
6307 vty_out (vty
, " received (%d entries)", orf_pfx_count
);
6308 vty_out (vty
, "%s", VTY_NEWLINE
);
6310 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_ORF_WAIT_REFRESH
))
6311 vty_out (vty
, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE
);
6313 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REFLECTOR_CLIENT
))
6314 vty_out (vty
, " Route-Reflector Client%s", VTY_NEWLINE
);
6315 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_RSERVER_CLIENT
))
6316 vty_out (vty
, " Route-Server Client%s", VTY_NEWLINE
);
6317 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SOFT_RECONFIG
))
6318 vty_out (vty
, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE
);
6319 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_REMOVE_PRIVATE_AS
))
6320 vty_out (vty
, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE
);
6321 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_SELF
))
6322 vty_out (vty
, " NEXT_HOP is always this router%s", VTY_NEWLINE
);
6323 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_AS_PATH_UNCHANGED
))
6324 vty_out (vty
, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6325 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_NEXTHOP_UNCHANGED
))
6326 vty_out (vty
, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6327 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MED_UNCHANGED
))
6328 vty_out (vty
, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE
);
6329 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6330 || CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6332 vty_out (vty
, " Community attribute sent to this neighbor");
6333 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_COMMUNITY
)
6334 && CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6335 vty_out (vty
, " (both)%s", VTY_NEWLINE
);
6336 else if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_SEND_EXT_COMMUNITY
))
6337 vty_out (vty
, " (extended)%s", VTY_NEWLINE
);
6339 vty_out (vty
, " (standard)%s", VTY_NEWLINE
);
6341 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_DEFAULT_ORIGINATE
))
6343 vty_out (vty
, " Default information originate,");
6345 if (p
->default_rmap
[afi
][safi
].name
)
6346 vty_out (vty
, " default route-map %s%s,",
6347 p
->default_rmap
[afi
][safi
].map
? "*" : "",
6348 p
->default_rmap
[afi
][safi
].name
);
6349 if (CHECK_FLAG (p
->af_sflags
[afi
][safi
], PEER_STATUS_DEFAULT_ORIGINATE
))
6350 vty_out (vty
, " default sent%s", VTY_NEWLINE
);
6352 vty_out (vty
, " default not sent%s", VTY_NEWLINE
);
6355 if (filter
->plist
[FILTER_IN
].name
6356 || filter
->dlist
[FILTER_IN
].name
6357 || filter
->aslist
[FILTER_IN
].name
6358 || filter
->map
[FILTER_IN
].name
)
6359 vty_out (vty
, " Inbound path policy configured%s", VTY_NEWLINE
);
6360 if (filter
->plist
[FILTER_OUT
].name
6361 || filter
->dlist
[FILTER_OUT
].name
6362 || filter
->aslist
[FILTER_OUT
].name
6363 || filter
->map
[FILTER_OUT
].name
6364 || filter
->usmap
.name
)
6365 vty_out (vty
, " Outbound path policy configured%s", VTY_NEWLINE
);
6368 if (filter
->plist
[FILTER_IN
].name
)
6369 vty_out (vty
, " Incoming update prefix filter list is %s%s%s",
6370 filter
->plist
[FILTER_IN
].plist
? "*" : "",
6371 filter
->plist
[FILTER_IN
].name
,
6373 if (filter
->plist
[FILTER_OUT
].name
)
6374 vty_out (vty
, " Outgoing update prefix filter list is %s%s%s",
6375 filter
->plist
[FILTER_OUT
].plist
? "*" : "",
6376 filter
->plist
[FILTER_OUT
].name
,
6379 /* distribute-list */
6380 if (filter
->dlist
[FILTER_IN
].name
)
6381 vty_out (vty
, " Incoming update network filter list is %s%s%s",
6382 filter
->dlist
[FILTER_IN
].alist
? "*" : "",
6383 filter
->dlist
[FILTER_IN
].name
,
6385 if (filter
->dlist
[FILTER_OUT
].name
)
6386 vty_out (vty
, " Outgoing update network filter list is %s%s%s",
6387 filter
->dlist
[FILTER_OUT
].alist
? "*" : "",
6388 filter
->dlist
[FILTER_OUT
].name
,
6392 if (filter
->aslist
[FILTER_IN
].name
)
6393 vty_out (vty
, " Incoming update AS path filter list is %s%s%s",
6394 filter
->aslist
[FILTER_IN
].aslist
? "*" : "",
6395 filter
->aslist
[FILTER_IN
].name
,
6397 if (filter
->aslist
[FILTER_OUT
].name
)
6398 vty_out (vty
, " Outgoing update AS path filter list is %s%s%s",
6399 filter
->aslist
[FILTER_OUT
].aslist
? "*" : "",
6400 filter
->aslist
[FILTER_OUT
].name
,
6404 if (filter
->map
[FILTER_IN
].name
)
6405 vty_out (vty
, " Route map for incoming advertisements is %s%s%s",
6406 filter
->map
[FILTER_IN
].map
? "*" : "",
6407 filter
->map
[FILTER_IN
].name
,
6409 if (filter
->map
[FILTER_OUT
].name
)
6410 vty_out (vty
, " Route map for outgoing advertisements is %s%s%s",
6411 filter
->map
[FILTER_OUT
].map
? "*" : "",
6412 filter
->map
[FILTER_OUT
].name
,
6415 /* unsuppress-map */
6416 if (filter
->usmap
.name
)
6417 vty_out (vty
, " Route map for selective unsuppress is %s%s%s",
6418 filter
->usmap
.map
? "*" : "",
6419 filter
->usmap
.name
, VTY_NEWLINE
);
6421 /* Receive prefix count */
6422 vty_out (vty
, " %ld accepted prefixes",
6423 p
->pcount
[afi
][safi
]);
6424 /* Maximum prefix */
6425 if (CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX
))
6427 vty_out (vty
, ", maximum limit %ld%s",
6429 CHECK_FLAG (p
->af_flags
[afi
][safi
], PEER_FLAG_MAX_PREFIX_WARNING
)
6430 ? " (warning-only)" : "");
6432 vty_out (vty
, "%s", VTY_NEWLINE
);
6434 vty_out (vty
, "%s", VTY_NEWLINE
);
6438 bgp_show_peer (struct vty
*vty
, struct peer
*p
)
6442 char timebuf
[BGP_UPTIME_LEN
];
6446 /* Configured IP address. */
6447 vty_out (vty
, "BGP neighbor is %s, ", p
->host
);
6448 vty_out (vty
, "remote AS %d, ", p
->as
);
6449 vty_out (vty
, "local AS %d%s, ",
6450 p
->change_local_as
? p
->change_local_as
: p
->local_as
,
6451 CHECK_FLAG (p
->flags
, PEER_FLAG_LOCAL_AS_NO_PREPEND
) ?
6452 " no-prepend" : "");
6453 vty_out (vty
, "%s link%s",
6454 p
->as
== p
->local_as
? "internal" : "external",
6459 vty_out (vty
, " Description: %s%s", p
->desc
, VTY_NEWLINE
);
6463 vty_out (vty
, " Member of peer-group %s for session parameters%s",
6464 p
->group
->name
, VTY_NEWLINE
);
6466 /* Administrative shutdown. */
6467 if (CHECK_FLAG (p
->flags
, PEER_FLAG_SHUTDOWN
))
6468 vty_out (vty
, " Administratively shut down%s", VTY_NEWLINE
);
6471 vty_out (vty
, " BGP version 4");
6472 if (p
->version
== BGP_VERSION_MP_4_DRAFT_00
)
6473 vty_out (vty
, "(with draft-00 verion of multiporotocol extension)");
6474 vty_out (vty
, ", remote router ID %s%s",
6475 inet_ntop (AF_INET
, &p
->remote_id
, buf1
, BUFSIZ
),
6479 if (bgp_confederation_peers_check (bgp
, p
->as
))
6480 vty_out (vty
, " Neighbor under common administration%s", VTY_NEWLINE
);
6483 vty_out (vty
, " BGP state = %s",
6484 LOOKUP (bgp_status_msg
, p
->status
));
6485 if (p
->status
== Established
)
6486 vty_out (vty
, ", up for %8s",
6487 peer_uptime (p
->uptime
, timebuf
, BGP_UPTIME_LEN
));
6488 vty_out (vty
, "%s", VTY_NEWLINE
);
6491 vty_out (vty
, " Last read %s", peer_uptime (p
->readtime
, timebuf
, BGP_UPTIME_LEN
));
6493 /* Configured timer values. */
6494 vty_out (vty
, ", hold time is %d, keepalive interval is %d seconds%s",
6495 p
->v_holdtime
, p
->v_keepalive
, VTY_NEWLINE
);
6496 if (CHECK_FLAG (p
->config
, PEER_CONFIG_TIMER
))
6498 vty_out (vty
, " Configured hold time is %d", p
->holdtime
);
6499 vty_out (vty
, ", keepalive interval is %d seconds%s",
6500 p
->keepalive
, VTY_NEWLINE
);
6504 if (p
->status
== Established
)
6506 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
6507 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6508 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
)
6509 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
)
6510 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
6511 || p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
6512 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
]
6513 || p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
]
6514 || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
]
6516 || p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
]
6517 || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
]
6518 || p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
]
6519 || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
]
6520 #endif /* HAVE_IPV6 */
6521 || p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
]
6522 || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
6524 vty_out (vty
, " Neighbor capabilities:%s", VTY_NEWLINE
);
6527 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
)
6528 || CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
6530 vty_out (vty
, " Dynamic:");
6531 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
6532 vty_out (vty
, " advertised");
6533 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_RCV
))
6535 if (CHECK_FLAG (p
->cap
, PEER_CAP_DYNAMIC_ADV
))
6536 vty_out (vty
, " and");
6537 vty_out (vty
, " received");
6539 vty_out (vty
, "%s", VTY_NEWLINE
);
6543 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
)
6544 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6545 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6547 vty_out (vty
, " Route refresh:");
6548 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
6549 vty_out (vty
, " advertised");
6550 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6551 || CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6553 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_ADV
))
6554 vty_out (vty
, " and");
6555 vty_out (vty
, " received");
6556 if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_NEW_RCV
)
6557 && CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6558 vty_out (vty
, " (old and new)");
6559 else if (CHECK_FLAG (p
->cap
, PEER_CAP_REFRESH_OLD_RCV
))
6560 vty_out (vty
, " (old)");
6562 vty_out (vty
, " (new)");
6564 vty_out (vty
, "%s", VTY_NEWLINE
);
6568 if (p
->afc_adv
[AFI_IP
][SAFI_UNICAST
]
6569 || p
->afc_recv
[AFI_IP
][SAFI_UNICAST
])
6571 vty_out (vty
, " Address family IPv4 Unicast:");
6572 if (p
->afc_adv
[AFI_IP
][SAFI_UNICAST
])
6573 vty_out (vty
, " advertised");
6574 if (p
->afc_recv
[AFI_IP
][SAFI_UNICAST
])
6576 if (p
->afc_adv
[AFI_IP
][SAFI_UNICAST
])
6577 vty_out (vty
, " and");
6578 vty_out (vty
, " received");
6580 vty_out (vty
, "%s", VTY_NEWLINE
);
6582 if (p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
] || p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
])
6584 vty_out (vty
, " Address family IPv4 Multicast:");
6585 if (p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
])
6586 vty_out (vty
, " advertised");
6587 if (p
->afc_recv
[AFI_IP
][SAFI_MULTICAST
])
6589 if (p
->afc_adv
[AFI_IP
][SAFI_MULTICAST
])
6590 vty_out (vty
, " and");
6591 vty_out (vty
, " received");
6593 vty_out (vty
, "%s", VTY_NEWLINE
);
6595 if (p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
] || p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
6597 vty_out (vty
, " Address family VPNv4 Unicast:");
6598 if (p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
])
6599 vty_out (vty
, " advertised");
6600 if (p
->afc_recv
[AFI_IP
][SAFI_MPLS_VPN
])
6602 if (p
->afc_adv
[AFI_IP
][SAFI_MPLS_VPN
])
6603 vty_out (vty
, " and");
6604 vty_out (vty
, " received");
6606 vty_out (vty
, "%s", VTY_NEWLINE
);
6610 if (p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
] || p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
])
6612 vty_out (vty
, " Address family IPv6 Unicast:");
6613 if (p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
])
6614 vty_out (vty
, " advertised");
6615 if (p
->afc_recv
[AFI_IP6
][SAFI_UNICAST
])
6617 if (p
->afc_adv
[AFI_IP6
][SAFI_UNICAST
])
6618 vty_out (vty
, " and");
6619 vty_out (vty
, " received");
6621 vty_out (vty
, "%s", VTY_NEWLINE
);
6623 if (p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
] || p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
])
6625 vty_out (vty
, " Address family IPv6 Multicast:");
6626 if (p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
])
6627 vty_out (vty
, " advertised");
6628 if (p
->afc_recv
[AFI_IP6
][SAFI_MULTICAST
])
6630 if (p
->afc_adv
[AFI_IP6
][SAFI_MULTICAST
])
6631 vty_out (vty
, " and");
6632 vty_out (vty
, " received");
6634 vty_out (vty
, "%s", VTY_NEWLINE
);
6636 #endif /* HAVE_IPV6 */
6640 /* Packet counts. */
6641 vty_out(vty
, " Received %d messages, %d notifications, %d in queue%s",
6642 p
->open_in
+ p
->update_in
+ p
->keepalive_in
+ p
->refresh_in
6643 + p
->dynamic_cap_in
, p
->notify_in
, 0, VTY_NEWLINE
);
6644 vty_out(vty
, " Sent %d messages, %d notifications, %ld in queue%s",
6645 p
->open_out
+ p
->update_out
+ p
->keepalive_out
+ p
->refresh_out
6646 + p
->dynamic_cap_out
, p
->notify_out
, p
->obuf
->count
, VTY_NEWLINE
);
6647 vty_out(vty
, " Route refresh request: received %d, sent %d%s",
6648 p
->refresh_in
, p
->refresh_out
, VTY_NEWLINE
);
6650 /* advertisement-interval */
6651 vty_out (vty
, " Minimum time between advertisement runs is %d seconds%s",
6652 p
->v_routeadv
, VTY_NEWLINE
);
6654 /* Update-source. */
6655 if (p
->update_if
|| p
->update_source
)
6657 vty_out (vty
, " Update source is ");
6659 vty_out (vty
, "%s", p
->update_if
);
6660 else if (p
->update_source
)
6662 sockunion2str (p
->update_source
, buf1
, SU_ADDRSTRLEN
));
6663 vty_out (vty
, "%s", VTY_NEWLINE
);
6666 /* Default weight */
6667 if (CHECK_FLAG (p
->config
, PEER_CONFIG_WEIGHT
))
6668 vty_out (vty
, " Default weight %d%s", p
->weight
,
6671 vty_out (vty
, "%s", VTY_NEWLINE
);
6673 /* Address Family Information */
6674 if (p
->afc
[AFI_IP
][SAFI_UNICAST
])
6675 bgp_show_peer_afi (vty
, p
, AFI_IP
, SAFI_UNICAST
);
6676 if (p
->afc
[AFI_IP
][SAFI_MULTICAST
])
6677 bgp_show_peer_afi (vty
, p
, AFI_IP
, SAFI_MULTICAST
);
6678 if (p
->afc
[AFI_IP
][SAFI_MPLS_VPN
])
6679 bgp_show_peer_afi (vty
, p
, AFI_IP
, SAFI_MPLS_VPN
);
6681 if (p
->afc
[AFI_IP6
][SAFI_UNICAST
])
6682 bgp_show_peer_afi (vty
, p
, AFI_IP6
, SAFI_UNICAST
);
6683 if (p
->afc
[AFI_IP6
][SAFI_MULTICAST
])
6684 bgp_show_peer_afi (vty
, p
, AFI_IP6
, SAFI_MULTICAST
);
6685 #endif /* HAVE_IPV6 */
6687 vty_out (vty
, " Connections established %d; dropped %d%s",
6688 p
->established
, p
->dropped
,
6691 vty_out (vty
, " Last reset %s%s", p
->dropped
? peer_uptime (p
->resettime
, timebuf
, BGP_UPTIME_LEN
) : "never",
6694 if (CHECK_FLAG (p
->sflags
, PEER_STATUS_PREFIX_OVERFLOW
))
6696 vty_out (vty
, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE
);
6697 vty_out (vty
, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
6698 p
->host
, VTY_NEWLINE
);
6702 if (peer_sort (p
) != BGP_PEER_IBGP
&& p
->ttl
> 1)
6703 vty_out (vty
, " External BGP neighbor may be up to %d hops away.%s",
6704 p
->ttl
, VTY_NEWLINE
);
6706 /* Local address. */
6709 vty_out (vty
, "Local host: %s, Local port: %d%s%s",
6710 sockunion2str (p
->su_local
, buf1
, SU_ADDRSTRLEN
),
6711 ntohs (p
->su_local
->sin
.sin_port
),
6712 CHECK_FLAG (p
->flags
, PEER_FLAG_PASSIVE
) ?
6713 ", passive-mode" : "",
6717 /* Remote address. */
6720 vty_out (vty
, "Foreign host: %s, Foreign port: %d%s",
6721 sockunion2str (p
->su_remote
, buf1
, SU_ADDRSTRLEN
),
6722 ntohs (p
->su_remote
->sin
.sin_port
),
6726 /* Nexthop display. */
6729 vty_out (vty
, "Nexthop: %s%s",
6730 inet_ntop (AF_INET
, &p
->nexthop
.v4
, buf1
, BUFSIZ
),
6733 vty_out (vty
, "Nexthop global: %s%s",
6734 inet_ntop (AF_INET6
, &p
->nexthop
.v6_global
, buf1
, BUFSIZ
),
6736 vty_out (vty
, "Nexthop local: %s%s",
6737 inet_ntop (AF_INET6
, &p
->nexthop
.v6_local
, buf1
, BUFSIZ
),
6739 vty_out (vty
, "BGP connection: %s%s",
6740 p
->shared_network
? "shared network" : "non shared network",
6742 #endif /* HAVE_IPV6 */
6745 /* Timer information. */
6747 vty_out (vty
, "Next start timer due in %ld seconds%s",
6748 thread_timer_remain_second (p
->t_start
), VTY_NEWLINE
);
6750 vty_out (vty
, "Next connect timer due in %ld seconds%s",
6751 thread_timer_remain_second (p
->t_connect
), VTY_NEWLINE
);
6753 vty_out (vty
, "Read thread: %s Write thread: %s%s",
6754 p
->t_read
? "on" : "off",
6755 p
->t_write
? "on" : "off",
6758 if (p
->notify
.code
== BGP_NOTIFY_OPEN_ERR
6759 && p
->notify
.subcode
== BGP_NOTIFY_OPEN_UNSUP_CAPBL
)
6760 bgp_capability_vty_out (vty
, p
);
6762 vty_out (vty
, "%s", VTY_NEWLINE
);
6766 bgp_show_neighbor (struct vty
*vty
, struct bgp
*bgp
,
6767 enum show_type type
, union sockunion
*su
)
6769 struct listnode
*nn
;
6773 LIST_LOOP (bgp
->peer
, peer
, nn
)
6778 bgp_show_peer (vty
, peer
);
6781 if (sockunion_same (&peer
->su
, su
))
6784 bgp_show_peer (vty
, peer
);
6790 if (type
== show_peer
&& ! find
)
6791 vty_out (vty
, "%% No such neighbor%s", VTY_NEWLINE
);
6797 bgp_show_neighbor_vty (struct vty
*vty
, char *name
, enum show_type type
,
6806 ret
= str2sockunion (ip_str
, &su
);
6809 vty_out (vty
, "%% Malformed address: %s%s", ip_str
, VTY_NEWLINE
);
6816 bgp
= bgp_lookup_by_name (name
);
6820 vty_out (vty
, "%% No such BGP instance exist%s", VTY_NEWLINE
);
6824 bgp_show_neighbor (vty
, bgp
, type
, &su
);
6829 bgp
= bgp_get_default ();
6832 bgp_show_neighbor (vty
, bgp
, type
, &su
);
6837 /* "show ip bgp neighbors" commands. */
6838 DEFUN (show_ip_bgp_neighbors
,
6839 show_ip_bgp_neighbors_cmd
,
6840 "show ip bgp neighbors",
6844 "Detailed information on TCP and BGP neighbor connections\n")
6846 return bgp_show_neighbor_vty (vty
, NULL
, show_all
, NULL
);
6849 ALIAS (show_ip_bgp_neighbors
,
6850 show_ip_bgp_ipv4_neighbors_cmd
,
6851 "show ip bgp ipv4 (unicast|multicast) neighbors",
6856 "Address Family modifier\n"
6857 "Address Family modifier\n"
6858 "Detailed information on TCP and BGP neighbor connections\n")
6860 ALIAS (show_ip_bgp_neighbors
,
6861 show_ip_bgp_vpnv4_all_neighbors_cmd
,
6862 "show ip bgp vpnv4 all neighbors",
6866 "Display VPNv4 NLRI specific information\n"
6867 "Display information about all VPNv4 NLRIs\n"
6868 "Detailed information on TCP and BGP neighbor connections\n")
6870 ALIAS (show_ip_bgp_neighbors
,
6871 show_ip_bgp_vpnv4_rd_neighbors_cmd
,
6872 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
6876 "Display VPNv4 NLRI specific information\n"
6877 "Display information for a route distinguisher\n"
6878 "VPN Route Distinguisher\n"
6879 "Detailed information on TCP and BGP neighbor connections\n")
6881 ALIAS (show_ip_bgp_neighbors
,
6882 show_bgp_neighbors_cmd
,
6883 "show bgp neighbors",
6886 "Detailed information on TCP and BGP neighbor connections\n")
6888 ALIAS (show_ip_bgp_neighbors
,
6889 show_bgp_ipv6_neighbors_cmd
,
6890 "show bgp ipv6 neighbors",
6894 "Detailed information on TCP and BGP neighbor connections\n")
6896 DEFUN (show_ip_bgp_neighbors_peer
,
6897 show_ip_bgp_neighbors_peer_cmd
,
6898 "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
6902 "Detailed information on TCP and BGP neighbor connections\n"
6903 "Neighbor to display information about\n"
6904 "Neighbor to display information about\n")
6906 return bgp_show_neighbor_vty (vty
, NULL
, show_peer
, argv
[argc
- 1]);
6909 ALIAS (show_ip_bgp_neighbors_peer
,
6910 show_ip_bgp_ipv4_neighbors_peer_cmd
,
6911 "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
6916 "Address Family modifier\n"
6917 "Address Family modifier\n"
6918 "Detailed information on TCP and BGP neighbor connections\n"
6919 "Neighbor to display information about\n"
6920 "Neighbor to display information about\n")
6922 ALIAS (show_ip_bgp_neighbors_peer
,
6923 show_ip_bgp_vpnv4_all_neighbors_peer_cmd
,
6924 "show ip bgp vpnv4 all neighbors A.B.C.D",
6928 "Display VPNv4 NLRI specific information\n"
6929 "Display information about all VPNv4 NLRIs\n"
6930 "Detailed information on TCP and BGP neighbor connections\n"
6931 "Neighbor to display information about\n")
6933 ALIAS (show_ip_bgp_neighbors_peer
,
6934 show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
,
6935 "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
6939 "Display VPNv4 NLRI specific information\n"
6940 "Display information about all VPNv4 NLRIs\n"
6941 "Detailed information on TCP and BGP neighbor connections\n"
6942 "Neighbor to display information about\n")
6944 ALIAS (show_ip_bgp_neighbors_peer
,
6945 show_bgp_neighbors_peer_cmd
,
6946 "show bgp neighbors (A.B.C.D|X:X::X:X)",
6949 "Detailed information on TCP and BGP neighbor connections\n"
6950 "Neighbor to display information about\n"
6951 "Neighbor to display information about\n")
6953 ALIAS (show_ip_bgp_neighbors_peer
,
6954 show_bgp_ipv6_neighbors_peer_cmd
,
6955 "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
6959 "Detailed information on TCP and BGP neighbor connections\n"
6960 "Neighbor to display information about\n"
6961 "Neighbor to display information about\n")
6963 DEFUN (show_ip_bgp_instance_neighbors
,
6964 show_ip_bgp_instance_neighbors_cmd
,
6965 "show ip bgp view WORD neighbors",
6971 "Detailed information on TCP and BGP neighbor connections\n")
6973 return bgp_show_neighbor_vty (vty
, argv
[0], show_all
, NULL
);
6976 ALIAS (show_ip_bgp_instance_neighbors
,
6977 show_bgp_instance_neighbors_cmd
,
6978 "show bgp view WORD neighbors",
6983 "Detailed information on TCP and BGP neighbor connections\n")
6985 ALIAS (show_ip_bgp_instance_neighbors
,
6986 show_bgp_instance_ipv6_neighbors_cmd
,
6987 "show bgp view WORD ipv6 neighbors",
6993 "Detailed information on TCP and BGP neighbor connections\n")
6995 DEFUN (show_ip_bgp_instance_neighbors_peer
,
6996 show_ip_bgp_instance_neighbors_peer_cmd
,
6997 "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7003 "Detailed information on TCP and BGP neighbor connections\n"
7004 "Neighbor to display information about\n"
7005 "Neighbor to display information about\n")
7007 return bgp_show_neighbor_vty (vty
, argv
[0], show_peer
, argv
[1]);
7010 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7011 show_bgp_instance_neighbors_peer_cmd
,
7012 "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
7017 "Detailed information on TCP and BGP neighbor connections\n"
7018 "Neighbor to display information about\n"
7019 "Neighbor to display information about\n")
7021 ALIAS (show_ip_bgp_instance_neighbors_peer
,
7022 show_bgp_instance_ipv6_neighbors_peer_cmd
,
7023 "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)",
7029 "Detailed information on TCP and BGP neighbor connections\n"
7030 "Neighbor to display information about\n"
7031 "Neighbor to display information about\n")
7033 /* Show BGP's AS paths internal data. There are both `show ip bgp
7034 paths' and `show ip mbgp paths'. Those functions results are the
7036 DEFUN (show_ip_bgp_paths
,
7037 show_ip_bgp_paths_cmd
,
7038 "show ip bgp paths",
7042 "Path information\n")
7044 vty_out (vty
, "Address Refcnt Path%s", VTY_NEWLINE
);
7045 aspath_print_all_vty (vty
);
7049 DEFUN (show_ip_bgp_ipv4_paths
,
7050 show_ip_bgp_ipv4_paths_cmd
,
7051 "show ip bgp ipv4 (unicast|multicast) paths",
7056 "Address Family modifier\n"
7057 "Address Family modifier\n"
7058 "Path information\n")
7060 vty_out (vty
, "Address Refcnt Path\r\n");
7061 aspath_print_all_vty (vty
);
7069 community_show_all_iterator (struct hash_backet
*backet
, struct vty
*vty
)
7071 struct community
*com
;
7073 com
= (struct community
*) backet
->data
;
7074 vty_out (vty
, "[%p] (%ld) %s%s", backet
, com
->refcnt
,
7075 community_str (com
), VTY_NEWLINE
);
7078 /* Show BGP's community internal data. */
7079 DEFUN (show_ip_bgp_community_info
,
7080 show_ip_bgp_community_info_cmd
,
7081 "show ip bgp community-info",
7085 "List all bgp community information\n")
7087 vty_out (vty
, "Address Refcnt Community%s", VTY_NEWLINE
);
7089 hash_iterate (community_hash (),
7090 (void (*) (struct hash_backet
*, void *))
7091 community_show_all_iterator
,
7097 DEFUN (show_ip_bgp_attr_info
,
7098 show_ip_bgp_attr_info_cmd
,
7099 "show ip bgp attribute-info",
7103 "List all bgp attribute information\n")
7105 attr_show_all (vty
);
7109 /* Redistribute VTY commands. */
7111 /* Utility function to convert user input route type string to route
7114 bgp_str2route_type (int afi
, char *str
)
7121 if (strncmp (str
, "k", 1) == 0)
7122 return ZEBRA_ROUTE_KERNEL
;
7123 else if (strncmp (str
, "c", 1) == 0)
7124 return ZEBRA_ROUTE_CONNECT
;
7125 else if (strncmp (str
, "s", 1) == 0)
7126 return ZEBRA_ROUTE_STATIC
;
7127 else if (strncmp (str
, "r", 1) == 0)
7128 return ZEBRA_ROUTE_RIP
;
7129 else if (strncmp (str
, "o", 1) == 0)
7130 return ZEBRA_ROUTE_OSPF
;
7134 if (strncmp (str
, "k", 1) == 0)
7135 return ZEBRA_ROUTE_KERNEL
;
7136 else if (strncmp (str
, "c", 1) == 0)
7137 return ZEBRA_ROUTE_CONNECT
;
7138 else if (strncmp (str
, "s", 1) == 0)
7139 return ZEBRA_ROUTE_STATIC
;
7140 else if (strncmp (str
, "r", 1) == 0)
7141 return ZEBRA_ROUTE_RIPNG
;
7142 else if (strncmp (str
, "o", 1) == 0)
7143 return ZEBRA_ROUTE_OSPF6
;
7148 DEFUN (bgp_redistribute_ipv4
,
7149 bgp_redistribute_ipv4_cmd
,
7150 "redistribute (connected|kernel|ospf|rip|static)",
7151 "Redistribute information from another routing protocol\n"
7154 "Open Shurtest Path First (OSPF)\n"
7155 "Routing Information Protocol (RIP)\n"
7160 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7163 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7166 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7169 DEFUN (bgp_redistribute_ipv4_rmap
,
7170 bgp_redistribute_ipv4_rmap_cmd
,
7171 "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
7172 "Redistribute information from another routing protocol\n"
7175 "Open Shurtest Path First (OSPF)\n"
7176 "Routing Information Protocol (RIP)\n"
7178 "Route map reference\n"
7179 "Pointer to route-map entries\n")
7183 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7186 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7190 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
7191 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7194 DEFUN (bgp_redistribute_ipv4_metric
,
7195 bgp_redistribute_ipv4_metric_cmd
,
7196 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
7197 "Redistribute information from another routing protocol\n"
7200 "Open Shurtest Path First (OSPF)\n"
7201 "Routing Information Protocol (RIP)\n"
7203 "Metric for redistributed routes\n"
7209 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7212 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7215 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7217 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7218 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7221 DEFUN (bgp_redistribute_ipv4_rmap_metric
,
7222 bgp_redistribute_ipv4_rmap_metric_cmd
,
7223 "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
7224 "Redistribute information from another routing protocol\n"
7227 "Open Shurtest Path First (OSPF)\n"
7228 "Routing Information Protocol (RIP)\n"
7230 "Route map reference\n"
7231 "Pointer to route-map entries\n"
7232 "Metric for redistributed routes\n"
7238 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7241 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7244 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
7246 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[1]);
7247 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7248 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7251 DEFUN (bgp_redistribute_ipv4_metric_rmap
,
7252 bgp_redistribute_ipv4_metric_rmap_cmd
,
7253 "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
7254 "Redistribute information from another routing protocol\n"
7257 "Open Shurtest Path First (OSPF)\n"
7258 "Routing Information Protocol (RIP)\n"
7260 "Metric for redistributed routes\n"
7262 "Route map reference\n"
7263 "Pointer to route-map entries\n")
7268 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7271 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7274 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7276 bgp_redistribute_metric_set (vty
->index
, AFI_IP
, type
, metric
);
7277 bgp_redistribute_rmap_set (vty
->index
, AFI_IP
, type
, argv
[2]);
7278 return bgp_redistribute_set (vty
->index
, AFI_IP
, type
);
7281 DEFUN (no_bgp_redistribute_ipv4
,
7282 no_bgp_redistribute_ipv4_cmd
,
7283 "no redistribute (connected|kernel|ospf|rip|static)",
7285 "Redistribute information from another routing protocol\n"
7288 "Open Shurtest Path First (OSPF)\n"
7289 "Routing Information Protocol (RIP)\n"
7294 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7297 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7301 return bgp_redistribute_unset (vty
->index
, AFI_IP
, type
);
7304 DEFUN (no_bgp_redistribute_ipv4_rmap
,
7305 no_bgp_redistribute_ipv4_rmap_cmd
,
7306 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
7308 "Redistribute information from another routing protocol\n"
7311 "Open Shurtest Path First (OSPF)\n"
7312 "Routing Information Protocol (RIP)\n"
7314 "Route map reference\n"
7315 "Pointer to route-map entries\n")
7319 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7322 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7326 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
7330 DEFUN (no_bgp_redistribute_ipv4_metric
,
7331 no_bgp_redistribute_ipv4_metric_cmd
,
7332 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
7334 "Redistribute information from another routing protocol\n"
7337 "Open Shurtest Path First (OSPF)\n"
7338 "Routing Information Protocol (RIP)\n"
7340 "Metric for redistributed routes\n"
7345 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7348 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7352 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
7356 DEFUN (no_bgp_redistribute_ipv4_rmap_metric
,
7357 no_bgp_redistribute_ipv4_rmap_metric_cmd
,
7358 "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
7360 "Redistribute information from another routing protocol\n"
7363 "Open Shurtest Path First (OSPF)\n"
7364 "Routing Information Protocol (RIP)\n"
7366 "Route map reference\n"
7367 "Pointer to route-map entries\n"
7368 "Metric for redistributed routes\n"
7373 type
= bgp_str2route_type (AFI_IP
, argv
[0]);
7376 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7380 bgp_redistribute_metric_unset (vty
->index
, AFI_IP
, type
);
7381 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP
, type
);
7385 ALIAS (no_bgp_redistribute_ipv4_rmap_metric
,
7386 no_bgp_redistribute_ipv4_metric_rmap_cmd
,
7387 "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
7389 "Redistribute information from another routing protocol\n"
7392 "Open Shurtest Path First (OSPF)\n"
7393 "Routing Information Protocol (RIP)\n"
7395 "Metric for redistributed routes\n"
7397 "Route map reference\n"
7398 "Pointer to route-map entries\n")
7401 DEFUN (bgp_redistribute_ipv6
,
7402 bgp_redistribute_ipv6_cmd
,
7403 "redistribute (connected|kernel|ospf6|ripng|static)",
7404 "Redistribute information from another routing protocol\n"
7407 "Open Shurtest Path First (OSPFv3)\n"
7408 "Routing Information Protocol (RIPng)\n"
7413 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7416 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7420 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
7423 DEFUN (bgp_redistribute_ipv6_rmap
,
7424 bgp_redistribute_ipv6_rmap_cmd
,
7425 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
7426 "Redistribute information from another routing protocol\n"
7429 "Open Shurtest Path First (OSPFv3)\n"
7430 "Routing Information Protocol (RIPng)\n"
7432 "Route map reference\n"
7433 "Pointer to route-map entries\n")
7437 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7440 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7444 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
7445 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
7448 DEFUN (bgp_redistribute_ipv6_metric
,
7449 bgp_redistribute_ipv6_metric_cmd
,
7450 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
7451 "Redistribute information from another routing protocol\n"
7454 "Open Shurtest Path First (OSPFv3)\n"
7455 "Routing Information Protocol (RIPng)\n"
7457 "Metric for redistributed routes\n"
7463 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7466 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7469 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7471 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
7472 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
7475 DEFUN (bgp_redistribute_ipv6_rmap_metric
,
7476 bgp_redistribute_ipv6_rmap_metric_cmd
,
7477 "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
7478 "Redistribute information from another routing protocol\n"
7481 "Open Shurtest Path First (OSPFv3)\n"
7482 "Routing Information Protocol (RIPng)\n"
7484 "Route map reference\n"
7485 "Pointer to route-map entries\n"
7486 "Metric for redistributed routes\n"
7492 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7495 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7498 VTY_GET_INTEGER ("metric", metric
, argv
[2]);
7500 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[1]);
7501 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
7502 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
7505 DEFUN (bgp_redistribute_ipv6_metric_rmap
,
7506 bgp_redistribute_ipv6_metric_rmap_cmd
,
7507 "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
7508 "Redistribute information from another routing protocol\n"
7511 "Open Shurtest Path First (OSPFv3)\n"
7512 "Routing Information Protocol (RIPng)\n"
7514 "Metric for redistributed routes\n"
7516 "Route map reference\n"
7517 "Pointer to route-map entries\n")
7522 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7525 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7528 VTY_GET_INTEGER ("metric", metric
, argv
[1]);
7530 bgp_redistribute_metric_set (vty
->index
, AFI_IP6
, type
, metric
);
7531 bgp_redistribute_rmap_set (vty
->index
, AFI_IP6
, type
, argv
[2]);
7532 return bgp_redistribute_set (vty
->index
, AFI_IP6
, type
);
7535 DEFUN (no_bgp_redistribute_ipv6
,
7536 no_bgp_redistribute_ipv6_cmd
,
7537 "no redistribute (connected|kernel|ospf6|ripng|static)",
7539 "Redistribute information from another routing protocol\n"
7542 "Open Shurtest Path First (OSPFv3)\n"
7543 "Routing Information Protocol (RIPng)\n"
7548 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7551 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7555 return bgp_redistribute_unset (vty
->index
, AFI_IP6
, type
);
7558 DEFUN (no_bgp_redistribute_ipv6_rmap
,
7559 no_bgp_redistribute_ipv6_rmap_cmd
,
7560 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
7562 "Redistribute information from another routing protocol\n"
7565 "Open Shurtest Path First (OSPFv3)\n"
7566 "Routing Information Protocol (RIPng)\n"
7568 "Route map reference\n"
7569 "Pointer to route-map entries\n")
7573 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7576 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7580 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
7584 DEFUN (no_bgp_redistribute_ipv6_metric
,
7585 no_bgp_redistribute_ipv6_metric_cmd
,
7586 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
7588 "Redistribute information from another routing protocol\n"
7591 "Open Shurtest Path First (OSPFv3)\n"
7592 "Routing Information Protocol (RIPng)\n"
7594 "Metric for redistributed routes\n"
7599 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7602 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7606 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
7610 DEFUN (no_bgp_redistribute_ipv6_rmap_metric
,
7611 no_bgp_redistribute_ipv6_rmap_metric_cmd
,
7612 "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
7614 "Redistribute information from another routing protocol\n"
7617 "Open Shurtest Path First (OSPFv3)\n"
7618 "Routing Information Protocol (RIPng)\n"
7620 "Route map reference\n"
7621 "Pointer to route-map entries\n"
7622 "Metric for redistributed routes\n"
7627 type
= bgp_str2route_type (AFI_IP6
, argv
[0]);
7630 vty_out (vty
, "%% Invalid route type%s", VTY_NEWLINE
);
7634 bgp_redistribute_metric_unset (vty
->index
, AFI_IP6
, type
);
7635 bgp_redistribute_routemap_unset (vty
->index
, AFI_IP6
, type
);
7639 ALIAS (no_bgp_redistribute_ipv6_rmap_metric
,
7640 no_bgp_redistribute_ipv6_metric_rmap_cmd
,
7641 "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
7643 "Redistribute information from another routing protocol\n"
7646 "Open Shurtest Path First (OSPFv3)\n"
7647 "Routing Information Protocol (RIPng)\n"
7649 "Metric for redistributed routes\n"
7651 "Route map reference\n"
7652 "Pointer to route-map entries\n")
7653 #endif /* HAVE_IPV6 */
7656 bgp_config_write_redistribute (struct vty
*vty
, struct bgp
*bgp
, afi_t afi
,
7657 safi_t safi
, int *write
)
7660 char *str
[] = { "system", "kernel", "connected", "static", "rip",
7661 "ripng", "ospf", "ospf6", "isis", "bgp"};
7663 /* Unicast redistribution only. */
7664 if (safi
!= SAFI_UNICAST
)
7667 for (i
= 0; i
< ZEBRA_ROUTE_MAX
; i
++)
7669 /* Redistribute BGP does not make sense. */
7670 if (bgp
->redist
[afi
][i
] && i
!= ZEBRA_ROUTE_BGP
)
7672 /* Display "address-family" when it is not yet diplayed. */
7673 bgp_config_write_family_header (vty
, afi
, safi
, write
);
7675 /* "redistribute" configuration. */
7676 vty_out (vty
, " redistribute %s", str
[i
]);
7678 if (bgp
->redist_metric_flag
[afi
][i
])
7679 vty_out (vty
, " metric %d", bgp
->redist_metric
[afi
][i
]);
7681 if (bgp
->rmap
[afi
][i
].name
)
7682 vty_out (vty
, " route-map %s", bgp
->rmap
[afi
][i
].name
);
7684 vty_out (vty
, "%s", VTY_NEWLINE
);
7690 /* BGP node structure. */
7691 struct cmd_node bgp_node
=
7694 "%s(config-router)# ",
7698 struct cmd_node bgp_ipv4_unicast_node
=
7701 "%s(config-router-af)# ",
7705 struct cmd_node bgp_ipv4_multicast_node
=
7708 "%s(config-router-af)# ",
7712 struct cmd_node bgp_ipv6_unicast_node
=
7715 "%s(config-router-af)# ",
7719 struct cmd_node bgp_vpnv4_node
=
7722 "%s(config-router-af)# ",
7729 int bgp_config_write (struct vty
*);
7730 void community_list_vty ();
7732 /* Install bgp top node. */
7733 install_node (&bgp_node
, bgp_config_write
);
7734 install_node (&bgp_ipv4_unicast_node
, NULL
);
7735 install_node (&bgp_ipv4_multicast_node
, NULL
);
7736 install_node (&bgp_ipv6_unicast_node
, NULL
);
7737 install_node (&bgp_vpnv4_node
, NULL
);
7739 /* Install default VTY commands to new nodes. */
7740 install_default (BGP_NODE
);
7741 install_default (BGP_IPV4_NODE
);
7742 install_default (BGP_IPV4M_NODE
);
7743 install_default (BGP_IPV6_NODE
);
7744 install_default (BGP_VPNV4_NODE
);
7746 /* "bgp multiple-instance" commands. */
7747 install_element (CONFIG_NODE
, &bgp_multiple_instance_cmd
);
7748 install_element (CONFIG_NODE
, &no_bgp_multiple_instance_cmd
);
7750 /* "bgp config-type" commands. */
7751 install_element (CONFIG_NODE
, &bgp_config_type_cmd
);
7752 install_element (CONFIG_NODE
, &no_bgp_config_type_cmd
);
7754 /* Dummy commands (Currently not supported) */
7755 install_element (BGP_NODE
, &no_synchronization_cmd
);
7756 install_element (BGP_NODE
, &no_auto_summary_cmd
);
7758 /* "router bgp" commands. */
7759 install_element (CONFIG_NODE
, &router_bgp_cmd
);
7760 install_element (CONFIG_NODE
, &router_bgp_view_cmd
);
7762 /* "no router bgp" commands. */
7763 install_element (CONFIG_NODE
, &no_router_bgp_cmd
);
7764 install_element (CONFIG_NODE
, &no_router_bgp_view_cmd
);
7766 /* "bgp router-id" commands. */
7767 install_element (BGP_NODE
, &bgp_router_id_cmd
);
7768 install_element (BGP_NODE
, &no_bgp_router_id_cmd
);
7769 install_element (BGP_NODE
, &no_bgp_router_id_val_cmd
);
7771 /* "bgp cluster-id" commands. */
7772 install_element (BGP_NODE
, &bgp_cluster_id_cmd
);
7773 install_element (BGP_NODE
, &bgp_cluster_id32_cmd
);
7774 install_element (BGP_NODE
, &no_bgp_cluster_id_cmd
);
7775 install_element (BGP_NODE
, &no_bgp_cluster_id_arg_cmd
);
7777 /* "bgp confederation" commands. */
7778 install_element (BGP_NODE
, &bgp_confederation_identifier_cmd
);
7779 install_element (BGP_NODE
, &no_bgp_confederation_identifier_cmd
);
7780 install_element (BGP_NODE
, &no_bgp_confederation_identifier_arg_cmd
);
7782 /* "bgp confederation peers" commands. */
7783 install_element (BGP_NODE
, &bgp_confederation_peers_cmd
);
7784 install_element (BGP_NODE
, &no_bgp_confederation_peers_cmd
);
7786 /* "timers bgp" commands. */
7787 install_element (BGP_NODE
, &bgp_timers_cmd
);
7788 install_element (BGP_NODE
, &no_bgp_timers_cmd
);
7789 install_element (BGP_NODE
, &no_bgp_timers_arg_cmd
);
7791 /* "bgp client-to-client reflection" commands */
7792 install_element (BGP_NODE
, &no_bgp_client_to_client_reflection_cmd
);
7793 install_element (BGP_NODE
, &bgp_client_to_client_reflection_cmd
);
7795 /* "bgp always-compare-med" commands */
7796 install_element (BGP_NODE
, &bgp_always_compare_med_cmd
);
7797 install_element (BGP_NODE
, &no_bgp_always_compare_med_cmd
);
7799 /* "bgp deterministic-med" commands */
7800 install_element (BGP_NODE
, &bgp_deterministic_med_cmd
);
7801 install_element (BGP_NODE
, &no_bgp_deterministic_med_cmd
);
7803 /* "bgp fast-external-failover" commands */
7804 install_element (BGP_NODE
, &bgp_fast_external_failover_cmd
);
7805 install_element (BGP_NODE
, &no_bgp_fast_external_failover_cmd
);
7807 /* "bgp enforce-first-as" commands */
7808 install_element (BGP_NODE
, &bgp_enforce_first_as_cmd
);
7809 install_element (BGP_NODE
, &no_bgp_enforce_first_as_cmd
);
7811 /* "bgp bestpath compare-routerid" commands */
7812 install_element (BGP_NODE
, &bgp_bestpath_compare_router_id_cmd
);
7813 install_element (BGP_NODE
, &no_bgp_bestpath_compare_router_id_cmd
);
7815 /* "bgp bestpath as-path ignore" commands */
7816 install_element (BGP_NODE
, &bgp_bestpath_aspath_ignore_cmd
);
7817 install_element (BGP_NODE
, &no_bgp_bestpath_aspath_ignore_cmd
);
7819 /* "bgp log-neighbor-changes" commands */
7820 install_element (BGP_NODE
, &bgp_log_neighbor_changes_cmd
);
7821 install_element (BGP_NODE
, &no_bgp_log_neighbor_changes_cmd
);
7823 /* "bgp bestpath med" commands */
7824 install_element (BGP_NODE
, &bgp_bestpath_med_cmd
);
7825 install_element (BGP_NODE
, &bgp_bestpath_med2_cmd
);
7826 install_element (BGP_NODE
, &bgp_bestpath_med3_cmd
);
7827 install_element (BGP_NODE
, &no_bgp_bestpath_med_cmd
);
7828 install_element (BGP_NODE
, &no_bgp_bestpath_med2_cmd
);
7829 install_element (BGP_NODE
, &no_bgp_bestpath_med3_cmd
);
7831 /* "no bgp default ipv4-unicast" commands. */
7832 install_element (BGP_NODE
, &no_bgp_default_ipv4_unicast_cmd
);
7833 install_element (BGP_NODE
, &bgp_default_ipv4_unicast_cmd
);
7835 /* "bgp network import-check" commands. */
7836 install_element (BGP_NODE
, &bgp_network_import_check_cmd
);
7837 install_element (BGP_NODE
, &no_bgp_network_import_check_cmd
);
7839 /* "bgp default local-preference" commands. */
7840 install_element (BGP_NODE
, &bgp_default_local_preference_cmd
);
7841 install_element (BGP_NODE
, &no_bgp_default_local_preference_cmd
);
7842 install_element (BGP_NODE
, &no_bgp_default_local_preference_val_cmd
);
7844 /* "neighbor remote-as" commands. */
7845 install_element (BGP_NODE
, &neighbor_remote_as_cmd
);
7846 install_element (BGP_NODE
, &no_neighbor_cmd
);
7847 install_element (BGP_NODE
, &no_neighbor_remote_as_cmd
);
7849 /* "neighbor peer-group" commands. */
7850 install_element (BGP_NODE
, &neighbor_peer_group_cmd
);
7851 install_element (BGP_NODE
, &no_neighbor_peer_group_cmd
);
7852 install_element (BGP_NODE
, &no_neighbor_peer_group_remote_as_cmd
);
7854 /* "neighbor local-as" commands. */
7855 install_element (BGP_NODE
, &neighbor_local_as_cmd
);
7856 install_element (BGP_NODE
, &neighbor_local_as_no_prepend_cmd
);
7857 install_element (BGP_NODE
, &no_neighbor_local_as_cmd
);
7858 install_element (BGP_NODE
, &no_neighbor_local_as_val_cmd
);
7859 install_element (BGP_NODE
, &no_neighbor_local_as_val2_cmd
);
7861 /* "neighbor activate" commands. */
7862 install_element (BGP_NODE
, &neighbor_activate_cmd
);
7863 install_element (BGP_IPV4_NODE
, &neighbor_activate_cmd
);
7864 install_element (BGP_IPV4M_NODE
, &neighbor_activate_cmd
);
7865 install_element (BGP_IPV6_NODE
, &neighbor_activate_cmd
);
7866 install_element (BGP_VPNV4_NODE
, &neighbor_activate_cmd
);
7868 /* "no neighbor activate" commands. */
7869 install_element (BGP_NODE
, &no_neighbor_activate_cmd
);
7870 install_element (BGP_IPV4_NODE
, &no_neighbor_activate_cmd
);
7871 install_element (BGP_IPV4M_NODE
, &no_neighbor_activate_cmd
);
7872 install_element (BGP_IPV6_NODE
, &no_neighbor_activate_cmd
);
7873 install_element (BGP_VPNV4_NODE
, &no_neighbor_activate_cmd
);
7875 /* "neighbor peer-group set" commands. */
7876 install_element (BGP_NODE
, &neighbor_set_peer_group_cmd
);
7877 install_element (BGP_IPV4_NODE
, &neighbor_set_peer_group_cmd
);
7878 install_element (BGP_IPV4M_NODE
, &neighbor_set_peer_group_cmd
);
7879 install_element (BGP_IPV6_NODE
, &neighbor_set_peer_group_cmd
);
7880 install_element (BGP_VPNV4_NODE
, &neighbor_set_peer_group_cmd
);
7882 /* "no neighbor peer-group unset" commands. */
7883 install_element (BGP_NODE
, &no_neighbor_set_peer_group_cmd
);
7884 install_element (BGP_IPV4_NODE
, &no_neighbor_set_peer_group_cmd
);
7885 install_element (BGP_IPV4M_NODE
, &no_neighbor_set_peer_group_cmd
);
7886 install_element (BGP_IPV6_NODE
, &no_neighbor_set_peer_group_cmd
);
7887 install_element (BGP_VPNV4_NODE
, &no_neighbor_set_peer_group_cmd
);
7889 /* "neighbor softreconfiguration inbound" commands.*/
7890 install_element (BGP_NODE
, &neighbor_soft_reconfiguration_cmd
);
7891 install_element (BGP_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
7892 install_element (BGP_IPV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
7893 install_element (BGP_IPV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
7894 install_element (BGP_IPV4M_NODE
, &neighbor_soft_reconfiguration_cmd
);
7895 install_element (BGP_IPV4M_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
7896 install_element (BGP_IPV6_NODE
, &neighbor_soft_reconfiguration_cmd
);
7897 install_element (BGP_IPV6_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
7898 install_element (BGP_VPNV4_NODE
, &neighbor_soft_reconfiguration_cmd
);
7899 install_element (BGP_VPNV4_NODE
, &no_neighbor_soft_reconfiguration_cmd
);
7901 /* "neighbor attribute-unchanged" commands. */
7902 install_element (BGP_NODE
, &neighbor_attr_unchanged_cmd
);
7903 install_element (BGP_NODE
, &neighbor_attr_unchanged1_cmd
);
7904 install_element (BGP_NODE
, &neighbor_attr_unchanged2_cmd
);
7905 install_element (BGP_NODE
, &neighbor_attr_unchanged3_cmd
);
7906 install_element (BGP_NODE
, &neighbor_attr_unchanged4_cmd
);
7907 install_element (BGP_NODE
, &neighbor_attr_unchanged5_cmd
);
7908 install_element (BGP_NODE
, &neighbor_attr_unchanged6_cmd
);
7909 install_element (BGP_NODE
, &neighbor_attr_unchanged7_cmd
);
7910 install_element (BGP_NODE
, &neighbor_attr_unchanged8_cmd
);
7911 install_element (BGP_NODE
, &neighbor_attr_unchanged9_cmd
);
7912 install_element (BGP_NODE
, &neighbor_attr_unchanged10_cmd
);
7913 install_element (BGP_NODE
, &no_neighbor_attr_unchanged_cmd
);
7914 install_element (BGP_NODE
, &no_neighbor_attr_unchanged1_cmd
);
7915 install_element (BGP_NODE
, &no_neighbor_attr_unchanged2_cmd
);
7916 install_element (BGP_NODE
, &no_neighbor_attr_unchanged3_cmd
);
7917 install_element (BGP_NODE
, &no_neighbor_attr_unchanged4_cmd
);
7918 install_element (BGP_NODE
, &no_neighbor_attr_unchanged5_cmd
);
7919 install_element (BGP_NODE
, &no_neighbor_attr_unchanged6_cmd
);
7920 install_element (BGP_NODE
, &no_neighbor_attr_unchanged7_cmd
);
7921 install_element (BGP_NODE
, &no_neighbor_attr_unchanged8_cmd
);
7922 install_element (BGP_NODE
, &no_neighbor_attr_unchanged9_cmd
);
7923 install_element (BGP_NODE
, &no_neighbor_attr_unchanged10_cmd
);
7924 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged_cmd
);
7925 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged1_cmd
);
7926 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged2_cmd
);
7927 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged3_cmd
);
7928 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged4_cmd
);
7929 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged5_cmd
);
7930 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged6_cmd
);
7931 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged7_cmd
);
7932 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged8_cmd
);
7933 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged9_cmd
);
7934 install_element (BGP_IPV4_NODE
, &neighbor_attr_unchanged10_cmd
);
7935 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
7936 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
7937 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
7938 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
7939 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
7940 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
7941 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
7942 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
7943 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
7944 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
7945 install_element (BGP_IPV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
7946 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged_cmd
);
7947 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged1_cmd
);
7948 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged2_cmd
);
7949 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged3_cmd
);
7950 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged4_cmd
);
7951 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged5_cmd
);
7952 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged6_cmd
);
7953 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged7_cmd
);
7954 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged8_cmd
);
7955 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged9_cmd
);
7956 install_element (BGP_IPV4M_NODE
, &neighbor_attr_unchanged10_cmd
);
7957 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged_cmd
);
7958 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged1_cmd
);
7959 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged2_cmd
);
7960 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged3_cmd
);
7961 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged4_cmd
);
7962 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged5_cmd
);
7963 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged6_cmd
);
7964 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged7_cmd
);
7965 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged8_cmd
);
7966 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged9_cmd
);
7967 install_element (BGP_IPV4M_NODE
, &no_neighbor_attr_unchanged10_cmd
);
7968 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged_cmd
);
7969 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged1_cmd
);
7970 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged2_cmd
);
7971 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged3_cmd
);
7972 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged4_cmd
);
7973 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged5_cmd
);
7974 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged6_cmd
);
7975 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged7_cmd
);
7976 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged8_cmd
);
7977 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged9_cmd
);
7978 install_element (BGP_IPV6_NODE
, &neighbor_attr_unchanged10_cmd
);
7979 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged_cmd
);
7980 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged1_cmd
);
7981 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged2_cmd
);
7982 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged3_cmd
);
7983 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged4_cmd
);
7984 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged5_cmd
);
7985 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged6_cmd
);
7986 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged7_cmd
);
7987 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged8_cmd
);
7988 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged9_cmd
);
7989 install_element (BGP_IPV6_NODE
, &no_neighbor_attr_unchanged10_cmd
);
7990 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged_cmd
);
7991 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged1_cmd
);
7992 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged2_cmd
);
7993 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged3_cmd
);
7994 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged4_cmd
);
7995 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged5_cmd
);
7996 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged6_cmd
);
7997 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged7_cmd
);
7998 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged8_cmd
);
7999 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged9_cmd
);
8000 install_element (BGP_VPNV4_NODE
, &neighbor_attr_unchanged10_cmd
);
8001 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged_cmd
);
8002 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged1_cmd
);
8003 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged2_cmd
);
8004 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged3_cmd
);
8005 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged4_cmd
);
8006 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged5_cmd
);
8007 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged6_cmd
);
8008 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged7_cmd
);
8009 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged8_cmd
);
8010 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged9_cmd
);
8011 install_element (BGP_VPNV4_NODE
, &no_neighbor_attr_unchanged10_cmd
);
8013 /* "transparent-as" and "transparent-nexthop" for old version
8015 install_element (BGP_NODE
, &neighbor_transparent_as_cmd
);
8016 install_element (BGP_NODE
, &neighbor_transparent_nexthop_cmd
);
8018 /* "neighbor next-hop-self" commands. */
8019 install_element (BGP_NODE
, &neighbor_nexthop_self_cmd
);
8020 install_element (BGP_NODE
, &no_neighbor_nexthop_self_cmd
);
8021 install_element (BGP_IPV4_NODE
, &neighbor_nexthop_self_cmd
);
8022 install_element (BGP_IPV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8023 install_element (BGP_IPV4M_NODE
, &neighbor_nexthop_self_cmd
);
8024 install_element (BGP_IPV4M_NODE
, &no_neighbor_nexthop_self_cmd
);
8025 install_element (BGP_IPV6_NODE
, &neighbor_nexthop_self_cmd
);
8026 install_element (BGP_IPV6_NODE
, &no_neighbor_nexthop_self_cmd
);
8027 install_element (BGP_VPNV4_NODE
, &neighbor_nexthop_self_cmd
);
8028 install_element (BGP_VPNV4_NODE
, &no_neighbor_nexthop_self_cmd
);
8030 /* "neighbor remove-private-AS" commands. */
8031 install_element (BGP_NODE
, &neighbor_remove_private_as_cmd
);
8032 install_element (BGP_NODE
, &no_neighbor_remove_private_as_cmd
);
8033 install_element (BGP_IPV4_NODE
, &neighbor_remove_private_as_cmd
);
8034 install_element (BGP_IPV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8035 install_element (BGP_IPV4M_NODE
, &neighbor_remove_private_as_cmd
);
8036 install_element (BGP_IPV4M_NODE
, &no_neighbor_remove_private_as_cmd
);
8037 install_element (BGP_IPV6_NODE
, &neighbor_remove_private_as_cmd
);
8038 install_element (BGP_IPV6_NODE
, &no_neighbor_remove_private_as_cmd
);
8039 install_element (BGP_VPNV4_NODE
, &neighbor_remove_private_as_cmd
);
8040 install_element (BGP_VPNV4_NODE
, &no_neighbor_remove_private_as_cmd
);
8042 /* "neighbor send-community" commands.*/
8043 install_element (BGP_NODE
, &neighbor_send_community_cmd
);
8044 install_element (BGP_NODE
, &neighbor_send_community_type_cmd
);
8045 install_element (BGP_NODE
, &no_neighbor_send_community_cmd
);
8046 install_element (BGP_NODE
, &no_neighbor_send_community_type_cmd
);
8047 install_element (BGP_IPV4_NODE
, &neighbor_send_community_cmd
);
8048 install_element (BGP_IPV4_NODE
, &neighbor_send_community_type_cmd
);
8049 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_cmd
);
8050 install_element (BGP_IPV4_NODE
, &no_neighbor_send_community_type_cmd
);
8051 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_cmd
);
8052 install_element (BGP_IPV4M_NODE
, &neighbor_send_community_type_cmd
);
8053 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_cmd
);
8054 install_element (BGP_IPV4M_NODE
, &no_neighbor_send_community_type_cmd
);
8055 install_element (BGP_IPV6_NODE
, &neighbor_send_community_cmd
);
8056 install_element (BGP_IPV6_NODE
, &neighbor_send_community_type_cmd
);
8057 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_cmd
);
8058 install_element (BGP_IPV6_NODE
, &no_neighbor_send_community_type_cmd
);
8059 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_cmd
);
8060 install_element (BGP_VPNV4_NODE
, &neighbor_send_community_type_cmd
);
8061 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_cmd
);
8062 install_element (BGP_VPNV4_NODE
, &no_neighbor_send_community_type_cmd
);
8064 /* "neighbor route-reflector" commands.*/
8065 install_element (BGP_NODE
, &neighbor_route_reflector_client_cmd
);
8066 install_element (BGP_NODE
, &no_neighbor_route_reflector_client_cmd
);
8067 install_element (BGP_IPV4_NODE
, &neighbor_route_reflector_client_cmd
);
8068 install_element (BGP_IPV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8069 install_element (BGP_IPV4M_NODE
, &neighbor_route_reflector_client_cmd
);
8070 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_reflector_client_cmd
);
8071 install_element (BGP_IPV6_NODE
, &neighbor_route_reflector_client_cmd
);
8072 install_element (BGP_IPV6_NODE
, &no_neighbor_route_reflector_client_cmd
);
8073 install_element (BGP_VPNV4_NODE
, &neighbor_route_reflector_client_cmd
);
8074 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_reflector_client_cmd
);
8076 /* "neighbor route-server" commands.*/
8077 install_element (BGP_NODE
, &neighbor_route_server_client_cmd
);
8078 install_element (BGP_NODE
, &no_neighbor_route_server_client_cmd
);
8079 install_element (BGP_IPV4_NODE
, &neighbor_route_server_client_cmd
);
8080 install_element (BGP_IPV4_NODE
, &no_neighbor_route_server_client_cmd
);
8081 install_element (BGP_IPV4M_NODE
, &neighbor_route_server_client_cmd
);
8082 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_server_client_cmd
);
8083 install_element (BGP_IPV6_NODE
, &neighbor_route_server_client_cmd
);
8084 install_element (BGP_IPV6_NODE
, &no_neighbor_route_server_client_cmd
);
8085 install_element (BGP_VPNV4_NODE
, &neighbor_route_server_client_cmd
);
8086 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_server_client_cmd
);
8088 /* "neighbor passive" commands. */
8089 install_element (BGP_NODE
, &neighbor_passive_cmd
);
8090 install_element (BGP_NODE
, &no_neighbor_passive_cmd
);
8092 /* "neighbor shutdown" commands. */
8093 install_element (BGP_NODE
, &neighbor_shutdown_cmd
);
8094 install_element (BGP_NODE
, &no_neighbor_shutdown_cmd
);
8096 /* "neighbor capability route-refresh" commands.*/
8097 install_element (BGP_NODE
, &neighbor_capability_route_refresh_cmd
);
8098 install_element (BGP_NODE
, &no_neighbor_capability_route_refresh_cmd
);
8100 /* "neighbor capability orf prefix-list" commands.*/
8101 install_element (BGP_NODE
, &neighbor_capability_orf_prefix_cmd
);
8102 install_element (BGP_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8103 install_element (BGP_IPV4_NODE
, &neighbor_capability_orf_prefix_cmd
);
8104 install_element (BGP_IPV4_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8105 install_element (BGP_IPV4M_NODE
, &neighbor_capability_orf_prefix_cmd
);
8106 install_element (BGP_IPV4M_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8107 install_element (BGP_IPV6_NODE
, &neighbor_capability_orf_prefix_cmd
);
8108 install_element (BGP_IPV6_NODE
, &no_neighbor_capability_orf_prefix_cmd
);
8110 /* "neighbor capability dynamic" commands.*/
8111 install_element (BGP_NODE
, &neighbor_capability_dynamic_cmd
);
8112 install_element (BGP_NODE
, &no_neighbor_capability_dynamic_cmd
);
8114 /* "neighbor dont-capability-negotiate" commands. */
8115 install_element (BGP_NODE
, &neighbor_dont_capability_negotiate_cmd
);
8116 install_element (BGP_NODE
, &no_neighbor_dont_capability_negotiate_cmd
);
8118 /* "neighbor ebgp-multihop" commands. */
8119 install_element (BGP_NODE
, &neighbor_ebgp_multihop_cmd
);
8120 install_element (BGP_NODE
, &neighbor_ebgp_multihop_ttl_cmd
);
8121 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_cmd
);
8122 install_element (BGP_NODE
, &no_neighbor_ebgp_multihop_ttl_cmd
);
8124 /* "neighbor enforce-multihop" commands. */
8125 install_element (BGP_NODE
, &neighbor_enforce_multihop_cmd
);
8126 install_element (BGP_NODE
, &no_neighbor_enforce_multihop_cmd
);
8128 /* "neighbor description" commands. */
8129 install_element (BGP_NODE
, &neighbor_description_cmd
);
8130 install_element (BGP_NODE
, &no_neighbor_description_cmd
);
8131 install_element (BGP_NODE
, &no_neighbor_description_val_cmd
);
8133 /* "neighbor update-source" commands. "*/
8134 install_element (BGP_NODE
, &neighbor_update_source_cmd
);
8135 install_element (BGP_NODE
, &no_neighbor_update_source_cmd
);
8137 /* "neighbor default-originate" commands. */
8138 install_element (BGP_NODE
, &neighbor_default_originate_cmd
);
8139 install_element (BGP_NODE
, &neighbor_default_originate_rmap_cmd
);
8140 install_element (BGP_NODE
, &no_neighbor_default_originate_cmd
);
8141 install_element (BGP_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8142 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_cmd
);
8143 install_element (BGP_IPV4_NODE
, &neighbor_default_originate_rmap_cmd
);
8144 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_cmd
);
8145 install_element (BGP_IPV4_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8146 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_cmd
);
8147 install_element (BGP_IPV4M_NODE
, &neighbor_default_originate_rmap_cmd
);
8148 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_cmd
);
8149 install_element (BGP_IPV4M_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8150 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_cmd
);
8151 install_element (BGP_IPV6_NODE
, &neighbor_default_originate_rmap_cmd
);
8152 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_cmd
);
8153 install_element (BGP_IPV6_NODE
, &no_neighbor_default_originate_rmap_cmd
);
8155 /* "neighbor port" commands. */
8156 install_element (BGP_NODE
, &neighbor_port_cmd
);
8157 install_element (BGP_NODE
, &no_neighbor_port_cmd
);
8158 install_element (BGP_NODE
, &no_neighbor_port_val_cmd
);
8160 /* "neighbor weight" commands. */
8161 install_element (BGP_NODE
, &neighbor_weight_cmd
);
8162 install_element (BGP_NODE
, &no_neighbor_weight_cmd
);
8163 install_element (BGP_NODE
, &no_neighbor_weight_val_cmd
);
8165 /* "neighbor override-capability" commands. */
8166 install_element (BGP_NODE
, &neighbor_override_capability_cmd
);
8167 install_element (BGP_NODE
, &no_neighbor_override_capability_cmd
);
8169 /* "neighbor strict-capability-match" commands. */
8170 install_element (BGP_NODE
, &neighbor_strict_capability_cmd
);
8171 install_element (BGP_NODE
, &no_neighbor_strict_capability_cmd
);
8173 /* "neighbor timers" commands. */
8174 install_element (BGP_NODE
, &neighbor_timers_cmd
);
8175 install_element (BGP_NODE
, &no_neighbor_timers_cmd
);
8177 /* "neighbor timers connect" commands. */
8178 install_element (BGP_NODE
, &neighbor_timers_connect_cmd
);
8179 install_element (BGP_NODE
, &no_neighbor_timers_connect_cmd
);
8180 install_element (BGP_NODE
, &no_neighbor_timers_connect_val_cmd
);
8182 /* "neighbor advertisement-interval" commands. */
8183 install_element (BGP_NODE
, &neighbor_advertise_interval_cmd
);
8184 install_element (BGP_NODE
, &no_neighbor_advertise_interval_cmd
);
8185 install_element (BGP_NODE
, &no_neighbor_advertise_interval_val_cmd
);
8187 /* "neighbor version" commands. */
8188 install_element (BGP_NODE
, &neighbor_version_cmd
);
8189 install_element (BGP_NODE
, &no_neighbor_version_cmd
);
8191 /* "neighbor interface" commands. */
8192 install_element (BGP_NODE
, &neighbor_interface_cmd
);
8193 install_element (BGP_NODE
, &no_neighbor_interface_cmd
);
8195 /* "neighbor distribute" commands. */
8196 install_element (BGP_NODE
, &neighbor_distribute_list_cmd
);
8197 install_element (BGP_NODE
, &no_neighbor_distribute_list_cmd
);
8198 install_element (BGP_IPV4_NODE
, &neighbor_distribute_list_cmd
);
8199 install_element (BGP_IPV4_NODE
, &no_neighbor_distribute_list_cmd
);
8200 install_element (BGP_IPV4M_NODE
, &neighbor_distribute_list_cmd
);
8201 install_element (BGP_IPV4M_NODE
, &no_neighbor_distribute_list_cmd
);
8202 install_element (BGP_IPV6_NODE
, &neighbor_distribute_list_cmd
);
8203 install_element (BGP_IPV6_NODE
, &no_neighbor_distribute_list_cmd
);
8204 install_element (BGP_VPNV4_NODE
, &neighbor_distribute_list_cmd
);
8205 install_element (BGP_VPNV4_NODE
, &no_neighbor_distribute_list_cmd
);
8207 /* "neighbor prefix-list" commands. */
8208 install_element (BGP_NODE
, &neighbor_prefix_list_cmd
);
8209 install_element (BGP_NODE
, &no_neighbor_prefix_list_cmd
);
8210 install_element (BGP_IPV4_NODE
, &neighbor_prefix_list_cmd
);
8211 install_element (BGP_IPV4_NODE
, &no_neighbor_prefix_list_cmd
);
8212 install_element (BGP_IPV4M_NODE
, &neighbor_prefix_list_cmd
);
8213 install_element (BGP_IPV4M_NODE
, &no_neighbor_prefix_list_cmd
);
8214 install_element (BGP_IPV6_NODE
, &neighbor_prefix_list_cmd
);
8215 install_element (BGP_IPV6_NODE
, &no_neighbor_prefix_list_cmd
);
8216 install_element (BGP_VPNV4_NODE
, &neighbor_prefix_list_cmd
);
8217 install_element (BGP_VPNV4_NODE
, &no_neighbor_prefix_list_cmd
);
8219 /* "neighbor filter-list" commands. */
8220 install_element (BGP_NODE
, &neighbor_filter_list_cmd
);
8221 install_element (BGP_NODE
, &no_neighbor_filter_list_cmd
);
8222 install_element (BGP_IPV4_NODE
, &neighbor_filter_list_cmd
);
8223 install_element (BGP_IPV4_NODE
, &no_neighbor_filter_list_cmd
);
8224 install_element (BGP_IPV4M_NODE
, &neighbor_filter_list_cmd
);
8225 install_element (BGP_IPV4M_NODE
, &no_neighbor_filter_list_cmd
);
8226 install_element (BGP_IPV6_NODE
, &neighbor_filter_list_cmd
);
8227 install_element (BGP_IPV6_NODE
, &no_neighbor_filter_list_cmd
);
8228 install_element (BGP_VPNV4_NODE
, &neighbor_filter_list_cmd
);
8229 install_element (BGP_VPNV4_NODE
, &no_neighbor_filter_list_cmd
);
8231 /* "neighbor route-map" commands. */
8232 install_element (BGP_NODE
, &neighbor_route_map_cmd
);
8233 install_element (BGP_NODE
, &no_neighbor_route_map_cmd
);
8234 install_element (BGP_IPV4_NODE
, &neighbor_route_map_cmd
);
8235 install_element (BGP_IPV4_NODE
, &no_neighbor_route_map_cmd
);
8236 install_element (BGP_IPV4M_NODE
, &neighbor_route_map_cmd
);
8237 install_element (BGP_IPV4M_NODE
, &no_neighbor_route_map_cmd
);
8238 install_element (BGP_IPV6_NODE
, &neighbor_route_map_cmd
);
8239 install_element (BGP_IPV6_NODE
, &no_neighbor_route_map_cmd
);
8240 install_element (BGP_VPNV4_NODE
, &neighbor_route_map_cmd
);
8241 install_element (BGP_VPNV4_NODE
, &no_neighbor_route_map_cmd
);
8243 /* "neighbor unsuppress-map" commands. */
8244 install_element (BGP_NODE
, &neighbor_unsuppress_map_cmd
);
8245 install_element (BGP_NODE
, &no_neighbor_unsuppress_map_cmd
);
8246 install_element (BGP_IPV4_NODE
, &neighbor_unsuppress_map_cmd
);
8247 install_element (BGP_IPV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
8248 install_element (BGP_IPV4M_NODE
, &neighbor_unsuppress_map_cmd
);
8249 install_element (BGP_IPV4M_NODE
, &no_neighbor_unsuppress_map_cmd
);
8250 install_element (BGP_IPV6_NODE
, &neighbor_unsuppress_map_cmd
);
8251 install_element (BGP_IPV6_NODE
, &no_neighbor_unsuppress_map_cmd
);
8252 install_element (BGP_VPNV4_NODE
, &neighbor_unsuppress_map_cmd
);
8253 install_element (BGP_VPNV4_NODE
, &no_neighbor_unsuppress_map_cmd
);
8255 /* "neighbor maximum-prefix" commands. */
8256 install_element (BGP_NODE
, &neighbor_maximum_prefix_cmd
);
8257 install_element (BGP_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8258 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_cmd
);
8259 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8260 install_element (BGP_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8261 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_cmd
);
8262 install_element (BGP_IPV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8263 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
8264 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8265 install_element (BGP_IPV4_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8266 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_cmd
);
8267 install_element (BGP_IPV4M_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8268 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_cmd
);
8269 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8270 install_element (BGP_IPV4M_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8271 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_cmd
);
8272 install_element (BGP_IPV6_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8273 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_cmd
);
8274 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8275 install_element (BGP_IPV6_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8276 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_cmd
);
8277 install_element (BGP_VPNV4_NODE
, &neighbor_maximum_prefix_warning_cmd
);
8278 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_cmd
);
8279 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val_cmd
);
8280 install_element (BGP_VPNV4_NODE
, &no_neighbor_maximum_prefix_val2_cmd
);
8282 /* "neighbor allowas-in" */
8283 install_element (BGP_NODE
, &neighbor_allowas_in_cmd
);
8284 install_element (BGP_NODE
, &neighbor_allowas_in_arg_cmd
);
8285 install_element (BGP_NODE
, &no_neighbor_allowas_in_cmd
);
8286 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_cmd
);
8287 install_element (BGP_IPV4_NODE
, &neighbor_allowas_in_arg_cmd
);
8288 install_element (BGP_IPV4_NODE
, &no_neighbor_allowas_in_cmd
);
8289 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_cmd
);
8290 install_element (BGP_IPV4M_NODE
, &neighbor_allowas_in_arg_cmd
);
8291 install_element (BGP_IPV4M_NODE
, &no_neighbor_allowas_in_cmd
);
8292 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_cmd
);
8293 install_element (BGP_IPV6_NODE
, &neighbor_allowas_in_arg_cmd
);
8294 install_element (BGP_IPV6_NODE
, &no_neighbor_allowas_in_cmd
);
8295 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_cmd
);
8296 install_element (BGP_VPNV4_NODE
, &neighbor_allowas_in_arg_cmd
);
8297 install_element (BGP_VPNV4_NODE
, &no_neighbor_allowas_in_cmd
);
8299 /* address-family commands. */
8300 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
8301 install_element (BGP_NODE
, &address_family_ipv4_safi_cmd
);
8303 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
8304 install_element (BGP_NODE
, &address_family_ipv6_unicast_cmd
);
8305 #endif /* HAVE_IPV6 */
8306 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
8307 install_element (BGP_NODE
, &address_family_vpnv4_unicast_cmd
);
8309 /* "exit-address-family" command. */
8310 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
8311 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
8312 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
8313 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
8315 /* "clear ip bgp commands" */
8316 install_element (ENABLE_NODE
, &clear_ip_bgp_all_cmd
);
8317 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_cmd
);
8318 install_element (ENABLE_NODE
, &clear_ip_bgp_as_cmd
);
8319 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_cmd
);
8320 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_cmd
);
8321 install_element (ENABLE_NODE
, &clear_ip_bgp_external_cmd
);
8323 install_element (ENABLE_NODE
, &clear_bgp_all_cmd
);
8324 install_element (ENABLE_NODE
, &clear_bgp_instance_all_cmd
);
8325 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_cmd
);
8326 install_element (ENABLE_NODE
, &clear_bgp_peer_cmd
);
8327 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_cmd
);
8328 install_element (ENABLE_NODE
, &clear_bgp_peer_group_cmd
);
8329 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_cmd
);
8330 install_element (ENABLE_NODE
, &clear_bgp_external_cmd
);
8331 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_cmd
);
8332 install_element (ENABLE_NODE
, &clear_bgp_as_cmd
);
8333 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_cmd
);
8334 #endif /* HAVE_IPV6 */
8336 /* "clear ip bgp neighbor soft in" */
8337 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_in_cmd
);
8338 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_in_cmd
);
8339 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_cmd
);
8340 install_element (ENABLE_NODE
, &clear_ip_bgp_all_in_prefix_filter_cmd
);
8341 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_in_prefix_filter_cmd
);
8342 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_in_cmd
);
8343 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_cmd
);
8344 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_in_prefix_filter_cmd
);
8345 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_in_cmd
);
8346 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_cmd
);
8347 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_in_prefix_filter_cmd
);
8348 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_in_cmd
);
8349 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_cmd
);
8350 install_element (ENABLE_NODE
, &clear_ip_bgp_external_in_prefix_filter_cmd
);
8351 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_in_cmd
);
8352 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_cmd
);
8353 install_element (ENABLE_NODE
, &clear_ip_bgp_as_in_prefix_filter_cmd
);
8354 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_in_cmd
);
8355 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd
);
8356 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_cmd
);
8357 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd
);
8358 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd
);
8359 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_in_cmd
);
8360 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_cmd
);
8361 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd
);
8362 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd
);
8363 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_cmd
);
8364 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd
);
8365 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_in_cmd
);
8366 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_cmd
);
8367 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd
);
8368 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_in_cmd
);
8369 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_cmd
);
8370 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd
);
8371 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_in_cmd
);
8372 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_in_cmd
);
8373 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_in_cmd
);
8374 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_in_cmd
);
8375 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_in_cmd
);
8376 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_in_cmd
);
8378 install_element (ENABLE_NODE
, &clear_bgp_all_soft_in_cmd
);
8379 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_in_cmd
);
8380 install_element (ENABLE_NODE
, &clear_bgp_all_in_cmd
);
8381 install_element (ENABLE_NODE
, &clear_bgp_all_in_prefix_filter_cmd
);
8382 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_in_cmd
);
8383 install_element (ENABLE_NODE
, &clear_bgp_peer_in_cmd
);
8384 install_element (ENABLE_NODE
, &clear_bgp_peer_in_prefix_filter_cmd
);
8385 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_in_cmd
);
8386 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_cmd
);
8387 install_element (ENABLE_NODE
, &clear_bgp_peer_group_in_prefix_filter_cmd
);
8388 install_element (ENABLE_NODE
, &clear_bgp_external_soft_in_cmd
);
8389 install_element (ENABLE_NODE
, &clear_bgp_external_in_cmd
);
8390 install_element (ENABLE_NODE
, &clear_bgp_external_in_prefix_filter_cmd
);
8391 install_element (ENABLE_NODE
, &clear_bgp_as_soft_in_cmd
);
8392 install_element (ENABLE_NODE
, &clear_bgp_as_in_cmd
);
8393 install_element (ENABLE_NODE
, &clear_bgp_as_in_prefix_filter_cmd
);
8394 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_in_cmd
);
8395 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_cmd
);
8396 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_in_prefix_filter_cmd
);
8397 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_in_cmd
);
8398 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_cmd
);
8399 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_in_prefix_filter_cmd
);
8400 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_in_cmd
);
8401 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_cmd
);
8402 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd
);
8403 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_in_cmd
);
8404 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_cmd
);
8405 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_in_prefix_filter_cmd
);
8406 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_in_cmd
);
8407 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_cmd
);
8408 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_in_prefix_filter_cmd
);
8409 #endif /* HAVE_IPV6 */
8411 /* "clear ip bgp neighbor soft out" */
8412 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_out_cmd
);
8413 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_out_cmd
);
8414 install_element (ENABLE_NODE
, &clear_ip_bgp_all_out_cmd
);
8415 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_out_cmd
);
8416 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_out_cmd
);
8417 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_out_cmd
);
8418 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_out_cmd
);
8419 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_out_cmd
);
8420 install_element (ENABLE_NODE
, &clear_ip_bgp_external_out_cmd
);
8421 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_out_cmd
);
8422 install_element (ENABLE_NODE
, &clear_ip_bgp_as_out_cmd
);
8423 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_out_cmd
);
8424 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd
);
8425 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_out_cmd
);
8426 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_out_cmd
);
8427 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_out_cmd
);
8428 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd
);
8429 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_out_cmd
);
8430 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_out_cmd
);
8431 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_out_cmd
);
8432 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_out_cmd
);
8433 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_out_cmd
);
8434 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_out_cmd
);
8435 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_out_cmd
);
8436 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_out_cmd
);
8437 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_out_cmd
);
8438 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_out_cmd
);
8439 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_out_cmd
);
8441 install_element (ENABLE_NODE
, &clear_bgp_all_soft_out_cmd
);
8442 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_out_cmd
);
8443 install_element (ENABLE_NODE
, &clear_bgp_all_out_cmd
);
8444 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_out_cmd
);
8445 install_element (ENABLE_NODE
, &clear_bgp_peer_out_cmd
);
8446 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_out_cmd
);
8447 install_element (ENABLE_NODE
, &clear_bgp_peer_group_out_cmd
);
8448 install_element (ENABLE_NODE
, &clear_bgp_external_soft_out_cmd
);
8449 install_element (ENABLE_NODE
, &clear_bgp_external_out_cmd
);
8450 install_element (ENABLE_NODE
, &clear_bgp_as_soft_out_cmd
);
8451 install_element (ENABLE_NODE
, &clear_bgp_as_out_cmd
);
8452 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_out_cmd
);
8453 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_out_cmd
);
8454 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_out_cmd
);
8455 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_out_cmd
);
8456 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_out_cmd
);
8457 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_out_cmd
);
8458 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_out_cmd
);
8459 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_out_cmd
);
8460 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_out_cmd
);
8461 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_out_cmd
);
8462 #endif /* HAVE_IPV6 */
8464 /* "clear ip bgp neighbor soft" */
8465 install_element (ENABLE_NODE
, &clear_ip_bgp_all_soft_cmd
);
8466 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_soft_cmd
);
8467 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_soft_cmd
);
8468 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_soft_cmd
);
8469 install_element (ENABLE_NODE
, &clear_ip_bgp_external_soft_cmd
);
8470 install_element (ENABLE_NODE
, &clear_ip_bgp_as_soft_cmd
);
8471 install_element (ENABLE_NODE
, &clear_ip_bgp_all_ipv4_soft_cmd
);
8472 install_element (ENABLE_NODE
, &clear_ip_bgp_instance_all_ipv4_soft_cmd
);
8473 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_ipv4_soft_cmd
);
8474 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_group_ipv4_soft_cmd
);
8475 install_element (ENABLE_NODE
, &clear_ip_bgp_external_ipv4_soft_cmd
);
8476 install_element (ENABLE_NODE
, &clear_ip_bgp_as_ipv4_soft_cmd
);
8477 install_element (ENABLE_NODE
, &clear_ip_bgp_all_vpnv4_soft_cmd
);
8478 install_element (ENABLE_NODE
, &clear_ip_bgp_peer_vpnv4_soft_cmd
);
8479 install_element (ENABLE_NODE
, &clear_ip_bgp_as_vpnv4_soft_cmd
);
8481 install_element (ENABLE_NODE
, &clear_bgp_all_soft_cmd
);
8482 install_element (ENABLE_NODE
, &clear_bgp_instance_all_soft_cmd
);
8483 install_element (ENABLE_NODE
, &clear_bgp_peer_soft_cmd
);
8484 install_element (ENABLE_NODE
, &clear_bgp_peer_group_soft_cmd
);
8485 install_element (ENABLE_NODE
, &clear_bgp_external_soft_cmd
);
8486 install_element (ENABLE_NODE
, &clear_bgp_as_soft_cmd
);
8487 install_element (ENABLE_NODE
, &clear_bgp_ipv6_all_soft_cmd
);
8488 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_soft_cmd
);
8489 install_element (ENABLE_NODE
, &clear_bgp_ipv6_peer_group_soft_cmd
);
8490 install_element (ENABLE_NODE
, &clear_bgp_ipv6_external_soft_cmd
);
8491 install_element (ENABLE_NODE
, &clear_bgp_ipv6_as_soft_cmd
);
8492 #endif /* HAVE_IPV6 */
8494 /* "show ip bgp summary" commands. */
8495 install_element (VIEW_NODE
, &show_ip_bgp_summary_cmd
);
8496 install_element (VIEW_NODE
, &show_ip_bgp_instance_summary_cmd
);
8497 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
8498 install_element (VIEW_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
8499 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
8500 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
8502 install_element (VIEW_NODE
, &show_bgp_summary_cmd
);
8503 install_element (VIEW_NODE
, &show_bgp_instance_summary_cmd
);
8504 install_element (VIEW_NODE
, &show_bgp_ipv6_summary_cmd
);
8505 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
8506 #endif /* HAVE_IPV6 */
8507 install_element (ENABLE_NODE
, &show_ip_bgp_summary_cmd
);
8508 install_element (ENABLE_NODE
, &show_ip_bgp_instance_summary_cmd
);
8509 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_summary_cmd
);
8510 install_element (ENABLE_NODE
, &show_ip_bgp_instance_ipv4_summary_cmd
);
8511 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_summary_cmd
);
8512 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_summary_cmd
);
8514 install_element (ENABLE_NODE
, &show_bgp_summary_cmd
);
8515 install_element (ENABLE_NODE
, &show_bgp_instance_summary_cmd
);
8516 install_element (ENABLE_NODE
, &show_bgp_ipv6_summary_cmd
);
8517 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_summary_cmd
);
8518 #endif /* HAVE_IPV6 */
8520 /* "show ip bgp neighbors" commands. */
8521 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_cmd
);
8522 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
8523 install_element (VIEW_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
8524 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
8525 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
8526 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
8527 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
8528 install_element (VIEW_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
8529 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
8530 install_element (VIEW_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
8531 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_cmd
);
8532 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_cmd
);
8533 install_element (ENABLE_NODE
, &show_ip_bgp_neighbors_peer_cmd
);
8534 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_neighbors_peer_cmd
);
8535 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_cmd
);
8536 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_cmd
);
8537 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd
);
8538 install_element (ENABLE_NODE
, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd
);
8539 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_cmd
);
8540 install_element (ENABLE_NODE
, &show_ip_bgp_instance_neighbors_peer_cmd
);
8543 install_element (VIEW_NODE
, &show_bgp_neighbors_cmd
);
8544 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_cmd
);
8545 install_element (VIEW_NODE
, &show_bgp_neighbors_peer_cmd
);
8546 install_element (VIEW_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
8547 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_cmd
);
8548 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
8549 install_element (VIEW_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
8550 install_element (VIEW_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
8551 install_element (ENABLE_NODE
, &show_bgp_neighbors_cmd
);
8552 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_cmd
);
8553 install_element (ENABLE_NODE
, &show_bgp_neighbors_peer_cmd
);
8554 install_element (ENABLE_NODE
, &show_bgp_ipv6_neighbors_peer_cmd
);
8555 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_cmd
);
8556 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_cmd
);
8557 install_element (ENABLE_NODE
, &show_bgp_instance_neighbors_peer_cmd
);
8558 install_element (ENABLE_NODE
, &show_bgp_instance_ipv6_neighbors_peer_cmd
);
8561 install_element (VIEW_NODE
, &show_ipv6_bgp_summary_cmd
);
8562 install_element (VIEW_NODE
, &show_ipv6_mbgp_summary_cmd
);
8563 install_element (ENABLE_NODE
, &show_ipv6_bgp_summary_cmd
);
8564 install_element (ENABLE_NODE
, &show_ipv6_mbgp_summary_cmd
);
8565 #endif /* HAVE_IPV6 */
8567 /* "show ip bgp paths" commands. */
8568 install_element (VIEW_NODE
, &show_ip_bgp_paths_cmd
);
8569 install_element (VIEW_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
8570 install_element (ENABLE_NODE
, &show_ip_bgp_paths_cmd
);
8571 install_element (ENABLE_NODE
, &show_ip_bgp_ipv4_paths_cmd
);
8573 /* "show ip bgp community" commands. */
8574 install_element (VIEW_NODE
, &show_ip_bgp_community_info_cmd
);
8575 install_element (ENABLE_NODE
, &show_ip_bgp_community_info_cmd
);
8577 /* "show ip bgp attribute-info" commands. */
8578 install_element (VIEW_NODE
, &show_ip_bgp_attr_info_cmd
);
8579 install_element (ENABLE_NODE
, &show_ip_bgp_attr_info_cmd
);
8581 /* "redistribute" commands. */
8582 install_element (BGP_NODE
, &bgp_redistribute_ipv4_cmd
);
8583 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_cmd
);
8584 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_cmd
);
8585 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_cmd
);
8586 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_cmd
);
8587 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_cmd
);
8588 install_element (BGP_NODE
, &bgp_redistribute_ipv4_rmap_metric_cmd
);
8589 install_element (BGP_NODE
, &bgp_redistribute_ipv4_metric_rmap_cmd
);
8590 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_rmap_metric_cmd
);
8591 install_element (BGP_NODE
, &no_bgp_redistribute_ipv4_metric_rmap_cmd
);
8593 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_cmd
);
8594 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_cmd
);
8595 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_cmd
);
8596 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_cmd
);
8597 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_cmd
);
8598 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_cmd
);
8599 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_rmap_metric_cmd
);
8600 install_element (BGP_IPV6_NODE
, &bgp_redistribute_ipv6_metric_rmap_cmd
);
8601 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_rmap_metric_cmd
);
8602 install_element (BGP_IPV6_NODE
, &no_bgp_redistribute_ipv6_metric_rmap_cmd
);
8603 #endif /* HAVE_IPV6 */
8605 /* Community-list. */
8606 community_list_vty ();
8610 #include "bgp_regex.h"
8611 #include "bgp_clist.h"
8612 #include "bgp_ecommunity.h"
8614 /* VTY functions. */
8616 /* Direction value to string conversion. */
8618 community_direct_str (int direct
)
8622 case COMMUNITY_DENY
:
8625 case COMMUNITY_PERMIT
:
8634 /* Display error string. */
8636 community_list_perror (struct vty
*vty
, int ret
)
8640 case COMMUNITY_LIST_ERR_CANT_FIND_LIST
:
8641 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
8643 case COMMUNITY_LIST_ERR_MALFORMED_VAL
:
8644 vty_out (vty
, "%% Malformed community-list value%s", VTY_NEWLINE
);
8646 case COMMUNITY_LIST_ERR_STANDARD_CONFLICT
:
8647 vty_out (vty
, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE
);
8649 case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT
:
8650 vty_out (vty
, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE
);
8655 /* VTY interface for community_set() function. */
8657 community_list_set_vty (struct vty
*vty
, int argc
, char **argv
, int style
,
8658 int reject_all_digit_name
)
8664 /* Check the list type. */
8665 if (strncmp (argv
[1], "p", 1) == 0)
8666 direct
= COMMUNITY_PERMIT
;
8667 else if (strncmp (argv
[1], "d", 1) == 0)
8668 direct
= COMMUNITY_DENY
;
8671 vty_out (vty
, "%% Matching condition must be permit or deny%s",
8676 /* All digit name check. */
8677 if (reject_all_digit_name
&& all_digit (argv
[0]))
8679 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
8683 /* Concat community string argument. */
8685 str
= argv_concat (argv
, argc
, 2);
8689 /* When community_list_set() return nevetive value, it means
8690 malformed community string. */
8691 ret
= community_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
8693 /* Free temporary community list string allocated by
8696 XFREE (MTYPE_TMP
, str
);
8700 /* Display error string. */
8701 community_list_perror (vty
, ret
);
8708 /* Community-list delete with name. */
8710 community_list_unset_all_vty (struct vty
*vty
, char *name
)
8714 ret
= community_list_unset (bgp_clist
, name
, NULL
, 0, COMMUNITY_LIST_AUTO
);
8718 community_list_perror (vty
, ret
);
8724 /* Communiyt-list entry delete. */
8726 community_list_unset_vty (struct vty
*vty
, int argc
, char **argv
, int style
)
8732 /* Check the list direct. */
8733 if (strncmp (argv
[1], "p", 1) == 0)
8734 direct
= COMMUNITY_PERMIT
;
8735 else if (strncmp (argv
[1], "d", 1) == 0)
8736 direct
= COMMUNITY_DENY
;
8739 vty_out (vty
, "%% Matching condition must be permit or deny%s",
8744 /* Concat community string argument. */
8745 str
= argv_concat (argv
, argc
, 2);
8747 /* Unset community list. */
8748 ret
= community_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
8750 /* Free temporary community list string allocated by
8752 XFREE (MTYPE_TMP
, str
);
8756 community_list_perror (vty
, ret
);
8763 /* "community-list" keyword help string. */
8764 #define COMMUNITY_LIST_STR "Add a community list entry\n"
8765 #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
8767 DEFUN (ip_community_list
,
8768 ip_community_list_cmd
,
8769 "ip community-list WORD (deny|permit) .AA:NN",
8772 "Community list name\n"
8773 "Specify community to reject\n"
8774 "Specify community to accept\n"
8777 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_AUTO
, 1);
8780 DEFUN (ip_community_list_standard
,
8781 ip_community_list_standard_cmd
,
8782 "ip community-list <1-99> (deny|permit) .AA:NN",
8785 "Community list number (standard)\n"
8786 "Specify community to reject\n"
8787 "Specify community to accept\n"
8790 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 0);
8793 ALIAS (ip_community_list_standard
,
8794 ip_community_list_standard2_cmd
,
8795 "ip community-list <1-99> (deny|permit)",
8798 "Community list number (standard)\n"
8799 "Specify community to reject\n"
8800 "Specify community to accept\n")
8802 DEFUN (ip_community_list_expanded
,
8803 ip_community_list_expanded_cmd
,
8804 "ip community-list <100-199> (deny|permit) .LINE",
8807 "Community list number (expanded)\n"
8808 "Specify community to reject\n"
8809 "Specify community to accept\n"
8810 "An ordered list as a regular-expression\n")
8812 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 0);
8815 DEFUN (ip_community_list_name_standard
,
8816 ip_community_list_name_standard_cmd
,
8817 "ip community-list standard WORD (deny|permit) .AA:NN",
8820 "Add a standard community-list entry\n"
8821 "Community list name\n"
8822 "Specify community to reject\n"
8823 "Specify community to accept\n"
8826 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
, 1);
8829 ALIAS (ip_community_list_name_standard
,
8830 ip_community_list_name_standard2_cmd
,
8831 "ip community-list standard WORD (deny|permit)",
8834 "Add a standard community-list entry\n"
8835 "Community list name\n"
8836 "Specify community to reject\n"
8837 "Specify community to accept\n")
8839 DEFUN (ip_community_list_name_expanded
,
8840 ip_community_list_name_expanded_cmd
,
8841 "ip community-list expanded WORD (deny|permit) .LINE",
8844 "Add an expanded community-list entry\n"
8845 "Community list name\n"
8846 "Specify community to reject\n"
8847 "Specify community to accept\n"
8848 "An ordered list as a regular-expression\n")
8850 return community_list_set_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
, 1);
8853 DEFUN (no_ip_community_list_all
,
8854 no_ip_community_list_all_cmd
,
8855 "no ip community-list (WORD|<1-99>|<100-199>)",
8859 "Community list name\n"
8860 "Community list number (standard)\n"
8861 "Community list number (expanded)\n")
8863 return community_list_unset_all_vty (vty
, argv
[0]);
8866 DEFUN (no_ip_community_list_name_all
,
8867 no_ip_community_list_name_all_cmd
,
8868 "no ip community-list (standard|expanded) WORD",
8872 "Add a standard community-list entry\n"
8873 "Add an expanded community-list entry\n"
8874 "Community list name\n")
8876 return community_list_unset_all_vty (vty
, argv
[1]);
8879 DEFUN (no_ip_community_list
,
8880 no_ip_community_list_cmd
,
8881 "no ip community-list WORD (deny|permit) .AA:NN",
8885 "Community list name\n"
8886 "Specify community to reject\n"
8887 "Specify community to accept\n"
8890 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_AUTO
);
8893 DEFUN (no_ip_community_list_standard
,
8894 no_ip_community_list_standard_cmd
,
8895 "no ip community-list <1-99> (deny|permit) .AA:NN",
8899 "Community list number (standard)\n"
8900 "Specify community to reject\n"
8901 "Specify community to accept\n"
8904 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
8907 DEFUN (no_ip_community_list_expanded
,
8908 no_ip_community_list_expanded_cmd
,
8909 "no ip community-list <100-199> (deny|permit) .LINE",
8913 "Community list number (expanded)\n"
8914 "Specify community to reject\n"
8915 "Specify community to accept\n"
8916 "An ordered list as a regular-expression\n")
8918 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
8921 DEFUN (no_ip_community_list_name_standard
,
8922 no_ip_community_list_name_standard_cmd
,
8923 "no ip community-list standard WORD (deny|permit) .AA:NN",
8927 "Specify a standard community-list\n"
8928 "Community list name\n"
8929 "Specify community to reject\n"
8930 "Specify community to accept\n"
8933 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_STANDARD
);
8936 DEFUN (no_ip_community_list_name_expanded
,
8937 no_ip_community_list_name_expanded_cmd
,
8938 "no ip community-list expanded WORD (deny|permit) .LINE",
8942 "Specify an expanded community-list\n"
8943 "Community list name\n"
8944 "Specify community to reject\n"
8945 "Specify community to accept\n"
8946 "An ordered list as a regular-expression\n")
8948 return community_list_unset_vty (vty
, argc
, argv
, COMMUNITY_LIST_EXPANDED
);
8952 community_list_show (struct vty
*vty
, struct community_list
*list
)
8954 struct community_entry
*entry
;
8956 for (entry
= list
->head
; entry
; entry
= entry
->next
)
8958 if (entry
== list
->head
)
8960 if (all_digit (list
->name
))
8961 vty_out (vty
, "Community %s list %s%s",
8962 entry
->style
== COMMUNITY_LIST_STANDARD
?
8963 "standard" : "(expanded) access",
8964 list
->name
, VTY_NEWLINE
);
8966 vty_out (vty
, "Named Community %s list %s%s",
8967 entry
->style
== COMMUNITY_LIST_STANDARD
?
8968 "standard" : "expanded",
8969 list
->name
, VTY_NEWLINE
);
8972 vty_out (vty
, " %s%s",
8973 community_direct_str (entry
->direct
), VTY_NEWLINE
);
8975 vty_out (vty
, " %s %s%s",
8976 community_direct_str (entry
->direct
),
8977 entry
->style
== COMMUNITY_LIST_STANDARD
8978 ? community_str (entry
->u
.com
) : entry
->config
,
8983 DEFUN (show_ip_community_list
,
8984 show_ip_community_list_cmd
,
8985 "show ip community-list",
8988 "List community-list\n")
8990 struct community_list
*list
;
8991 struct community_list_master
*cm
;
8993 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_AUTO
);
8997 for (list
= cm
->num
.head
; list
; list
= list
->next
)
8998 community_list_show (vty
, list
);
9000 for (list
= cm
->str
.head
; list
; list
= list
->next
)
9001 community_list_show (vty
, list
);
9006 DEFUN (show_ip_community_list_arg
,
9007 show_ip_community_list_arg_cmd
,
9008 "show ip community-list (<1-199>|WORD)",
9011 "List community-list\n"
9012 "Community-list number\n"
9013 "Community-list name\n")
9015 struct community_list
*list
;
9017 list
= community_list_lookup (bgp_clist
, argv
[0], COMMUNITY_LIST_AUTO
);
9020 vty_out (vty
, "%% Can't find communit-list%s", VTY_NEWLINE
);
9024 community_list_show (vty
, list
);
9030 extcommunity_list_set_vty (struct vty
*vty
, int argc
, char **argv
, int style
,
9031 int reject_all_digit_name
)
9037 /* Check the list type. */
9038 if (strncmp (argv
[1], "p", 1) == 0)
9039 direct
= COMMUNITY_PERMIT
;
9040 else if (strncmp (argv
[1], "d", 1) == 0)
9041 direct
= COMMUNITY_DENY
;
9044 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9049 /* All digit name check. */
9050 if (reject_all_digit_name
&& all_digit (argv
[0]))
9052 vty_out (vty
, "%% Community name cannot have all digits%s", VTY_NEWLINE
);
9056 /* Concat community string argument. */
9058 str
= argv_concat (argv
, argc
, 2);
9062 ret
= extcommunity_list_set (bgp_clist
, argv
[0], str
, direct
, style
);
9064 /* Free temporary community list string allocated by
9067 XFREE (MTYPE_TMP
, str
);
9071 community_list_perror (vty
, ret
);
9078 extcommunity_list_unset_all_vty (struct vty
*vty
, char *name
)
9082 ret
= extcommunity_list_unset (bgp_clist
, name
, NULL
, 0, EXTCOMMUNITY_LIST_AUTO
);
9086 community_list_perror (vty
, ret
);
9093 extcommunity_list_unset_vty (struct vty
*vty
, int argc
, char **argv
, int style
)
9099 /* Check the list direct. */
9100 if (strncmp (argv
[1], "p", 1) == 0)
9101 direct
= COMMUNITY_PERMIT
;
9102 else if (strncmp (argv
[1], "d", 1) == 0)
9103 direct
= COMMUNITY_DENY
;
9106 vty_out (vty
, "%% Matching condition must be permit or deny%s",
9111 /* Concat community string argument. */
9112 str
= argv_concat (argv
, argc
, 2);
9114 /* Unset community list. */
9115 ret
= extcommunity_list_unset (bgp_clist
, argv
[0], str
, direct
, style
);
9117 /* Free temporary community list string allocated by
9119 XFREE (MTYPE_TMP
, str
);
9123 community_list_perror (vty
, ret
);
9130 /* "extcommunity-list" keyword help string. */
9131 #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n"
9132 #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n"
9134 DEFUN (ip_extcommunity_list_standard
,
9135 ip_extcommunity_list_standard_cmd
,
9136 "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
9138 EXTCOMMUNITY_LIST_STR
9139 "Extended Community list number (standard)\n"
9140 "Specify community to reject\n"
9141 "Specify community to accept\n"
9142 EXTCOMMUNITY_VAL_STR
)
9144 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 0);
9147 ALIAS (ip_extcommunity_list_standard
,
9148 ip_extcommunity_list_standard2_cmd
,
9149 "ip extcommunity-list <1-99> (deny|permit)",
9151 EXTCOMMUNITY_LIST_STR
9152 "Extended Community list number (standard)\n"
9153 "Specify community to reject\n"
9154 "Specify community to accept\n")
9156 DEFUN (ip_extcommunity_list_expanded
,
9157 ip_extcommunity_list_expanded_cmd
,
9158 "ip extcommunity-list <100-199> (deny|permit) .LINE",
9160 EXTCOMMUNITY_LIST_STR
9161 "Extended Community list number (expanded)\n"
9162 "Specify community to reject\n"
9163 "Specify community to accept\n"
9164 "An ordered list as a regular-expression\n")
9166 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 0);
9169 DEFUN (ip_extcommunity_list_name_standard
,
9170 ip_extcommunity_list_name_standard_cmd
,
9171 "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
9173 EXTCOMMUNITY_LIST_STR
9174 "Specify standard extcommunity-list\n"
9175 "Extended Community list name\n"
9176 "Specify community to reject\n"
9177 "Specify community to accept\n"
9178 EXTCOMMUNITY_VAL_STR
)
9180 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
, 1);
9183 ALIAS (ip_extcommunity_list_name_standard
,
9184 ip_extcommunity_list_name_standard2_cmd
,
9185 "ip extcommunity-list standard WORD (deny|permit)",
9187 EXTCOMMUNITY_LIST_STR
9188 "Specify standard extcommunity-list\n"
9189 "Extended Community list name\n"
9190 "Specify community to reject\n"
9191 "Specify community to accept\n")
9193 DEFUN (ip_extcommunity_list_name_expanded
,
9194 ip_extcommunity_list_name_expanded_cmd
,
9195 "ip extcommunity-list expanded WORD (deny|permit) .LINE",
9197 EXTCOMMUNITY_LIST_STR
9198 "Specify expanded extcommunity-list\n"
9199 "Extended Community list name\n"
9200 "Specify community to reject\n"
9201 "Specify community to accept\n"
9202 "An ordered list as a regular-expression\n")
9204 return extcommunity_list_set_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
, 1);
9207 DEFUN (no_ip_extcommunity_list_all
,
9208 no_ip_extcommunity_list_all_cmd
,
9209 "no ip extcommunity-list (<1-99>|<100-199>)",
9212 EXTCOMMUNITY_LIST_STR
9213 "Extended Community list number (standard)\n"
9214 "Extended Community list number (expanded)\n")
9216 return extcommunity_list_unset_all_vty (vty
, argv
[0]);
9219 DEFUN (no_ip_extcommunity_list_name_all
,
9220 no_ip_extcommunity_list_name_all_cmd
,
9221 "no ip extcommunity-list (standard|expanded) WORD",
9224 EXTCOMMUNITY_LIST_STR
9225 "Specify standard extcommunity-list\n"
9226 "Specify expanded extcommunity-list\n"
9227 "Extended Community list name\n")
9229 return extcommunity_list_unset_all_vty (vty
, argv
[1]);
9232 DEFUN (no_ip_extcommunity_list_standard
,
9233 no_ip_extcommunity_list_standard_cmd
,
9234 "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
9237 EXTCOMMUNITY_LIST_STR
9238 "Extended Community list number (standard)\n"
9239 "Specify community to reject\n"
9240 "Specify community to accept\n"
9241 EXTCOMMUNITY_VAL_STR
)
9243 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
9246 DEFUN (no_ip_extcommunity_list_expanded
,
9247 no_ip_extcommunity_list_expanded_cmd
,
9248 "no ip extcommunity-list <100-199> (deny|permit) .LINE",
9251 EXTCOMMUNITY_LIST_STR
9252 "Extended Community list number (expanded)\n"
9253 "Specify community to reject\n"
9254 "Specify community to accept\n"
9255 "An ordered list as a regular-expression\n")
9257 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
9260 DEFUN (no_ip_extcommunity_list_name_standard
,
9261 no_ip_extcommunity_list_name_standard_cmd
,
9262 "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
9265 EXTCOMMUNITY_LIST_STR
9266 "Specify standard extcommunity-list\n"
9267 "Extended Community list name\n"
9268 "Specify community to reject\n"
9269 "Specify community to accept\n"
9270 EXTCOMMUNITY_VAL_STR
)
9272 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_STANDARD
);
9275 DEFUN (no_ip_extcommunity_list_name_expanded
,
9276 no_ip_extcommunity_list_name_expanded_cmd
,
9277 "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
9280 EXTCOMMUNITY_LIST_STR
9281 "Specify expanded extcommunity-list\n"
9282 "Community list name\n"
9283 "Specify community to reject\n"
9284 "Specify community to accept\n"
9285 "An ordered list as a regular-expression\n")
9287 return extcommunity_list_unset_vty (vty
, argc
, argv
, EXTCOMMUNITY_LIST_EXPANDED
);
9291 extcommunity_list_show (struct vty
*vty
, struct community_list
*list
)
9293 struct community_entry
*entry
;
9295 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9297 if (entry
== list
->head
)
9299 if (all_digit (list
->name
))
9300 vty_out (vty
, "Extended community %s list %s%s",
9301 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
9302 "standard" : "(expanded) access",
9303 list
->name
, VTY_NEWLINE
);
9305 vty_out (vty
, "Named extended community %s list %s%s",
9306 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
9307 "standard" : "expanded",
9308 list
->name
, VTY_NEWLINE
);
9311 vty_out (vty
, " %s%s",
9312 community_direct_str (entry
->direct
), VTY_NEWLINE
);
9314 vty_out (vty
, " %s %s%s",
9315 community_direct_str (entry
->direct
),
9316 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
?
9317 entry
->u
.ecom
->str
: entry
->config
,
9322 DEFUN (show_ip_extcommunity_list
,
9323 show_ip_extcommunity_list_cmd
,
9324 "show ip extcommunity-list",
9327 "List extended-community list\n")
9329 struct community_list
*list
;
9330 struct community_list_master
*cm
;
9332 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_AUTO
);
9336 for (list
= cm
->num
.head
; list
; list
= list
->next
)
9337 extcommunity_list_show (vty
, list
);
9339 for (list
= cm
->str
.head
; list
; list
= list
->next
)
9340 extcommunity_list_show (vty
, list
);
9345 DEFUN (show_ip_extcommunity_list_arg
,
9346 show_ip_extcommunity_list_arg_cmd
,
9347 "show ip extcommunity-list (<1-199>|WORD)",
9350 "List extended-community list\n"
9351 "Extcommunity-list number\n"
9352 "Extcommunity-list name\n")
9354 struct community_list
*list
;
9356 list
= community_list_lookup (bgp_clist
, argv
[0], EXTCOMMUNITY_LIST_AUTO
);
9359 vty_out (vty
, "%% Can't find extcommunit-list%s", VTY_NEWLINE
);
9363 extcommunity_list_show (vty
, list
);
9368 /* Return configuration string of community-list entry. */
9370 community_list_config_str (struct community_entry
*entry
)
9378 if (entry
->style
== COMMUNITY_LIST_STANDARD
)
9379 str
= community_str (entry
->u
.com
);
9381 str
= entry
->config
;
9386 /* Display community-list and extcommunity-list configuration. */
9388 community_list_config_write (struct vty
*vty
)
9390 struct community_list
*list
;
9391 struct community_entry
*entry
;
9392 struct community_list_master
*cm
;
9395 /* Community-list. */
9396 cm
= community_list_master_lookup (bgp_clist
, COMMUNITY_LIST_AUTO
);
9398 for (list
= cm
->num
.head
; list
; list
= list
->next
)
9399 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9401 if (atol (list
->name
) < 200)
9402 vty_out (vty
, "ip community-list %s %s %s%s",
9403 list
->name
, community_direct_str (entry
->direct
),
9404 community_list_config_str (entry
),
9407 vty_out (vty
, "ip community-list %s %s %s %s%s",
9408 entry
->style
== COMMUNITY_LIST_STANDARD
9409 ? "standard" : "expanded",
9410 list
->name
, community_direct_str (entry
->direct
),
9411 community_list_config_str (entry
),
9415 for (list
= cm
->str
.head
; list
; list
= list
->next
)
9416 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9418 vty_out (vty
, "ip community-list %s %s %s %s%s",
9419 entry
->style
== COMMUNITY_LIST_STANDARD
9420 ? "standard" : "expanded",
9421 list
->name
, community_direct_str (entry
->direct
),
9422 community_list_config_str (entry
),
9427 /* Extcommunity-list. */
9428 cm
= community_list_master_lookup (bgp_clist
, EXTCOMMUNITY_LIST_AUTO
);
9430 for (list
= cm
->num
.head
; list
; list
= list
->next
)
9431 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9433 if (atol (list
->name
) < 200)
9434 vty_out (vty
, "ip extcommunity-list %s %s %s%s",
9435 list
->name
, community_direct_str (entry
->direct
),
9436 community_list_config_str (entry
), VTY_NEWLINE
);
9438 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
9439 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
9440 ? "standard" : "expanded",
9441 list
->name
, community_direct_str (entry
->direct
),
9442 community_list_config_str (entry
), VTY_NEWLINE
);
9445 for (list
= cm
->str
.head
; list
; list
= list
->next
)
9446 for (entry
= list
->head
; entry
; entry
= entry
->next
)
9448 vty_out (vty
, "ip extcommunity-list %s %s %s %s%s",
9449 entry
->style
== EXTCOMMUNITY_LIST_STANDARD
9450 ? "standard" : "expanded",
9451 list
->name
, community_direct_str (entry
->direct
),
9452 community_list_config_str (entry
), VTY_NEWLINE
);
9458 struct cmd_node community_list_node
=
9460 COMMUNITY_LIST_NODE
,
9462 1 /* Export to vtysh. */
9466 community_list_vty ()
9468 install_node (&community_list_node
, community_list_config_write
);
9470 /* Community-list. */
9471 install_element (CONFIG_NODE
, &ip_community_list_cmd
);
9472 install_element (CONFIG_NODE
, &ip_community_list_standard_cmd
);
9473 install_element (CONFIG_NODE
, &ip_community_list_standard2_cmd
);
9474 install_element (CONFIG_NODE
, &ip_community_list_expanded_cmd
);
9475 install_element (CONFIG_NODE
, &ip_community_list_name_standard_cmd
);
9476 install_element (CONFIG_NODE
, &ip_community_list_name_standard2_cmd
);
9477 install_element (CONFIG_NODE
, &ip_community_list_name_expanded_cmd
);
9478 install_element (CONFIG_NODE
, &no_ip_community_list_all_cmd
);
9479 install_element (CONFIG_NODE
, &no_ip_community_list_name_all_cmd
);
9480 install_element (CONFIG_NODE
, &no_ip_community_list_cmd
);
9481 install_element (CONFIG_NODE
, &no_ip_community_list_standard_cmd
);
9482 install_element (CONFIG_NODE
, &no_ip_community_list_expanded_cmd
);
9483 install_element (CONFIG_NODE
, &no_ip_community_list_name_standard_cmd
);
9484 install_element (CONFIG_NODE
, &no_ip_community_list_name_expanded_cmd
);
9485 install_element (VIEW_NODE
, &show_ip_community_list_cmd
);
9486 install_element (VIEW_NODE
, &show_ip_community_list_arg_cmd
);
9487 install_element (ENABLE_NODE
, &show_ip_community_list_cmd
);
9488 install_element (ENABLE_NODE
, &show_ip_community_list_arg_cmd
);
9490 /* Extcommunity-list. */
9491 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard_cmd
);
9492 install_element (CONFIG_NODE
, &ip_extcommunity_list_standard2_cmd
);
9493 install_element (CONFIG_NODE
, &ip_extcommunity_list_expanded_cmd
);
9494 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard_cmd
);
9495 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_standard2_cmd
);
9496 install_element (CONFIG_NODE
, &ip_extcommunity_list_name_expanded_cmd
);
9497 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_all_cmd
);
9498 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_all_cmd
);
9499 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_standard_cmd
);
9500 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_expanded_cmd
);
9501 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_standard_cmd
);
9502 install_element (CONFIG_NODE
, &no_ip_extcommunity_list_name_expanded_cmd
);
9503 install_element (VIEW_NODE
, &show_ip_extcommunity_list_cmd
);
9504 install_element (VIEW_NODE
, &show_ip_extcommunity_list_arg_cmd
);
9505 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_cmd
);
9506 install_element (ENABLE_NODE
, &show_ip_extcommunity_list_arg_cmd
);