00 BGP常用命令速查

相关链接

【cisco 命令参考手册】https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-15-5m-t/products-command-reference-list.html
【GNS3官网】https://gns3.com/
【GNS3下载】https://gns3.com/software/download
【appliances】https://gns3.com/marketplace/appliances

SecureCRT的快捷键

  • Ctrl + Tab 切换窗口
  • Alt + num 快速切换到指定窗口
  • Ctrl + A 回到命令最前面
  • Ctrl + E 回到命令最后面
#断开bgp邻居并重新建立,默认为硬重置,soft为软清除
clear ip bgp
'''perform a hard reset of all current BGP sessions.
'''After enabling thebgpasnotationdot command, a hard reset must be initiated for all BGPsessions by entering the clear ip bgp * command.
clear ip bgp * soft

BGP 命令汇总


命令作用
show tcp brief查看TCP 连接信息摘要
show ip bgp neighbors查看邻居的TCP 和BGP 连接的详细信息
show ip bgp summary查看BGP 连接的摘要信息
show ip bgp查看BGP 表的信息
show ip bgp community查看BGP 团体属性
clear ip bgp *重置BGP 连接
router bgp启动BGP 进程
synchronization / no synchronization打开/关闭同步
bgp router-id配置BGP 路由器ID
neighbor ip-address remote-as配置邻居路由器及所在的AS
neighbor ip-address update-source指定更新源
neighbor ip-address next-hop-self配置下一跳自我
neighbor ip-address route-reflector-client配置RR 客户端
network通告网络
aggregate-address配置地址聚合
ip prefix-list配置前缀列表
set origin egp设置起源代码为EGP
set as-path prepend配置追加AS-PATH
set local-preference设置本地优先级属性值
bgp default local-preference设置默认本地优先级属性值
bgp confederation identifier配置联邦ID
bgp confederation peers配置联邦EBGP 对等的成员
set community local-AS设置团体属性
neighbor ip-address send-community开启发送团体属性的能力

BGP Command Reference


aggregate-address

aggregate-address address mask [as-set] [as-confed-set] [summary-only] [suppress-map map-name]
[advertise-map map-name] [attribute-map map-name]
no aggregate-address address mask [as-set] [as-confed-set] [summary-only] [suppress-map
map-name] [advertise-map map-name] [attribute-map map-name]

SnytaxDescription
addressAggregate address.
maskAggregate mask.
as-set(Optional) Generates autonomous system set path information.
as-confed-set(Optional) Generates autonomous confederation set path information.
summary-only(Optional) Filters all more-specific routes from updates.
suppress-map map-name(Optional) Specifies the name of the route map used to select the routes to be suppressed.
advertise-map map-name(Optional) Specifies the name of the route map used to select the routes to create AS_SET origin communities.
attribute-map map-name(Optional) Specifies the name of the route map used to set the attribute of the aggregate route.

Command Default  The atomic aggregate attribute is set automatically when an aggregate route is created with this command unless the as-set keyword is specified.

Command Modes   Address family configuration (config-router-af)
            Router configuration (config-router)

ip prefix-list

To create a prefix list or to add a prefix-list entry, use the ip prefix-list command in global configuration mode. To delete a prefix-list entry, use the no form of this command.

ip prefix-list {list-name [seq number] {deny | permit} network/length [ge ge-length] [le le-length]
| description description | sequence-number}
no ip prefix-list {list-name [seq number] [{deny | permit} network/length [ge ge-length] [le
le-length]] | description description | sequence-number}

SnytaxDescription
list-nameConfigures a name to identify the prefix list. Do not use the word “detail” or “summary” as a list name because they are keywords in the show ip prefix-list command.
seq(Optional) Applies a sequence number to a prefix-list entry.
number(Optional) Integer from 1 to 4294967294. If a sequence number is not entered when configuring this command, default sequence numbering is applied to the prefix list. The number 5 is applied to the first prefix entry, and subsequent unnumbered entries are incremented by 5.
denyDenies access for a matching condition.
permitPermits access for a matching condition.
network/lengthConfigures the network address and the length of the network mask in bits. The network number can be any valid IP address or prefix. The bit mask can be a number from 1 to 32.
ge(Optional) Specifies the lesser value of a range (the “from” portion of the range description) by applying the ge-length argument to the range specified. Note The ge keyword represents the greater than or equal to operator.
ge-length(Optional) Represents the minimum prefix length to be matched.
le(Optional) Specifies the greater value of a range (the “to” portion of the range description) by applying the le-length argument to the range specified. Note The le keyword represents the less than or equal to operator.
le-length(Optional) Represents the maximum prefix length to be matched.
description(Optional) Configures a descriptive name for the prefix list.
description(Optional) Descriptive name of the prefix list, from 1 to 80 characters in length.
sequence-number(Optional) Enables or disables the use of sequence numbers for prefix lists.

