分类: 系统运维
2009-07-16 19:51:07
实验目的:
1、掌握使用指向NULL0接口的静态路由的汇总配置方法。
2、掌握使用聚合属性的路由汇总配置方法。
实验拓扑图:
实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置各台路由器的BGP协议,并且正确宣告相应的网络:
3、查看R3路由器的路由表信息:
R3#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks B 172.16.255.0/30 [20/0] via 10.1.255.1, 00:03:15 B 172.16.0.0/24 [20/0] via 10.1.255.1, 00:02:45 B 172.16.1.0/24 [20/0] via 10.1.255.1, 00:02:45 B 172.16.2.0/24 [20/0] via 10.1.255.1, 00:02:45 B 172.16.3.0/24 [20/0] via 10.1.255.1, 00:02:45 10.0.0.0/30 is subnetted, 1 subnets C 10.1.255.0 is directly connected, Serial1/0 R3# |
4、以通过路由汇总配置,有效的减少路由表的大小,提高路由效率。因此在R1路由器作如下的配置:
R1(config)#[stanley1] R1(config)# R1(config)#router bgp 64512 R1(config-router)#[stanley2] R1(config-router)#exit |
5、查看R3的路由表:
R3#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 6 subnets, 3 masks B 172.16.255.0/30 [20/0] via 10.1.255.1, 00:07:18 B 172.16.0.0/24 [20/0] via 10.1.255.1, 00:06:48 B 172.16.1.0/24 [20/0] via 10.1.255.1, 00:06:48 B 172.16.2.0/24 [20/0] via 10.1.255.1, 00:06:48 B 172.16.3.0/24 [20/0] via 10.1.255.1, 00:06:48 10.0.0.0/30 is subnetted, 1 subnets C 10.1.255.0 is directly connected, Serial1/0 R3# |
6、BGP的network命令与OSPF或是其它的IGP不同的是:BGP当检测到本地有network命令,首先BGP会检查本地路由表,查看是否此条路由存在,如果有,则将此条路由通告给对等体,否则忽略此条network命令。
7、另外需要注意的是,虽然在R3学习了/22位子网汇总路由,但是其它的/24位网络具体路由也同时出现的路由表,因此还需要在R1上作如下配置:
R1(config)#router bgp 64512 R1(config-router)#no network 172.16.0.0 mask 255.255.255.0 R1(config-router)#no network 172.16.1.0 mask 255.255.255.0 R1(config-router)#no network 172.16.2.0 mask 255.255.255.0 R1(config-router)#no network 172.16.3.0 mask 255.255.255.0 R1(config-router)#exit R1(config)# |
8、查看R3的路由表:
R3#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks B 172.16.255.0/30 [20/0] via 10.1.255.1, 00:23:36 B 172.16.0.0/22 [20/0] via 10.1.255.1, 00:16:20 10.0.0.0/30 is subnetted, 1 subnets C 10.1.255.0 is directly connected, Serial1/0 R3# |
9、测试汇总路由有效性:
R3#ping 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 = 144/184/216 ms R3# |
10、虽然通过指向NULL 0口的路由进行配置BGP的汇总非常的简单,而且易于理解,但是不利于排错,因为其它BGP的路由器无法获知路由在何处汇总的。因此,建议使用BGP的聚合方法进行配置汇总。
11、在R1上将的指向NULL 0的接口静态路由和BGP的下的针对指向NULL 0口的静态路由的宣告给no掉。同时,在R1上将四个回环口的子网重新network宣告。
12、在R1路由器实施聚合的配置:
R1(config)#router bgp 64512 R1(config-router)#[stanley4] R1(config-router)# |
13、查看R3的路由表:
R3#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks B 172.16.255.0/30 [20/0] via 10.1.255.1, 00:18:08 10.0.0.0/30 is subnetted, 1 subnets C 10.1.255.0 is directly connected, Serial1/0 R3# |
14、查看汇总路由的属性:
R3#show ip bgp 172.16.0.0 BGP routing table entry for 172.16.0.0/22, version 32 Paths: (1 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer 10.1.255.1 from 10.1.255.1 (172.16.255.1) Origin IGP, localpref 100, valid, external, atomic-aggregate, best R3# |
15、测试汇总路由的有效性:
R3#ping 172.16.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 68/128/168 ms R3# |
16、实验完成。