IBGP水平分割:从IBGP学习到的路由绝不对再传播给其它的IBGP邻居(可以传给EBGP邻居)。IGP中的RIP、IGRP是基于端口的水平分割;而IBGP是基于邻居的水平分割。
IBGP水平分割主要是为了防止在AS内部产生路由环路!(而对于EBGP的水平分割主要有AS-PATH控制!)
解决办法:1、full mesh(大型的网络中不现实)
2、路由反射器
3、联邦
这里我们这里就详细的讨论路由反射器。
1、路由反射器:C/S模型,在一个AS内,其中一台路由器作为路由反射器RR(Route Reflector),其它路由器做为客户机(Client)。客户机与路由反射器之间建立IBGP连接。路由反射器和它的客户机组成一个集群(Cluster)。
2、工作原理:
1)从非客户机IBGP对等体学到的路由,发布给此RR的所有客户机。
2)从客户机学到的路由,发布给此RR的所有非客户机和其他客户机
3)从EBGP对等体学到的路由,发布给所有的非客户机和客户机。
RR只需要在反射器上配置,客户机不需要知道自己是客户机。(所以在选RR的时候要根据拓扑选择最合适的路由器,不然达不到效果!!)
3、路由反射器的两个可选非传递属性:Originator_ID和Cluster_List。都是为了防止环路的。
ORIGINATOR_ID是本地AS中路由发起方的Route ID,如果发起方发现接收到的路由的Originator_ID是自己Route ID,就知道出现了路由环路,因而忽略该路由
CLUSTER_LIST是由一串由路由传递所经过的路由反射簇(cluster)ID,如果RR发现其本地簇ID在其所接收到得路由的Cluster_list中,那么就知道出现了环路。
实验拓扑:
R1: |
interface Loopback100 ip address 100.1.1.1 255.255.255.0 ! interface FastEthernet0/0 ip address 11.1.1.1 255.255.255.0 ! router bgp 100 no synchronization bgp log-neighbor-changes network 100.1.1.0 mask 255.255.255.0 neighbor 11.1.1.2 remote-as 200 ! |
R2: |
interface Loopback1 ip address 2.2.2.2 255.255.255.0 ! interface FastEthernet0/0 ip address 12.1.1.1 255.255.255.0 ! interface FastEthernet1/0 ip address 11.1.1.2 255.255.255.0 ! router rip version 2 network 2.0.0.0 network 12.0.0.0 no auto-summary ! router bgp 200 no synchronization bgp router-id 2.2.2.2 bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 200 neighbor 3.3.3.3 update-source Loopback1 neighbor 3.3.3.3 next-hop-self neighbor 11.1.1.1 remote-as 100 ! |
R3: |
interface Loopback1 ip address 3.3.3.3 255.255.255.0 ! interface FastEthernet0/0 ip address 13.1.1.1 255.255.255.0 ! interface FastEthernet1/0 ip address 12.1.1.2 255.255.255.0 duplex half ! router rip version 2 network 3.0.0.0 network 12.0.0.0 network 13.0.0.0 no auto-summary ! router bgp 200 no synchronization bgp router-id 3.3.3.3 bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 200 neighbor 2.2.2.2 update-source Loopback1 neighbor 4.4.4.4 remote-as 200 neighbor 4.4.4.4 update-source Loopback1 ! |
R4: |
interface Loopback1 ip address 4.4.4.4 255.255.255.0 ! interface FastEthernet0/0 ip address 14.1.1.1 255.255.255.0 duplex half ! interface FastEthernet1/0 ip address 13.1.1.2 255.255.255.0 duplex half ! router rip version 2 network 4.0.0.0 network 13.0.0.0 no auto-summary ! router bgp 200 no synchronization bgp router-id 4.4.4.4 bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 200 neighbor 3.3.3.3 update-source Loopback1 neighbor 3.3.3.3 next-hop-self neighbor 14.1.1.2 remote-as 300 |
R5: |
interface Loopback30 ip address 30.1.1.1 255.255.255.0 ! router bgp 300 no synchronization bgp log-neighbor-changes network 30.1.1.0 mask 255.255.255.0 neighbor 14.1.1.1 remote-as 200 ! |
R3#sh ip bg BGP table version is 9, local router ID is 3.3.3.3 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 *>i30.1.1.0/24 4.4.4.4 0 100 0 300 i *>i100.1.1.0/24 2.2.2.2 0 100 0 100 i |
R2#sho ip bg BGP table version is 8, local router ID is 2.2.2.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 *> 100.1.1.0/24 11.1.1.1 0 0 100 i |
R4#sh ip bg BGP table version is 6, local router ID is 4.4.4.4 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 *> 30.1.1.0/24 14.1.1.2 0 0 300 i |
由上看到R2和R4都将学到了路由传给了R3,但是由于IBGP水平分割问题,R3不会转发给其邻居。
将R3配做路由反射器:
R3(config)#router b 200 R3(config-router)#neighbor 2.2.2.2 route-reflector-client 03:21:59: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down RR client config change R3(config-router)#neighbor 4.4.4.4 route-reflector-client 03:22:15: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Down RR client config change R3(config-router)# 03:22:25: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up R3(config-router)# 03:22:41: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up |
可以看到R3与R2和R4重新建立了邻居关系。
R3#sho ip bg neighbors BGP neighbor is 2.2.2.2, remote AS 200, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:02:57 Last read 00:00:56, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 8 8 Notifications: 0 0 Updates: 10 12 Keepalives: 300 300 Route Refresh: 2 1 Total: 320 321 Default minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast BGP table version 29, neighbor version 29 Index 1, Offset 0, Mask 0x2 Route-Reflector Client //在RR可以看到R2和R4是client Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 1 1 (Consumes 36 bytes) Prefixes Total: 1 1 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 1 Used as multipath: n/a 0
! ! SRTT: 197 ms, RTTO: 984 ms, RTV: 787 ms, KRTT: 0 ms minRTT: 4 ms, maxRTT: 300 ms, ACK hold: 200 ms Flags: higher precedence, nagle
Datagrams (max data segment is 536 bytes): Rcvd: 9 (out of order: 0), with data: 7, total data bytes: 199 Sent: 13 (retransmit: 0, fastretransmit: 0), with data: 7, total data bytes: 213
BGP neighbor is 4.4.4.4, remote AS 200, internal link BGP version 4, remote router ID 4.4.4.4 BGP state = Established, up for 00:02:43 Last read 00:00:43, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 8 8 Notifications: 0 0 Updates: 9 14 Keepalives: 300 300 Route Refresh: 2 3 Total: 319 325 Default minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast BGP table version 29, neighbor version 29 Index 2, Offset 0, Mask 0x4 Route-Reflector Client Sent Rcvd Prefix activity: ---- ---- Prefixes Current: 1 1 (Consumes 36 bytes) Prefixes Total: 1 1 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 1 Used as multipath: n/a 0 ! ! ! iss: 3706214856 snduna: 3706215070 sndnxt: 3706215070 sndwnd: 16171 irs: 807270701 rcvnxt: 807270901 rcvwnd: 16185 delrcvwnd: 199
SRTT: 186 ms, RTTO: 1079 ms, RTV: 893 ms, KRTT: 0 ms minRTT: 4 ms, maxRTT: 352 ms, ACK hold: 200 ms Flags: higher precedence, nagle
Datagrams (max data segment is 536 bytes): Rcvd: 7 (out of order: 0), with data: 5, total data bytes: 199 Sent: 10 (retransmit: 0, fastretransmit: 0), with data: 6, total data bytes: 21 |