R2#sh ip bgp
BGP table version is 10, local router ID is 192.16.255.5
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
* 10.1.255.0/30 10.1.255.1 0 0 64512 i
*> 0.0.0.0 0 32768 i
*> 10.1.255.4/30 0.0.0.0 0 32768 i
* i 10.1.255.6 0 100 0 i
r i10.1.255.8/30 10.1.255.10 0 100 0 i
r>i 10.1.255.6 0 100 0 i
r>i10.1.255.12/30 10.1.255.10 0 100 0 i
*> 130.130.1.0/24 10.1.255.1 0 0 64512 i
* i150.150.1.0/24 10.1.255.14 0 100 0 64514 i
(发现BGP中存在这条路由,
但没有被选为选中最佳)
|
R2#sh ip bgp 150.150.1.0
BGP routing table entry for 150.150.1.0/24, version 0
Paths: (1 available, no best path)
Not advertised to any peer
64514
10.1.255.14 (metric 192) from 10.1.255.10 (10.1.255.13)
Origin IGP, metric 0, localpref 100, valid, internal, not synchronized
(没同步起来)
|
R2
(config)#router ospf 1
R2(config-router)#redistribute bgp 64513 metric 200 subnets
R4(
config)#router ospf 1
R4(config-router)#redistribute bgp 64513 metric 200 subnets
|
R1
#sh 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
10.0.0.0/30 is subnetted, 4 subnets
B 10.1.255.4 [20/0] via 10.1.255.2, 00:10:16
C 10.1.255.0 is directly connected, Serial1/1
B 10.1.255.12 [20/0] via 10.1.255.2, 00:10:47
B 10.1.255.8 [20/0] via 10.1.255.2, 00:10:47
130.130.0.0/24 is subnetted, 1 subnets
C 130.130.1.0 is directly connected, Loopback0
150.150.0.0/24 is subnetted, 1 subnets
B 150.150.1.0 [20/0] via 10.1.255.2, 00:01:07
R4
#sh 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
10.0.0.0/30 is subnetted, 4 subnets
O 10.1.255.4 [110/128] via 10.1.255.9, 00:01:21, Serial1/0
O 10.1.255.0 [110/192] via 10.1.255.9, 00:01:21, Serial1/0
C 10.1.255.12 is directly connected, Serial1/1
C 10.1.255.8 is directly connected, Serial1/0
130.130.0.0/24 is subnetted, 1 subnets
O E2
130.130.1.0 [110/200] via 10.1.255.9, 00:01:21, Serial1/0 (
会以2类的OE 来显示了)
150.150.0.0/24 is subnetted, 1 subnets
B 150.150.1.0 [20/0] via 10.1.255.14, 00:12:37
|
R2#sh ip bgp 150.150.1.0
BGP routing table entry for 150.150.1.0/24, version 16
Paths: (1 available, best #1, table Default-IP-Routing-Table, RIB-failure(17))
Advertised to update-groups:
1
64514
10.1.255.14 (metric 192) from 10.1.255.10 (10.1.255.13)
Origin IGP, metric 0, localpref 100, valid, internal, synchronized, best (
现在同步了)
|
R2(config)#router bgp 64513
R2(config-router)#no router-id 172.16.255.5 (no 掉之前在
R2上指高的
router-id)
|
R4#sh ip bgp
…………
Network Next Hop Metric LocPrf Weight Path
r>i10.1.255.0/30 10.1.255.5 0 100 0 i
r>i10.1.255.4/30 10.1.255.9 0 100 0 i
r i 10.1.255.5 0 100 0 i
* i10.1.255.8/30 10.1.255.9 0 100 0 i
*> 0.0.0.0 0 32768 i
* 10.1.255.12/30 10.1.255.14 0 0 64514 i
*> 0.0.0.0 0 32768 i
r>i130.130.1.0/24 10.1.255.1 0 100 0 64512 i
*> 150.150.1.0/24 10.1.255.14 0 0 64514 i
|
R5#sh ip route
………………
Gateway of last resort is not set
10.0.0.0/30 is subnetted, 4 subnets
B 10.1.255.4 [20/0] via 10.1.255.13, 00:07:17
B 10.1.255.0 [20/0] via 10.1.255.13, 00:07:17
C 10.1.255.12 is directly connected, Serial1/0
B 10.1.255.8 [20/0] via 10.1.255.13, 00:07:17
130.130.0.0/24 is subnetted, 1 subnets
B 130.130.1.0 [20/0] via 10.1.255.13, 00:07:47
150.150.0.0/24 is subnetted, 1 subnets
C 150.150.1.0 is directly connected, Loopback0
|