version 1.1.1.2, 2012/10/09 09:22:28
|
version 1.1.1.3, 2013/07/21 23:54:38
|
Line 1570 DEFUN (neighbor_local_as,
|
Line 1570 DEFUN (neighbor_local_as,
|
if (! peer) |
if (! peer) |
return CMD_WARNING; |
return CMD_WARNING; |
|
|
ret = peer_local_as_set (peer, atoi (argv[1]), 0); | ret = peer_local_as_set (peer, atoi (argv[1]), 0, 0); |
return bgp_vty_return (vty, ret); |
return bgp_vty_return (vty, ret); |
} |
} |
|
|
Line 1590 DEFUN (neighbor_local_as_no_prepend,
|
Line 1590 DEFUN (neighbor_local_as_no_prepend,
|
if (! peer) |
if (! peer) |
return CMD_WARNING; |
return CMD_WARNING; |
|
|
ret = peer_local_as_set (peer, atoi (argv[1]), 1); | ret = peer_local_as_set (peer, atoi (argv[1]), 1, 0); |
return bgp_vty_return (vty, ret); |
return bgp_vty_return (vty, ret); |
} |
} |
|
|
|
DEFUN (neighbor_local_as_no_prepend_replace_as, |
|
neighbor_local_as_no_prepend_replace_as_cmd, |
|
NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
|
NEIGHBOR_STR |
|
NEIGHBOR_ADDR_STR2 |
|
"Specify a local-as number\n" |
|
"AS number used as local AS\n" |
|
"Do not prepend local-as to updates from ebgp peers\n" |
|
"Do not prepend local-as to updates from ibgp peers\n") |
|
{ |
|
struct peer *peer; |
|
int ret; |
|
|
|
peer = peer_and_group_lookup_vty (vty, argv[0]); |
|
if (! peer) |
|
return CMD_WARNING; |
|
|
|
ret = peer_local_as_set (peer, atoi (argv[1]), 1, 1); |
|
return bgp_vty_return (vty, ret); |
|
} |
|
|
|
|
DEFUN (no_neighbor_local_as, |
DEFUN (no_neighbor_local_as, |
no_neighbor_local_as_cmd, |
no_neighbor_local_as_cmd, |
NO_NEIGHBOR_CMD2 "local-as", |
NO_NEIGHBOR_CMD2 "local-as", |
Line 1631 ALIAS (no_neighbor_local_as,
|
Line 1653 ALIAS (no_neighbor_local_as,
|
"Specify a local-as number\n" |
"Specify a local-as number\n" |
"AS number used as local AS\n" |
"AS number used as local AS\n" |
"Do not prepend local-as to updates from ebgp peers\n") |
"Do not prepend local-as to updates from ebgp peers\n") |
|
|
|
ALIAS (no_neighbor_local_as, |
|
no_neighbor_local_as_val3_cmd, |
|
NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
|
NO_STR |
|
NEIGHBOR_STR |
|
NEIGHBOR_ADDR_STR2 |
|
"Specify a local-as number\n" |
|
"AS number used as local AS\n" |
|
"Do not prepend local-as to updates from ebgp peers\n" |
|
"Do not prepend local-as to updates from ibgp peers\n") |
|
|
DEFUN (neighbor_password, |
DEFUN (neighbor_password, |
neighbor_password_cmd, |
neighbor_password_cmd, |
Line 2943 peer_update_source_vty (struct vty *vty, const char *p
|
Line 2976 peer_update_source_vty (struct vty *vty, const char *p
|
const char *source_str) |
const char *source_str) |
{ |
{ |
struct peer *peer; |
struct peer *peer; |
union sockunion *su; |
|
|
|
peer = peer_and_group_lookup_vty (vty, peer_str); |
peer = peer_and_group_lookup_vty (vty, peer_str); |
if (! peer) |
if (! peer) |
Line 2951 peer_update_source_vty (struct vty *vty, const char *p
|
Line 2983 peer_update_source_vty (struct vty *vty, const char *p
|
|
|
if (source_str) |
if (source_str) |
{ |
{ |
su = sockunion_str2su (source_str); | union sockunion su; |
if (su) | int ret = str2sockunion (source_str, &su); |
{ | |
peer_update_source_addr_set (peer, su); | if (ret == 0) |
sockunion_free (su); | peer_update_source_addr_set (peer, &su); |
} | |
else |
else |
peer_update_source_if_set (peer, source_str); |
peer_update_source_if_set (peer, source_str); |
} |
} |
Line 4342 bgp_clear (struct vty *vty, struct bgp *bgp, afi_t af
|
Line 4373 bgp_clear (struct vty *vty, struct bgp *bgp, afi_t af
|
{ |
{ |
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
{ |
{ |
if (peer_sort (peer) == BGP_PEER_IBGP) | if (peer->sort == BGP_PEER_IBGP) |
continue; |
continue; |
|
|
if (stype == BGP_CLEAR_SOFT_NONE) |
if (stype == BGP_CLEAR_SOFT_NONE) |
Line 7496 bgp_show_peer (struct vty *vty, struct peer *p)
|
Line 7527 bgp_show_peer (struct vty *vty, struct peer *p)
|
/* Configured IP address. */ |
/* Configured IP address. */ |
vty_out (vty, "BGP neighbor is %s, ", p->host); |
vty_out (vty, "BGP neighbor is %s, ", p->host); |
vty_out (vty, "remote AS %u, ", p->as); |
vty_out (vty, "remote AS %u, ", p->as); |
vty_out (vty, "local AS %u%s, ", | vty_out (vty, "local AS %u%s%s, ", |
p->change_local_as ? p->change_local_as : p->local_as, |
p->change_local_as ? p->change_local_as : p->local_as, |
CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? |
CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? |
" no-prepend" : ""); | " no-prepend" : "", |
| CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) ? |
| " replace-as" : ""); |
vty_out (vty, "%s link%s", |
vty_out (vty, "%s link%s", |
p->as == p->local_as ? "internal" : "external", |
p->as == p->local_as ? "internal" : "external", |
VTY_NEWLINE); |
VTY_NEWLINE); |
Line 7783 bgp_show_peer (struct vty *vty, struct peer *p)
|
Line 7816 bgp_show_peer (struct vty *vty, struct peer *p)
|
} |
} |
|
|
/* EBGP Multihop and GTSM */ |
/* EBGP Multihop and GTSM */ |
if (peer_sort (p) != BGP_PEER_IBGP) | if (p->sort != BGP_PEER_IBGP) |
{ |
{ |
if (p->gtsm_hops > 0) |
if (p->gtsm_hops > 0) |
vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
Line 8966 bgp_config_write_redistribute (struct vty *vty, struct
|
Line 8999 bgp_config_write_redistribute (struct vty *vty, struct
|
vty_out (vty, " redistribute %s", zebra_route_string(i)); |
vty_out (vty, " redistribute %s", zebra_route_string(i)); |
|
|
if (bgp->redist_metric_flag[afi][i]) |
if (bgp->redist_metric_flag[afi][i]) |
vty_out (vty, " metric %d", bgp->redist_metric[afi][i]); | vty_out (vty, " metric %u", bgp->redist_metric[afi][i]); |
|
|
if (bgp->rmap[afi][i].name) |
if (bgp->rmap[afi][i].name) |
vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); |
vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); |
Line 9177 bgp_vty_init (void)
|
Line 9210 bgp_vty_init (void)
|
/* "neighbor local-as" commands. */ |
/* "neighbor local-as" commands. */ |
install_element (BGP_NODE, &neighbor_local_as_cmd); |
install_element (BGP_NODE, &neighbor_local_as_cmd); |
install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd); |
install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd); |
|
install_element (BGP_NODE, &neighbor_local_as_no_prepend_replace_as_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_val_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_val_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd); |
install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd); |
|
install_element (BGP_NODE, &no_neighbor_local_as_val3_cmd); |
|
|
/* "neighbor password" commands. */ |
/* "neighbor password" commands. */ |
install_element (BGP_NODE, &neighbor_password_cmd); |
install_element (BGP_NODE, &neighbor_password_cmd); |