組網:S6506和S5516利用網線對接,在S6506的VLAN1虛接口上配置ip地址10.110.50.121,在S5516的VLAN1虛接口上配置IP地址10.110.50.122,連接的兩個接口都屬于VLAN1。在S6506和S5516上配置BGP,分別指定對方VLAN1虛接口的IP地址為IGP鄰居,并引入直連路由。同時配置了另外幾個VLAN虛接口,并使接口UP,在路由表中產生這些VLAN虛接口的直連路由。
故障現象:在S6506和S5516上查看路由表,但是看不到對端交換機上被BGP引入的直連路由。
無
BGP路由學習有問題一般可能是
1、BGP發布或接收路由有問題;
2、配置不當造成路由學習有問題。
為了一步一步排除可能性,先從對端入手,看對端的路由以及發布的情況(這里從S5516入手):
1、在S5516上執行show ip route,直連路由顯示正確:
Quidway#sh ip route
Routing Tables:
Destination/Mask PRoto Pre Metric Nexthop Interface
2.2.2.0/24 DIRECT 0 0 2.2.2.1 Vlan-interface200
2.2.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
3.3.3.0/24 STATIC 60 0 2.2.2.2 Vlan-interface200
4.4.4.0/24 DIRECT 0 0 4.4.4.1 LoopBack0
4.4.4.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
10.110.48.0/21 DIRECT 0 0 10.110.50.122 Vlan-interface1
10.110.50.122/32 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
2、在S5516上執行show ip bgp,BGP要發布的路由信息也是正確的:
Quidway#sh ip bgp
BGP local router ID is 10.110.50.122
Status codes: s suppressed, d damped, h history, * valid, > best, i internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Path
i 1.1.1.0/24 (null) 100 ?
*> 2.2.2.0/24 0.0.0.0 i
*> 4.4.4.0/24 0.0.0.0 i
*> 10.110.48.0/21 0.0.0.0 i
* i 10.110.50.122 100 ?
3、在S5516上打開debug開關,查看BGP發布和接收的路由信息,也是正確的:
*0.6772997-RM-7-RTDBG:BGP SEND 10.110.50.122+1034 -> 10.110.50.121+179
*0.6773077-RM-7-RTDBG:BGP SEND message type 2 (Update) length 56
*0.6773152-RM-7-RTDBG:BGP SEND flags 0x40 code Origin(1): Incomplete
*0.6773221-RM-7-RTDBG:BGP SEND flags 0x40 code aspath(2): <null>
*0.6773294-RM-7-RTDBG:BGP SEND flags 0x40 code NextHop(3): 10.110.50.122
*0.6773363-RM-7-RTDBG:BGP SEND flags 0x40 code LocalPref(5): 100
*0.6773440-RM-7-RTDBG:BGP SEND 2.2.2.0/24, 4.4.4.0/24, 10.110.48.0/21
*0.6773509-RM-7-RTDBG:BGP SEND 10.110.50.122+1034 -> 10.110.50.121+179
*0.6773584-RM-7-RTDBG:BGP SEND message type 4 (KeepAlive) length 19
*0.6773709-RM-7-RTDBG:BGP RECV 10.110.50.121+179 -> 10.110.50.122+1034
*0.6773710-RM-7-RTDBG:BGP RECV message type 2 (Update) length 52
*0.6773836-RM-7-RTDBG:BGP RECV flags 0x40 code Origin(1): Incomplete
*0.6773913-RM-7-RTDBG:BGP RECV flags 0x40 code ASPath(2): <null>
*0.6773987-RM-7-RTDBG:BGP RECV flags 0x40 code NextHop(3): 10.110.50.121
*0.6774055-RM-7-RTDBG:BGP RECV flags 0x40 code LocalPref(5): 100
*0.6774132-RM-7-RTDBG:BGP RECV 1.1.1.0/24, 10.110.48.0/21
*0.6774185-RM-7-RTDBG:BGP RECV 10.110.50.121+179 -> 10.110.50.122+1034
*0.6774264-RM-7-RTDBG:BGP RECV message type 4 (KeepAlive) length 19
4、在S6506上執行show ip bgp,顯示從S5516學到的路由的下一跳卻是為空:
Quidway(config-router-bgp)#sh ip bgp
BGP local router ID is 10.110.50.121
Status codes: s suppressed, d damped, h history, * valid, > best, i internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Path
*> 1.1.1.0/24 0.0.0.0 i
i 2.2.2.0/24 (null) 100 ?
i 4.4.4.0/24 (null) 100 ?
*> 10.110.48.0/21 0.0.0.0 i
* i 10.110.50.121 100 ?
5、查看配置,發現兩邊都沒有配置非同步。由于是IBGP鄰居,本地BGP在收到一條BGP路由時,首先檢查路由的下一跳是否可達;假如設置了同步,則必須等到IGP也通告了這條路由,此BGP路由才被加入路由表中。由于是兩臺交換機直接相連,沒有配置別的動態路由協議,換句話說就是不會有IGP去通告這條路由,所以這些路由不會被加入到路由表中。
6、在BGP模式下執行no synchronization,取消BGP和IGP的同步,再查看路由表,路由顯示正常,問題解決。
交換機BGP的應用比較少,而路由器上BGP的使用較多,由于路由器上BGP默認就是非同步的,導致在交換機上配置BGP時忘了在上述的情況下要配置非同步。在實際使用時應該注重各個產品的不同特性。
新聞熱點
疑難解答