这次做一个BGP基本的实例:
//// r1 ////
int lo1
int lo2
ip ad 192.1.25.1 255.255.255.0
int f1/1
ip ad 192.1.1.1 255.255.255.0
router BGP 100
neighbor 192.1.1.2 remote-as 200
network 192.1.24.0
network 192.1.25.0
//// r2 ////
int f1/1
ip address 192.1.1.2 255.255.255.0
r2#sh ip BGP su BGP router identifier 194.1.1.2, local AS number 200 BGP table version is 8, main routing table version 8
7 network entries and 7 paths using 931 bytes of memory
3 BGP path attribute entries using 180 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory BGP activity 7/46 prefixes, 7/0 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.1.1.1 4 100 46 49 8 0 0 00:42:37 2
193.1.1.3 4 200 46 52 8 0 0 00:42:06 0
194.1.1.4 4 300 56 58 8 0 0 00:39:26 2
show ip BGP
r2#sh ip BGP BGP table version is 8, local router ID is 194.1.1.2
Status codes: s suppressed, d damped, h history, * valid, >best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.1.24.0 192.1.1.1 0 0 100 i
*> 192.1.25.0 192.1.1.1 0 0 100 i
*> 192.1.26.0 194.1.1.4 0 0 300 i
*> 192.1.27.0 194.1.1.4 0 0 300 i
r2#
show ip ro
r2#sh ip ro
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
B 192.1.25.0/24 [20/0] via 192.1.1.1, 00:43:46
B 192.1.24.0/24 [20/0] via 192.1.1.1, 00:43:46
B 192.1.27.0/24 [20/0] via 194.1.1.4, 00:38:14
B 192.1.26.0/24 [20/0] via 194.1.1.4, 00:38:14
C 193.1.1.0/24 is directly connected, Serial0/0
C 192.1.1.0/24 is directly connected, FastEthernet0/0
C 194.1.1.0/24 is directly connected, FastEthernet0/1
排错:
我们在验证过程中,可观察到r1上的路由条目:
show ip ro
B 192.1.27.0/24 [20/0] via 192.1.1.2, 00:38:14
B 192.1.26.0/24 [20/0] via 192.1.1.2, 00:38:14
C 192.1.1.0/24 is directly connected, f0/0
仔细检查各路由器的路由表:
r2# show ip ro
B 192.1.25.0/24 [20/0] via 192.1.1.1, 00:43:46
B 192.1.24.0/24 [20/0] via 192.1.1.1, 00:43:46
B 192.1.27.0/24 [20/0] via 194.1.1.4, 00:38:14
B 192.1.26.0/24 [20/0] via 194.1.1.4, 00:38:14
C 193.1.1.0/24 is directly connected, Serial0/0
C 192.1.1.0/24 is directly connected, FastEthernet0/0
C 194.1.1.0/24 is directly connected, FastEthernet0/1
问题集中到r4上了,我们看下它的路由表:
r4# show ip ro
B 192.1.25.0/24 [20/0] via 192.1.1.1, 00:43:46
B 192.1.24.0/24 [20/0] via 192.1.1.1, 00:43:46
C 192.1.26.0/24 is directly connected, lo1
C 192.1.27.0/24 is directly connected, lo2
C 194.1.1.4/24 is directly connected, f4/4