CCNP精粹系列之二十九--发布bgp子网信息,推荐

简介:


                                                      

试验七:发布bgp子网信息
R1,
R1(config)#int fa0/0
R1(config-if)#ip addr 172.16.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-router)#router rip
R1(config-router)#net 172.16.0.0
R1(config-router)#exit
 
R1 上测试:
R1#show ip ro
*Apr 22 16:24:47.115: %SYS-5-CONFIG_I: Configured from console by console
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
 
C    202.110.100.0/24 is directly connected, Serial1/0
R    202.110.101.0/24 [120/1] via 202.110.100.2, 00:00:01, Serial1/0
C    192.168.10.0/24 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets  / / 子网信息
C        172.16.10.0 is directly connected, FastEthernet0/0
R1#
R2 上测试:
 
R2#show ip ro
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
 
C    202.110.100.0/24 is directly connected, Serial1/0
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/1] via 202.110.100.1, 00:00:17, Serial1/0
R    172.16.0.0/16 [120/1] via 202.110.100.1, 00:00:09, Serial1/0
结论: R2 学习不到子网信息。
到这里并没有实现本试验的目的,既然 R2 学习不到子网信息,那么我们采用什么方法将子网发布出去呢?下面介绍 bgp 环境下发布子网信息。
语法:
config-router #no  auto-summary    关闭自动汇总
config-router #network   子网号   mask   掩码
 
R1 上发布子网信息:
R1(config)#router bgp 64500
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.10.0 mask 255.255.255.0
R1(config-router)#exit
 
R2 上测试,
C    202.110.100.0/24 is directly connected, Serial1/0
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/1] via 202.110.100.1, 00:00:06, Serial1/0
R    172.16.0.0/16 [120/1] via 202.110.100.1, 00:00:06, Serial1/0
和上面的试验结果一样,也就是发布子网的效果没有,这是不正常的,正常情况应该是发布子网后 R2 应该能够学到子网的信息,所以要尝试去排错,在做每个试验前要实现什么效果,如果理论没错的话学会排错很重要。我想了好长时间,终于,哦,原来 R2 R1 还不是邻居关系,所以马上建立邻居吧。
 
R2(config)#router bgp 64500
R2(config-router)#neighbor 202.110.100.1 remote-as 64500
R2(config-router)#net 202.110.100.0
R2(config-router)#net 202.110.101.0
R2(config-router)#exit
R2(config)#exit
再次在 R2 上测试:
 
 
C    202.110.100.0/24 is directly connected, Serial1/0
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/1] via 202.110.100.1, 00:00:07, Serial1/0
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
B       172.16.10.0/24 [200/0] via 202.110.100.1, 00:00:06
R       172.16.0.0/16 [120/1] via 202.110.100.1, 00:00:07, Serial1/0
R2#
故障真的在这里,这样的话今天的问题解决了,还算顺利吧!!!



     本文转自shenleigang 51CTO博客,原文链接: http://blog.51cto.com/shenleigang/152627 ,如需转载请自行联系原作者

相关文章
|
2月前
|
网络虚拟化 数据安全/隐私保护 数据中心
【专栏】对比了思科与华为网络设备的基本配置、接口、VLAN、路由、访问控制列表及其它关键命令
【4月更文挑战第28天】本文对比了思科与华为网络设备的基本配置、接口、VLAN、路由、访问控制列表及其它关键命令。尽管两者在很多操作上相似,如设备命名(思科:`hostname`,华为:`sysname`)、查看版本信息(思科:`show version`,华为:`display version`),但在某些方面存在差异,如接口速率设置(两者都使用`speed`和`duplex`,但命令结构略有不同)和VLAN配置(华为的`port hybrid`命令)。
|
网络架构 算法 网络协议