//// r1 ////
int lo0
int e2/0
router os 1
router bgp 65000 //启用BGP,注意此时为子AS号.
ps:现在我们要求统一关闭同步,并且所有路由器全互连!
//// r2 ////
int lo0
int e2/0
int e3/0
int e5/0
router os 1
router bgp 65000
//// r3 ////
int lo0
int e3/0
int e4/0
int e6/0
router os 1
router bgp 65001
//// r4 ////
int lo0
int e4/0
router os 1
router bgp 65001
//// r5 ////
int lo0
int e5/0
int e6/0
router os 1
router bgp 65001
完成以上所有配置后,应看到1.0.0.0 - 5.0.0.0 所有网段都将出现在路由表内,通过PING测试后,全网全通才正确.具体show ip bgp 以及 show ip ro内容有空我会发上来.
r1#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.0.0.0 0.0.0.0 0 32768 i
*>i2.0.0.0 192.1.1.2 0 100 0 i
*>i3.0.0.0 193.1.1.3 0 100 0 (65001) i
*>i4.0.0.0 193.1.1.3 0 100 0 (65001) i
*>i5.0.0.0 195.1.1.5 0 100 0 100 i
*> 1.0.0.0
*>i2.0.0.0
*>i3.0.0.0
*>i4.0.0.0
*>i5.0.0.0
r1#sh ip ro
C
O
B
O
B
O
B
B
O
O
C
O
O
r1#sh ip ro bgp
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 2.0.0.0/8 [200/0] via 192.1.1.2, 00:05:21
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 3.0.0.0/8 [200/0] via 193.1.1.3, 00:04:55
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 4.0.0.0/8 [200/0] via 193.1.1.3, 00:05:01
B 5.0.0.0/8 [200/0] via 195.1.1.5, 00:05:07
B
B
B
B
r5#sh ip bgp
*
*>
*
*>
*
*>
*
*>
*> 5.0.0.0
r5#sh ip ro
Gateway of last resort is not set
B 1.0.0.0/8 [20/0] via 196.1.1.3, 00:03:41
B 2.0.0.0/8 [20/0] via 196.1.1.3, 00:03:41
B 3.0.0.0/8 [20/0] via 196.1.1.3, 00:03:41
B 4.0.0.0/8 [20/0] via 196.1.1.3, 00:03:41
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback0
C 196.1.1.0/24 is directly connected, Serial3/0
C 195.1.1.0/24 is directly connected, Serial2/0
B
B
B
C
C
C
这个实验最后一步,建议可以在R5上改变发往AS200的路由条目的METRIC值.发往r3的metric设置为50,观察对AS内部路由器的选路影响.
命令如下:
//// r5 ////
access-list 1 permit 5.0.0.0 0.255.255.255 //定义出路由条目
route-map MED permit 10
route-map MED permit 10
router bgp 100
r3#sh ip bgp
*> 1.0.0.0
*> 2.0.0.0
*> 3.0.0.0
*>i4.0.0.0
*> 5.0.0.0
*
r3#sh ip ro bgp
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 1.0.0.0/8 [200/0] via 193.1.1.2, 00:06:29
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 2.0.0.0/8 [200/0] via 193.1.1.2, 00:06:29
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 4.0.0.0/8 [200/0] via 194.1.1.4, 00:06:53
B 5.0.0.0/8 [200/0] via 193.1.1.2, 00:06:29
B
B
B
B
r4#sh ip bgp
*>i1.0.0.0
*>i2.0.0.0
*>i3.0.0.0
*> 4.0.0.0
*>i5.0.0.0
r2#sh ip bgp
*>i1.0.0.0
*> 2.0.0.0
*> 3.0.0.0
*> 4.0.0.0
*> 5.0.0.0
