相关链接
【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]
Snytax | Description |
---|
address | Aggregate address. | mask | Aggregate 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}
Snytax | Description |
---|
list-name | Configures 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. | deny | Denies access for a matching condition. | permit | Permits access for a matching condition. | network/length | Configures 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}
Syntax | Description |
---|
igp | Remote Interior Gateway Protocol (IGP) system. | egp | Local Exterior Gateway Protocol (EGP) system. | autonomous-system-nnumber | Number of a remote autonomous system number. The range of values for this argument is any valid autonomous system number from 1 to 65535. | incomplete | Unknown 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}
Syntax | Description |
---|
ip-address | IP address of the neighbor. | peer-group-name | Name of a BGP or multiprotocol BGP peer group. | ipv6-address | IPv6 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-name | Name of a route map. | in | Applies route map to incoming routes. | out | Applies 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.
Syntax | Description |
---|
tag | Converts the manually-set tag of a route into an autonomous system path. Applies only when redistributing routes into BGP. | prepend | Appends 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-string | Number 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
Syntax | Description |
---|
number | Local 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
Syntax | Description |
---|
ip-address | IP address of the neighbor. | peer-group-name | Name of a BGP peer group. | number | Weight 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
Syntax | Description |
---|
number | Weight 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
Syntax | Description |
---|
autonomous-system-number | Number 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]
Syntax | Description |
---|
autonomous-system-number | Number 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
Syntax | Description |
---|
community-number | Specifies 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
Syntax | Description |
---|
ip-address | IP address of the neighbor. | ipv6-address | IPv6 address of the neighbor. | peer-group-name | Name 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)
|