Command Default  No prefix lists or prefix-list entries are created.

Command Modes   Global configuration (config)

route-map (IP)

Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.

match ip address prefix-list

Matches routes that pass a prefix list.

set origin

To set the BGP origin code, use the set origin command in route-map configuration mode. To delete an entry, use the no form of this command.

set origin {igp | egp autonomous-system-number | incomplete}
no set origin {igp | egp autonomous-system-number | incomplete}

SyntaxDescription
igpRemote Interior Gateway Protocol (IGP) system.
egpLocal Exterior Gateway Protocol (EGP) system.
autonomous-system-nnumberNumber of a remote autonomous system number. The range of values for this argument is any valid autonomous system number from 1 to 65535.
incompleteUnknown heritage.

Command Default  The origin of the route is based on the path information of the route in the main IP routing table.

Command Modes   Route-map configuration (config-route-map)

neighbor route-map

To apply a route map to incoming or outgoing routes, use the neighbor route-map command in address family or router configuration mode. To remove a route map, use the no form of this command.

neighbor{ip-address peer-group-name | ipv6-address[{%}]}route-map map-name{in | out}
no neighbor{ip-address peer-group-name | ipv6-address[{%}]}route-map map-name{in | out}

SyntaxDescription
ip-addressIP address of the neighbor.
peer-group-nameName of a BGP or multiprotocol BGP peer group.
ipv6-addressIPv6 address of the neighbor.
%(Optional) IPv6 link-local address identifier. This keyword needs to be added whenever a link-local IPv6 address is used outside the context of its interface.
map-nameName of a route map.
inApplies route map to incoming routes.
outApplies route map to incoming routes.

Command Default  No route maps are applied to a peer.

Command Modes   Router configuration (config-router)

set as-path

When you manually set the OSPF route tag, to convert the tag into an autonomous system path for BGP routes,
use the set as-path command in the route-map configuration mode. To not modify the autonomous system
path, use the no form of this command.

set as-path {tag | prepend as-path-string}
no set as-path {tag | prepend as-path-string}

The set as-path command and the associated no command have no effect when the OSPF route tag is automatically set through IBGP. When the ASN is received from an IBGP peer, the ASN is set as the OSPF route tag and converted into an autonomous system path for BGP routers.

SyntaxDescription
tagConverts the manually-set tag of a route into an autonomous system path. Applies only when redistributing routes into BGP.
prependAppends the string following the keyword prepend to the autonomous system path of the route that is matched by the route map. Applies to inbound and outbound BGP route maps.
as-path-stringNumber of an autonomous system to prepend to the AS_PATH attribute. The range of values for this argument is any valid autonomous system number from 1 to 65535. Multiple values can be entered; up to 10 AS numbers can be entered.
• In Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, and later releases, 4-byte autonomous system numbers are supported in the range from 65536 to 4294967295 in asplain notation and in the range from 1.0 to 65535.65535 in asdot notation.
• In Cisco IOS Release 12.0(32)S12, 12.4(24)T, and Cisco IOS XE Release 2.3, 4-byte autonomous system numbers are supported in the range from 1.0 to 65535.65535 in asdot notation only.
For more details about autonomous system number formats, see the router bgp command.

Command Default  An autonomous system path is not modified automatically when you manually set an OSPF route tag. You must convert the OSPF route tag into an autonomous system path.

Command Modes   Route-map configuration (config-route-map)

set local-preference

Specifies a preference value for the autonomous system path.

bgp default local-preference

To change the default local preference value, use the bgp default local-preference command in router
configuration mode. To return the local preference value to the default setting, use the no form of this command.

bgp default local-preference number
no bgp default local-preference number

SyntaxDescription
numberLocal preference value from 0 to 4294967295.

Command Default Cisco IOS software applies a local preference value of 100 if this command is not enabled or if the no form
of this command is entered.

Command Modes Router configuration (config-router)

neighbor weight

To assign a weight to a neighbor connection, use the neighbor weight command in address family or router
configuration mode. To remove a weight assignment, use the no form of this command.

