⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bgp_vty.c

📁 linux 路由软件 可支持RIP OSPF BGP等
💻 C
📖 第 1 页 / 共 5 页
字号:
}DEFUN (no_neighbor_send_community_type,       no_neighbor_send_community_type_cmd,       NO_NEIGHBOR_CMD2 "send-community (both|extended|standard)",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Send Community attribute to this neighbor\n"       "Send Standard and Extended Community attributes\n"       "Send Extended Community attributes\n"       "Send Standard Community attributes\n"){  if (strncmp (argv[1], "s", 1) == 0)    return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				   bgp_node_safi (vty),				   PEER_FLAG_SEND_COMMUNITY);  if (strncmp (argv[1], "e", 1) == 0)    return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				   bgp_node_safi (vty),				   PEER_FLAG_SEND_EXT_COMMUNITY);  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty),				 (PEER_FLAG_SEND_COMMUNITY |				  PEER_FLAG_SEND_EXT_COMMUNITY));}/* neighbor soft-reconfig. */DEFUN (neighbor_soft_reconfiguration,       neighbor_soft_reconfiguration_cmd,       NEIGHBOR_CMD2 "soft-reconfiguration inbound",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Per neighbor soft reconfiguration\n"       "Allow inbound soft reconfiguration for this neighbor\n"){  return peer_af_flag_set_vty (vty, argv[0],			       bgp_node_afi (vty), bgp_node_safi (vty),			       PEER_FLAG_SOFT_RECONFIG);}DEFUN (no_neighbor_soft_reconfiguration,       no_neighbor_soft_reconfiguration_cmd,       NO_NEIGHBOR_CMD2 "soft-reconfiguration inbound",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Per neighbor soft reconfiguration\n"       "Allow inbound soft reconfiguration for this neighbor\n"){  return peer_af_flag_unset_vty (vty, argv[0],				 bgp_node_afi (vty), bgp_node_safi (vty),				 PEER_FLAG_SOFT_RECONFIG);}DEFUN (neighbor_route_reflector_client,       neighbor_route_reflector_client_cmd,       NEIGHBOR_CMD2 "route-reflector-client",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Configure a neighbor as Route Reflector client\n"){  struct peer *peer;  peer = peer_and_group_lookup_vty (vty, argv[0]);  if (! peer)    return CMD_WARNING;  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty),			       PEER_FLAG_REFLECTOR_CLIENT);}DEFUN (no_neighbor_route_reflector_client,       no_neighbor_route_reflector_client_cmd,       NO_NEIGHBOR_CMD2 "route-reflector-client",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Configure a neighbor as Route Reflector client\n"){  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty),				 PEER_FLAG_REFLECTOR_CLIENT);}/* neighbor route-server-client. */DEFUN (neighbor_route_server_client,       neighbor_route_server_client_cmd,       NEIGHBOR_CMD2 "route-server-client",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Configure a neighbor as Route Server client\n"){  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty),			       PEER_FLAG_RSERVER_CLIENT);}DEFUN (no_neighbor_route_server_client,       no_neighbor_route_server_client_cmd,       NO_NEIGHBOR_CMD2 "route-server-client",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Configure a neighbor as Route Server client\n"){  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty),				 PEER_FLAG_RSERVER_CLIENT);}DEFUN (neighbor_attr_unchanged,       neighbor_attr_unchanged_cmd,       NEIGHBOR_CMD2 "attribute-unchanged",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"){  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty),			       (PEER_FLAG_AS_PATH_UNCHANGED |				PEER_FLAG_NEXTHOP_UNCHANGED |				PEER_FLAG_MED_UNCHANGED));}DEFUN (neighbor_attr_unchanged1,       neighbor_attr_unchanged1_cmd,       NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n"){  u_int16_t flags = 0;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty), flags);}DEFUN (neighbor_attr_unchanged2,       neighbor_attr_unchanged2_cmd,       NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n"){  u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED;  if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty), flags);}DEFUN (neighbor_attr_unchanged3,       neighbor_attr_unchanged3_cmd,       NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "As-path attribute\n"       "Med attribute\n"){  u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty), flags);}DEFUN (neighbor_attr_unchanged4,       neighbor_attr_unchanged4_cmd,       NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "As-path attribute\n"       "Nexthop attribute\n"){  u_int16_t flags = PEER_FLAG_MED_UNCHANGED;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty),			       bgp_node_safi (vty), flags);}ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged5_cmd,       NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n");ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged6_cmd,       NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Med attribute\n"       "Nexthop attribute\n");ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged7_cmd,       NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "Med attribute\n"       "As-path attribute\n");ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged8_cmd,       NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "As-path attribute\n"       "Med attribute\n");ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged9_cmd,       NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "Nexthop attribute\n"       "As-path attribute\n");ALIAS (neighbor_attr_unchanged,       neighbor_attr_unchanged10_cmd,       NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "As-path attribute\n"       "Nexthop attribute\n");DEFUN (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged",       NO_STR	        NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"){  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty),				 (PEER_FLAG_AS_PATH_UNCHANGED |				  PEER_FLAG_NEXTHOP_UNCHANGED |				  PEER_FLAG_MED_UNCHANGED));}DEFUN (no_neighbor_attr_unchanged1,       no_neighbor_attr_unchanged1_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n"){  u_int16_t flags = 0;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty), flags);}DEFUN (no_neighbor_attr_unchanged2,       no_neighbor_attr_unchanged2_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n"){  u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED;  if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty), flags);}DEFUN (no_neighbor_attr_unchanged3,       no_neighbor_attr_unchanged3_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "As-path attribute\n"       "Med attribute\n"){  u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "med", 1) == 0)    SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED);  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty), flags);}DEFUN (no_neighbor_attr_unchanged4,       no_neighbor_attr_unchanged4_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "As-path attribute\n"       "Nexthop attribute\n"){  u_int16_t flags = PEER_FLAG_MED_UNCHANGED;  if (strncmp (argv[1], "as-path", 1) == 0)    SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED);  else if (strncmp (argv[1], "next-hop", 1) == 0)    SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED);  return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty),				 bgp_node_safi (vty), flags);}ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged5_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Nexthop attribute\n"       "Med attribute\n");ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged6_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "As-path attribute\n"       "Med attribute\n"       "Nexthop attribute\n");ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged7_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "Med attribute\n"       "As-path attribute\n");ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged8_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Nexthop attribute\n"       "As-path attribute\n"       "Med attribute\n");ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged9_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "Nexthop attribute\n"       "As-path attribute\n");ALIAS (no_neighbor_attr_unchanged,       no_neighbor_attr_unchanged10_cmd,       NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",       NO_STR       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "BGP attribute is propagated unchanged to this neighbor\n"       "Med attribute\n"       "As-path attribute\n"       "Nexthop attribute\n");/* EBGP multihop configuration. */intpeer_ebgp_multihop_set_vty (struct vty *vty, char *ip_str, char *ttl_str){  struct peer *peer;  int ttl;  peer = peer_and_group_lookup_vty (vty, ip_str);  if (! peer)    return CMD_WARNING;  if (! ttl_str)    ttl = TTL_MAX;  else    VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255);  peer_ebgp_multihop_set (peer, ttl);  return CMD_SUCCESS;}intpeer_ebgp_multihop_unset_vty (struct vty *vty, char *ip_str) {  struct peer *peer;  peer = peer_and_group_lookup_vty (vty, ip_str);  if (! peer)    return CMD_WARNING;  peer_ebgp_multihop_unset (peer);  return CMD_SUCCESS;}/* neighbor ebgp-multihop. */DEFUN (neighbor_ebgp_multihop,       neighbor_ebgp_multihop_cmd,       NEIGHBOR_CMD2 "ebgp-multihop",       NEIGHBOR_STR       NEIGHBOR_ADDR_STR2       "Allow EBGP neighbors not on directly connected networks\n"){  return peer_ebgp_multihop_set_vty (vty, argv[0], NULL);}DEFUN (neighbor_ebgp_multihop_ttl,       neighbor_ebgp_multihop_ttl_cmd,       NEIGHBOR_CMD2 "ebgp-multihop <1-255>",       NEIGHBOR

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -