API Guide

1. 分配 AS 编号然后从 CONFIGURATION 模式中进入 ROUTER-BGP 模式 1 65535 适用于 2 字节 1 4294967295
用于 4 字节。每个系统仅支持一个 AS 编号。如果输入一个 4 字节 AS 数字 4 字节 AS 支持自动启用。
router bgp as-number
2. ROUTER-BGP 模式下输入邻居。
neighbor ip-address
3. ROUTER-NEIGHBOR 模式下添加远程 AS 1 65535 适用于 2 字节或从 1 4294967295 适用于 4 字节。
remote-as as-number
4. ROUTER-NEIGHBOR 模式下启用 BGP 邻居。
no shutdown
5. 可选 ROUTER-NEIGHBOR 模式下为模板添加文本说明。
description text
要在更改 BGP 邻居的配置时重置配置请使用 clear ip bgp * 命令。要查看 BGP 状态请使用 show ip bgp summary
令。
配置 BGP
OS10# configure terminal
OS10(config)# router bgp 100
OS10(config-router-bgp-100)# neighbor 5.1.1.1
OS10(config-router-neighbor)# remote-as 1
OS10(config-router-neighbor)# no shutdown
OS10(config-router-neighbor)# description n1_abcd
OS10(config-router-neighbor)# exit
OS10(config-router-bgp-100)# template t1
OS10(config-router-template)# description peer_template_1_abcd
查看具有 2 字节 AS 编号的 BGP 摘要
OS10# show ip bgp summary
BGP router identifier 202.236.164.86 local AS number 64901
Neighbor AS MsgRcvd MsgSent Up/Down State/Pfx
120.10.1.1 64701 664 662 04:47:52 established 12000
查看具有 4 字节 AS 编号的 BGP 摘要
OS10# show ip bgp summary
BGP router identifier 11.1.1.1, local AS number 4294967295
BGP local RIB : Routes to be Added 0, Replaced 0, Withdrawn 0
1 neighbor(s) using 8192 bytes of memory
Neighbor AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/Pfx
5.1.1.2 4294967295 0 0 0 0 0 00:00:00 Active
对于路由器 ID系统选择第一个配置的 IP 地址或随机数。要查看 BGP 邻居的状态请使用 show ip bgp neighbors 命令。对
BGP 邻居配置信息请使用 show running-config bgp 命令。
此示例显示了两个相邻节点一个是外部 BGP 邻居另一个是内部 BGP 邻居。每个邻居输出的第一行显示 AS 编号并且状态为外
部或内部。
show ip bgp neighbors 输出的第三行包含 BGP 状态。如果显示除 established 以外的其他内容则邻居不会交换信息和路由。
有关详细信息请参阅 IPv6 命令
查看 BGP 邻居
OS10# show ip bgp neighbors
BGP neighbor is 5.1.1.1, remote AS 1, internal link
BGP version 4, remote router ID 6.1.1.1
BGP state established, in this state for 00:03:11
Last read 01:08:40 seconds, hold time is 180, keepalive interval is 60 seconds
542 3