neighbor {ip-address | peer-group-name} weight number
no neighbor {ip-address | peer-group-name} weight number

SyntaxDescription
ip-addressIP address of the neighbor.
peer-group-nameName of a BGP peer group.
numberWeight to assign. Acceptable values are from 0 to 65535.

Command Default  Routes learned through another BGP peer have a default weight of 0 and routes sourced by the local router have a default weight of 32768.

Command Modes   Address family configuration (config-router-af)

​ Router configuration (config-router)

set weight

To specify the BGP weight for the routing table, use the set weight command in route-map configuration
mode. To delete an entry, use the no form of this command.

set weight number
no set weight number

SyntaxDescription
numberWeight value. It can be an integer ranging from 0 to 65535.

Command Default  The weight is not changed by the specified route map.

Command Modes    Route-map configuration (config-route-map)

bgp confederation identifier

To specify a BGP confederation identifier, use the bgp confederation identifier command in router configuration mode. To remove the confederation identifier, use the no form of this command.

bgp confederation identifier autonomous-system-number
no bgp confederation identifier autonomous-system-number

SyntaxDescription
autonomous-system-numberNumber of an autonomous system number used to configure a single autonomous system number to identify a group of smaller autonomous systems as a single confederation. Number in the range from 1 to 65535.
• In Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, and later releases, 4-byte autonomous system numbers are supported in the range from 65536 to 4294967295 in asplain notation and in the range from 1.0 to 65535.65535 in asdot notation.
• In Cisco IOS Release 12.0(32)S12, 12.4(24)T, and Cisco IOS XE Release 2.3, 4-byte autonomous system numbers are supported in the range from 1.0 to 65535.65535 in asdot notation only.
For more details about autonomous system number formats, see the router bgp command.

Command Default  No BGP confederation identifier is identified.

Command Modes   Router configuration (config-router)

bgp confederation peers

To configure subautonomous systems to belong to a single confederation, use the bgp confederation peers command in router configuration mode. To remove an autonomous system from the confederation, use the no form of this command.

bgp confederation peers autonomous-system-number [… autonomous-system-number]
no bgp confederation peers autonomous-system-number [… autonomous-system-number]

SyntaxDescription
autonomous-system-numberNumber of an autonomous system number used to configure a single autonomous system number to identify a group of smaller autonomous systems as a single confederation. Number in the range from 1 to 65535.
• In Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, and later releases, 4-byte autonomous system numbers are supported in the range from 65536 to 4294967295 in asplain notation and in the range from 1.0 to 65535.65535 in asdot notation.
• In Cisco IOS Release 12.0(32)S12, 12.4(24)T, and Cisco IOS XE Release 2.3, 4-byte autonomous system numbers are supported in the range from 1.0 to 65535.65535 in asdot notation only.
For more details about autonomous system number formats, see the router bgp command.

Command Default  No BGP peers are configured to be members of a BGP confederation.

Command Modes   Router configuration (config-router)

set community

To set the BGP communities attribute, use the set community route map configuration command. To delete
the entry, use the no form of this command.

set community {community-number [additive] [well-known-community] | none}
no set community

SyntaxDescription
community-numberSpecifies that community number. Valid values are from 1 to 4294967200, no-export, or no-advertise.
additive(Optional) Adds the community to the already existing communities.
well-known-community(Optional) Well know communities can be specified by using the following
keywords:
• internet
• local-as
• no-advertise
• no-export
none(Optional) Removes the community attribute from the prefixes that pass the route
map.

Command Default  No BGP communities attributes exist.

Command Modes   Route-map configuration (config-route-map)

neighbor send-community

To specify that a communities attribute should be sent to a BGP neighbor, use the neighbor send-community
command in address family or router configuration mode. To remove the entry, use the no form of this
command.

neighbor {ip-address ipv6-address peer-group-name} send-community [{both | standard | extended}]
no neighbor {ip-address ipv6-address peer-group-name} send-community

SyntaxDescription
ip-addressIP address of the neighbor.
ipv6-addressIPv6 address of the neighbor.
peer-group-nameName of a BGP peer group.
both(Optional) Specifies that both standard and extended communities will be sent.
standard(Optional) Specifies that only standard communities will be sent.
extended(Optional) Specifies that only extended communities will be sent.

Command Default  No communities attribute is sent to any neighbor.

Command Modes   Address family configuration (config-router-af)

            Router configuration (config-router)

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值