实验9.11.4b BGP路由反射器和路由过滤器
一、拓扑图:
二、实验目的:
国际互联网培训中心ITAA由于发展迅速,内部BGP信息体积过于庞大,影响路由性能和链路效率,所以决定采用路由转发器到客户端的配置方案,假设内部IGP协议是RIP。
三、具体实验内容:
步骤:
-实验基本配置(包括RIP和BGP连通配置,暂时不配置ITAA_CLIENT_B还回口); |
-配置还回口地址,并将其发布到BGP会话; |
-在ITAA_HOST上配置RR; |
-在CLIENT_B上发布超网路由,在CLENT_A上查看路由信息(下一跳); |
-控制流往CLENT_A的路由; |
-结论 |
实验基本配置(包括RIP和BGP连通配置,暂时不配置ITAA_CLIENT_B还回口):
ITAA_Client_A#sh run Building configuration...
Current configuration : 1260 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname ITAA_Client_A interface Serial1/0 ip address 192.168.1.5 255.255.255.252 serial restart-delay 0 ! router rip network 192.168.1.0 router bgp 100 no synchronization bgp log-neighbor-changes neighbor 192.168.1.6 remote-as 100 no auto-summary ! end |
ITAA_HOST#sh run Building configuration...
Current configuration : 1469 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname ITAA_HOST ! interface Serial1/0 ip address 172.24.1.17 255.255.255.0 serial restart-delay 0 ! interface Serial1/1 ip address 192.168.1.6 255.255.255.252 router rip network 192.168.1.0 network 172.24.0.0 network 200.100.50.0 router bgp 100 no synchronization bgp log-neighbor-changes network 172.24.1.0 mask 255.255.255.0 network 192.168.1.4 mask 255.255.255.252 network 200.100.50.1 neighbor 172.24.1.18 remote-as 100 neighbor 192.168.1.5 remote-as 100 no auto-summary ! end |
ITAA_Client_B#sh run Building configuration...
Current configuration : 1335 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname ITAA_Client_B interface Loopback0 ip address 199.9.9.1 255.255.255.0 ! interface Serial1/0 no ip address shutdown serial restart-delay 0 ! interface Serial1/1 ip address 172.24.1.18 255.255.255.0 serial restart-delay 0 ! router rip network 172.24.0.0 router bgp 100 no synchronization bgp log-neighbor-changes network 199.9.9.0 neighbor 172.24.1.17 remote-as 100 no auto-summary ! end |
ITAA_Client_A#sh ip rou Gateway of last resort is not set
R 200.100.50.0/24 [120/1] via 192.168.1.6, 00:00:07, Serial1/0 172.24.0.0/16 is variably subnetted, 2 subnets, 2 masks R 172.24.0.0/16 [120/1] via 192.168.1.6, 00:00:07, Serial1/0 B 172.24.1.0/24 [200/0] via 192.168.1.6, 00:30:08 192.168.1.0/30 is subnetted, 1 subnets C 192.168.1.4 is directly connected, Serial1/0 |
配置还回口地址,并将其发布到BGP会话:
ITAA_Client_B(config)#int lo0 ITAA_Client_B(config-if)#ip add 199.9.9.1 255.255.255.0 ITAA_Client_B(config-if)#router bgp 100 ITAA_Client_B(config-router)#net 199.9.9.0 mask 255.255.255.0 ITAA_Client_B(config-router)#exi |
在ITAA_HOST路由器上查看:
ITAA_HOST#sh ip bgp Network Next Hop Metric LocPrf Weight Path *> 172.24.1.0/24 0.0.0.0 0 32768 i *> 192.168.1.4/30 0.0.0.0 0 32768 i *>i199.9.9.0 172.24.1.18 0 100 0 i -self |
但,在CLIENT_A上查看:是没有199.9.9.0 的路有条目的
ITAA_Client_A#sh ip bgp Network Next Hop Metric LocPrf Weight Path *>i172.24.1.0/24 192.168.1.6 0 100 0 i r>i192.168.1.4/30 192.168.1.6 0 100 0 i |
原因很简单,因为CLIENT_A和B之间没有直接的对等体邻居关系,iBGP也只是船一跳,所以A肯定不会得到199.9.9.0的路由信息。解决方法就是本实验的重点:
在ITAA_HOST上配置RR:
ITAA_HOST(config)#router bgp 100 ITAA_HOST(config-router)#nei 192.168.1.5 route-reflector-client *Apr 9 21:53:12.087: %BGP-5-ADJCHANGE: neighbor 192.168.1.5 Down RR client config change ITAA_HOST(config-router)#nei 172.24.1.18 route-reflector-client *Apr 9 21:53:28.203: %BGP-5-ADJCHANGE: neighbor 172.24.1.18 Down RR client config change |
可以看到,路由器的提示信息说明配置已经改变,我们现在查一下A的路由信息:
ITAA_Client_A#sh ip bgp Network Next Hop Metric LocPrf Weight Path *>i172.24.1.0/24 192.168.1.6 0 100 0 i r>i192.168.1.4/30 192.168.1.6 0 100 0 i *>i199.9.9.0 172.24.1.18 0 100 0 i |
可以看到,A已经可以学到199.9.9.0 的路由条目了,但值得说明一下的是它的下一跳,这是因为RR没有启用next-hop-self命令。我们还注意到,192.168.1.4的路有条目前面是r标记,这表明这条路由被拒绝,这里的原因是IGP可以提供更好的路由。现在我们扩展一下我们的实验:
在CLIENT_B上发布超网路由,在CLENT_A上查看路由信息(下一跳):
ITAA_Client_B(config)#router bgp 100 ITAA_Client_B(config-router)#aggr ITAA_Client_B(config-router)#aggregate-address 199.0.0.0 255.0.0.0 |
Ok后,我们依旧查看一下A上的BGP表:
ITAA_Client_B#sh ip bgp Network Next Hop Metric LocPrf Weight Path r>i172.24.1.0/24 172.24.1.17 0 100 0 i *>i192.168.1.4/30 172.24.1.17 0 100 0 i *> 199.0.0.0/8 0.0.0.0 32768 i *> 199.9.9.0 0.0.0.0 0 32768 i |
路由齐全!我们现在要做的就是过滤掉发给A的199.9.9.0这条较为具体的路由,自然在RR上控制:
控制流往CLENT_A的具体路由:
ITAA_HOST(config)#ip prefix-list supernetonly per 199.0.0.0/8 ITAA_HOST(config)#ip prefix-list supernetonly per 172.24.1.0/24 ITAA_HOST(config)#ip prefix-list supernetonly per 200.100.50.0/24 ITAA_HOST(config)#router bgp 100 ITAA_HOST(config-router)#nei 192.168.1.5 prefix-list supernetonly out |
我们查看A的BGP:
ITAA_Client_A#sh ip bgp BGP table version is 8, local router ID is 192.168.1.5 Network Next Hop Metric LocPrf Weight Path *>i172.24.1.0/24 192.168.1.6 0 100 0 i *>i199.0.0.0/8 172.24.1.18 0 100 0 i |
我们可以清楚的看到,作为客户端的A只能看到一条RR的和一条超网的BGP路由。
我们在HOST上使用show ip protocol查看协议信息,可以看到RR的信息:
ITAA_HOST#sh ip proto Routing Protocol is "bgp 100" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Route Reflector for address family IPv4 Unicast, 2 clients Route Reflector for address family IPv6 Unicast, 2 clients Route Reflector for address family VPNv4 Unicast, 2 clients Route Reflector for address family IPv4 Multicast, 2 clients ……… |
同样,在客户端就看不到:
ITAA_Client_A#sh ip pro Routing Protocol is "bgp 100" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set IGP synchronization is disabled Automatic route summarization is disabled Neighbor(s): Address FiltIn FiltOut DistIn DistOut Weight RouteMap 192.168.1.6 Maximum path: 1 Routing Information Sources: Gateway Distance Last Update 192.168.1.6 200 00:07:11 Distance: external 20 internal 200 local 200 |
结论:
1. 采用RR后,可以大幅度简化冗余的BGP网络中BGP信息的交流,但同时也会有一个弊病,就是如果RR出现问题,那么全区域内的BGP信息也会随之丢失瘫痪;
2. 时刻注意信息安全,不要让客户得到不想让他们得到的路由条目导致安全隐患;