CCNP-31 BGP 1
实验拓扑:
实验要求:
R1
属于
AS 65500
中的一台路由器,
R2-4
属于
AS 65000
中的路由器,在
AS 65000
中使用的事
OSPF
路由协议,
R1
与
R2
配置成为
EBGP PEER
,
R2
与
R4
之间配置成为
IBGP PEER
。
试验目的:掌握基本的
EBGP
和
IBGP
的配置和传递路由需要的条件,能够使用
show
和
debug
来解决简单的问题。
试验配置:
R1
:
R1(config)#int f0/0
R1(config-if)#ip add 10.1.1 .1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int f1/0
R1(config-if)#exit
R1(config)#int f1/0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#no keepalive
R1(config-if)#exit
R2
:
R2(config)#int f0/0
R2(config-if)#ip add 10.1.1 .2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int f1/0
R2(config-if)#ip add 192.1.1.1 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip add 2.2.2 .2 255.255.255.0
R2(config-if)#exit
R2(config)#int loop1
R2(config-if)#ip add 172.16.2.1 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2 .2
R2(config-router)#network 0.0.0 .0 0.0. 0.0 a 0
R2(config-router)#exit
R3
:
R3(config)#int f1/0
R3(config-if)#ip add 192.1.1.2 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int f0/0
R3(config-if)#ip add 193.1.1.1 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int loop0
R3(config-if)#ip add 3.3.3 .3 255.255.255.0
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3 .3
R3(config-router)#network 0.0.0 .0 0.0. 0.0 a 0
R3(config-router)#exit
R4
:
R4(config)#int f0/0
R4(config-if)#ip add 193.1.1.2 255.255.255.0
R4(config-if)#no shu
R4(config-if)#exit
R4(config)#int f1/0
R4(config-if)#ip add 172.16.3.1 255.255.255.0
R4(config-if)#no shu
R4(config-if)#no keepalive
R4(config-if)#exit
R4(config)#int loop0
R4(config-if)#ip add 4.4.4 .4 255.255.255.0
R4(config-if)#exit
R4(config)#router ospf 100
R4(config-router)#router-id 4.4.4 .4
R4(config-router)#network 0.0.0 .0 0.0. 0.0 a 0
R4(config-router)#exit
基本的链路层和
OSPF
配置完成了,上面用红色标记的部分是因为那个接口没有连接任何设备,我们用它来模拟内部网络,如果与接口没有活动的连接,那么接口就会
down
掉,使用
no keepalive
命令来取消检测活动连接,使之一直保持在
UP
状态。
下面我们开始
BGP
的配置,如下:
R1(config)#int loop0
R1(config-if)#ip add 1.1.1 .1 255.255.255.0//loopback
接口和
OSPF
中的作用一样,用作
router-id
R1(config-if)#exit
R1(config)#router bgp 65500
//65500
为
AS
号
R1(config-router)#neighbor 10.1.1 .2 remote-as 65000
//
指定邻居
R1(config-router)#network 172.16.1.0 mask 255.255.255.0
//
宣告网段
R2(config)#router bgp 65000
R2(config-router)#neighbor 10.1.1 .1 remote-as 65500
R2(config-router)#neighbor 4.4.4 .4 remote-as 65000
R2(config-router)#neighbor 4.4.4 .4 update-source loop0
R2(config-router)#network 192.1.1.0
R2(config-router)#network 172.16.2.0 mask 255.255.255.0
R4(config)#router bgp 65000
R4(config-router)#neighbor 2.2.2 .2 remote-as 65000
R4(config-router)#neighbor 2.2.2 .2 update-source loopback 0
R4(config-router)#network 172.16.3.0 mask 255.255.255.0
R4(config-router)#network 193.1.1.0
R4(config-router)#exit
BGP
的配置和其他路由协议差不多,也需要在全局模式下使用
router bgp xxx
命令,只不过后面的数字表示的是
AS
号,
BGP
的邻居需要管理员人工指定,并且要表明邻居所在的
AS
,在
EBGP PEER
情况下,
neighbor
后面的
ip
地址一般为直连的对端接口的
IP
地址,这是因为
BGP
有一个一跳的属性限制,可以修改,不过不建议这样做,不过在
IBGP PEER
的配置中,
neighbor
后面的
ip
地址的要求就没有这么严格了,只要可达的
IP
地址都可以,在这里我们一般使用
LOOPBACK
接口的
IP
地址作为更新源,因为
loopback
接口有一个永远不会
down
的特性,并且在多条路经的时候,用
loopback
地址作为更新源地址可以实现冗余(
BGP
不能实现负载均衡,他只选择最优的路径写入路由表!),
update-source loopback 0
指明更新源为
loopback
口,这条命令需要在使用
loopback
接口作为更新源的对等体路由器都要配置!
最后使用
network
命令宣告需要发布的路由,这里
BGPv4
支持
VLSM
与
CIDR
,所以
BGP
在更新一条路有的时候需要写出掩码,默认的是主网络的掩码,可以使用
mask
选项来配置掩码。
BGP
和
EIGRP,OSPF,ISIS
一样都有三张表,邻居表,
BGP
路由表和
IP
路由表,下面我们来看看
BGP
的邻居表:
R2#show ip bgp neighbors
BGP neighbor is 4.4.4 .4, remote AS 65000, internal link //IBGP
邻居
BGP version 4, remote router ID 4.4.4 .4 //BGP
版本,邻居路由
ID
BGP state = Established, up for 00:03:56 //
邻居状态
Established
Last read 00:00:55, last write 00:00:55, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 2 2
Keepalives: 6 6
Route Refresh: 0 0
Total: 9 9
Default minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
BGP table version 8, neighbor version 8/0
Output queue size : 0
Index 2, Offset 0, Mask 0x4
2 update-group member
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 3 2 (Consumes 104 bytes)
Prefixes Total: 3 2
Implicit Withdraw: 0 0
Explicit Withdraw: 0 0
Used as bestpath: n/a 2
Used as multipath: n/a 0
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Bestpath from this peer: 2 n/a
Total: 2 0
Number of NLRIs in the update sent: max 2, min 1
Connections established 1; dropped 0
Last reset never
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 255
Local host: 2.2.2 .2, Local port: 14692
Foreign host: 4.4.4 .4, Foreign port: 179
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0xF62D8):
Timer Starts Wakeups Next
Retrans 6 0 0x0
TimeWait 0 0 0x0
AckHold 7 6 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
iss: 4085729406 snduna: 4085729684 sndnxt: 4085729684 sndwnd: 16107
irs: 975868670 rcvnxt: 975868940 rcvwnd: 16115 delrcvwnd: 269
SRTT: 178 ms, RTTO: 1209 ms, RTV: 1031 ms, KRTT: 0 ms
minRTT: 212 ms, maxRTT: 428 ms, ACK hold: 200 ms
Flags: active open, nagle
IP Precedence value : 6
Datagrams (max data segment is 536 bytes):
Rcvd: 8 (out of order: 0), with data: 7, total data bytes: 269
Sent: 15 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 7, total data bytes: 277
BGP neighbor is 10.1.1 .1, remote AS 65500, external link //EBGP
邻居
BGP version 4, remote router ID 1.1.1 .1
BGP state = Established, up for 00:05:00
Last read 00:00:00, last write 00:00:00, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 3 1
Keepalives: 7 7
Route Refresh: 0 0
Total: 11 9
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 8, neighbor version 8/0
Output queue size : 0
Index 1, Offset 0, Mask 0x2
1 update-group member
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 4 1 (Consumes 52 bytes)
Prefixes Total: 4 1
Implicit Withdraw: 0 0
Explicit Withdraw: 0 0
Used as bestpath: n/a 1
Used as multipath: n/a 0
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Bestpath from this peer: 1 n/a
Total: 1 0
Number of NLRIs in the update sent: max 2, min 1
Connections established 1; dropped 0
Last reset never
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1
Local host: 10.1.1 .2, Local port: 179
Foreign host: 10.1.1 .1, Foreign port: 14828
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0xF 658C ):
Timer Starts Wakeups Next
Retrans 11 0 0x0
TimeWait 0 0 0x0
AckHold 9 2 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
iss: 300025546 snduna: 300025871 sndnxt: 300025871 sndwnd: 16060
irs: 1734736732 rcvnxt: 1734736963 rcvwnd: 16154 delrcvwnd: 230
SRTT: 251 ms, RTTO: 796 ms, RTV: 545 ms, KRTT: 0 ms
minRTT: 24 ms, maxRTT: 412 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs
IP Precedence value : 6
Datagrams (max data segment is 1460 bytes):
Rcvd: 19 (out of order: 0), with data: 9, total data bytes: 230
Sent: 13 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 10, total data bytes: 324
以上为
R2
的
BGP
邻居信息,详细的说明了邻居的状态和一些参数。
(其他
BGP
路由器的邻居表略)
然后查看
BGP
路由表:
R1#show ip bgp
BGP table version is 6, local router ID is 1.1.1 .1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 172.16.1.0/24 0.0.0 .0 0 32768 i
*> 172.16.2.0/24 10.1.1 .2 0 0 65000 i
*> 172.16.3.0/24 10.1.1 .2 0 65000 i
*> 192.1.1.0 10.1.1 .2 0 0 65000 i
*> 193.1.1.0 10.1.1 .2 0 65000 i
R2#show ip bgp
BGP table version is 8, local router ID is 172.16.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 172.16.1.0/24 10.1.1 .1 0 0 65500 i
*> 172.16.2.0/24 0.0.0 .0 0 32768 i
r>i172.16.3.0/24 4.4.4 .4 0 100 0 i
*> 192.1.1.0 0.0.0 .0 0 32768 i
r>i193.1.1.0 4.4.4 .4 0 100 0 i
R4#show ip bgp
BGP table version is 7, local router ID is 4.4.4 .4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i172.16.1.0/24 10.1.1 .1 0 100 0 65500 i
*>i172.16.2.0/24 2.2.2 .2 0 100 0 i
*> 172.16.3.0/24 0.0.0 .0 0 32768 i
r>i192.1.1.0 2.2.2 .2 0 100 0 i
*> 193.1.1.0 0.0.0 .0 0 32768 i
上面的输出解释:
*
号表示存在的网络;
>
号表示最佳路径;
前面的
i
表示通过
IBGP
学到的路由;
前面的
r
表示写入到路由信息库失败的路由,可以通过命令
show ip bgp rib-failure
查看失败原因;
NextHop
表示下一跳;
Metric
用来表示
MED
属性;
LocPrf
用来表示本地优先级,默认为
100
;
Weight
是
cisco
专有的一个属性,如果这条路由是自己产生的,
Weight
为
32768
,如果是从邻居学到的
Weight
为
0
;
Path
为
BGP
的
AS PATH
属性,用来表示经过的
AS
。
这里有的前面标记为
r
的原因是:在写入路由表的时候,
ospf
同样也有到达该目的地的路由,所以管理距离小的就写入路由表
,IBGP
的管理距离为
200
,
OSPF
的为
120
,所以使用
OSPF
的路由。
BGP table version is 7
表示
BGP
的路由表经过了
7
次的交换和学习路由。
最后查看一下
IP
路由表:
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.1 .0 is directly connected, Loopback0
172.16.0.0/24 is subnetted, 3 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
B 172.16.2.0 [20/0] vi a 10.1.1 .2, 00:03:07
B 172.16.3.0 [20/0] vi a 10.1.1 .2, 00:02:25
10.0.0 .0/24 is subnetted, 1 subnets
C 10.1.1 .0 is directly connected, FastEthernet0/0
B 193.1.1.0/24 [20/0] vi a 10.1.1 .2, 00:01:55
B 192.1.1.0/24 [20/0] vi a 10.1.1 .2, 00:03:07
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0 .0/24 is subnetted, 1 subnets
C 2.2.2 .0 is directly connected, Loopback0
3.0.0 .0/32 is subnetted, 1 subnets
O 3.3.3 .3 [110/2] via 192.1.1.2, 00:07:05, FastEthernet1/0
4.0.0 .0/32 is subnetted, 1 subnets
O 4.4.4 .4 [110/3] via 192.1.1.2, 00:07:05, FastEthernet1/0
172.16.0.0/24 is subnetted, 3 subnets
B 172.16.1.0 [20/0] vi a 10.1.1 .1, 00:04:15
C 172.16.2.0 is directly connected, Loopback1
O 172.16.3.0 [110/3] via 192.1.1.2, 00:07:05, FastEthernet1/0
10.0.0 .0/24 is subnetted, 1 subnets
C 10.1.1 .0 is directly connected, FastEthernet0/0
O 193.1.1.0/24 [110/2] via 192.1.1.2, 00:07:05, FastEthernet1/0
C 192.1.1.0/24 is directly connected, FastEthernet1/0
R4#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0 .0/32 is subnetted, 1 subnets
O 2.2.2 .2 [110/3] via 193.1.1.1, 00:11:10, FastEthernet0/0
3.0.0 .0/32 is subnetted, 1 subnets
O 3.3.3 .3 [110/2] via 193.1.1.1, 00:11:10, FastEthernet0/0
4.0.0 .0/24 is subnetted, 1 subnets
C 4.4.4 .0 is directly connected, Loopback0
172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
B 172.16.1.0/24 [200/0] vi a 10.1.1 .1, 00:07:52
B 172.16.2.0/24 [200/0] vi a 2.2.2 .2, 00:07:52
C 172.16.3.0/24 is directly connected, FastEthernet1/0
O 172.16.2.1/32 [110/3] via 193.1.1.1, 00:11:10, FastEthernet0/0
10.0.0 .0/24 is subnetted, 1 subnets
O 10.1.1 .0 [110/3] via 193.1.1.1, 00:11:10, FastEthernet0/0
C 193.1.1.0/24 is directly connected, FastEthernet0/0
O 192.1.1.0/24 [110/2] via 193.1.1.1, 00:11:11, FastEthernet0/0
上面用红色标记的是从
BGP
学到的路由,下面我们来在
R4
上
ping
测试一下:
R4#p 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
R4# p 10.1.1 .1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1 .1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 276/352/408 ms
R4# p 10.1.1 .2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1 .2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/205/260 ms
R4#p 172.16.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 168/245/356 ms
到
172.16.1.1
不通,为什么呢?我们
debug ip icmp
来观察一下:
R4#debug ip icmp
ICMP packet debugging is on
R4#p 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
U
*Mar 1 00:17:47.947: ICMP: dst (193.1.1.2) host unreachable rcv from 193.1.1.1.U
*Mar 1 00:17:50.051: ICMP: dst (193.1.1.2) host unreachable rcv from 193.1.1.1.U
Success rate is 0 percent (0/5)
R4#
*Mar 1 00:17:52.167: ICMP: dst (193.1.1.2) host unreachable rcv from 193.1.1.1
收到
193.1.1.1
的目标不可达错误消息,我们到
R3
上查看一下路由表:
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0 .0/32 is subnetted, 1 subnets
O 2.2.2 .2 [110/2] via 192.1.1.1, 00:07:54, FastEthernet1/0
3.0.0 .0/24 is subnetted, 1 subnets
C 3.3.3 .0 is directly connected, Loopback0
4.0.0 .0/32 is subnetted, 1 subnets
O 4.4.4 .4 [110/2] via 193.1.1.2, 00:07:54, FastEthernet0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.16.3.0/24 [110/2] via 193.1.1.2, 00:07:54, FastEthernet0/0
O 172.16.2.1/32 [110/2] via 192.1.1.1, 00:07:54, FastEthernet1/0
10.0.0 .0/24 is subnetted, 1 subnets
O 10.1.1 .0 [110/2] via 192.1.1.1, 00:07:54, FastEthernet1/0
C 193.1.1.0/24 is directly connected, FastEthernet0/0
C 192.1.1.0/24 is directly connected, FastEthernet1/0
没有到
172.16.1.0/24
的路由,我们来添加一条静态路由:
Ip route 172.16.1.0 255.255.255.0 192.1.1.1
这样我们再到
R4
上
Ping 172.16.1.1
看看:
R4#p 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 212/290/408 ms
通了。
其实在一个传输
AS
中,要求形成一个完全网格的拓扑,就是所有路由器必须都要直连在一起,以防止向在这里出现的中间有一台没有运行
BGP
的路由器所带来的问题。不过完全网格的限制可以通过其他的手段来解决。
下面我们再来观察一下
BGP
在建立邻居关系时候的
debug
信息:
R1#debug ip bgp ipv4 unicast
BGP debugging is on for address family: IPv4 Unicast
R1#clear ip bgp *
R1#
*Mar 1 00:22:32.907: BGPNSF state: 10.1.1 .2 went from nsf_not_active to nsf_not_active
*Mar 1 00:22:32.907: BGP: 10.1.1 .2 went from Established to Idle //
状态从
Established
变为
Idle
*Mar 1 00:22:32.907: %BGP-5-ADJCHANGE: neighbor 10.1.1 .2 Down User reset
*Mar 1 00:22:32.907: BGP: 10.1.1 .2 closing //
关闭邻居关系
*Mar 1 00:22:32.911: BGP: 10.1.1 .2 went from Idle to Active //
状态从
Idle
变为
Active
*Mar 1 00:22:32.919: BGP: 10.1.1 .2 open active, local address 10.1.1.1
*Mar 1 00:22:33.055: BGP: 10.1.1 .2 went from Active to OpenSent //
状态从
Active
变为
OpenSent
*Mar 1 00:22:33.055: BGP: 10.1.1 .2 sending OPEN, version 4, my as: 65500, holdtime 180 seconds //
发送
OPEN
消息
*Mar 1 00:22:33.063: BGP: 10.1.1 .2 send message type 1, length (incl. header) 45
*Mar 1 00:22:33.175: BGP: 10.1.1 .2 rcv message type 1, length (excl. header) 26
*Mar 1 00:22:33.175: BGP: 10.1.1 .2 rcv OPEN, version 4, holdtime 180 seconds //
收到
OPEN
消息
*Mar 1 00:22:33.179: BGP: 10.1.1 .2 rcv OPEN w/ OPTION parameter len: 16
*Mar 1 00:22:33.179: BGP: 10.1.1 .2 rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Mar 1 00:22:33.179: BGP: 10.1.1 .2 OPEN has CAPABILITY code: 1, length 4
*Mar 1 00:22:33.179: BGP: 10.1.1 .2 OPEN has MP_EXT CAP for afi/safi: 1/1
*Mar 1 00:22:33.179: BGP: 10.1.1 .2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar 1 00:22:33.183: BGP: 10.1.1 .2 OPEN has CAPABILITY code: 128, length 0
*Mar 1 00:22:33.183: BGP: 10.1.1 .2 OPEN has ROUTE-REFRESH capability(old) for all address-families
*Mar 1 00:22:33.183: BGP: 10.1.1 .2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar 1 00:22:33.183: BGP: 10.1.1 .2 OPEN has CAPABILITY code: 2, length 0
*Mar 1 00:22:33.183: BGP: 10.1.1 .2 OPEN has ROUTE-REFRESH capability(new) for all address-families
BGP: 10.1.1 .2 rcvd OPEN w/ remote AS 65000
*Mar 1 00:22:33.187: BGP: 10.1.1 .2 went from OpenSent to OpenConfirm//
状态从
OpenSent
变为
OpenConfirm
*Mar 1 00:22:33.187: BGP: 10.1.1 .2 went from OpenConfirm to Established//
状态从
OpenConfirm
变为
Established
从上面的
debug
信息我们可以看到
BGP
的邻居关系的形成经历了
Idle
--Active--OpenSent--OpenConfirm―Established
这些状态。
实验总结:
掌握基本的
BGP
配置,掌握
EBGP/IBGP PEER
配置中需要注意的问题和配置方法,并且掌握基本的查看和调试
BGP
信息和解决简单问题的方法。