如下圖的MPLS ×××實驗拓撲中,R2-R3-R4處於同一AS,IGP使用OSPF,CE設備R1和R5和骨幹網運行BGP協議。所有設備的loopback0地址配置24位的掩碼。
按照MPLS ×××組網,完成所有配置,最後發現CE設備R1和R5可以相互學習到對方的路由,但是互ping不通,traceroute僅能到達互聯的PE;PE設備R2和R4之間加入vrf的loopback接口,相互也不能ping通。整個網絡,路由平面正常,但是數據轉發平面不正常。
死活找不到原因,確認所有配置都完整,還是無法找到問題原因。無意中發現一條log信息:*Mar 1 00:27:00.187: %BGP-4-×××V4NH_MASK: Nexthop 2.2.2.2 may not be reachable from neigbor 4
檢索“%BGP-4-×××V4NH_MASK”找到以下類似cisco官方資料:
Error Message
Explanation A Virtual Private Network Version 4 (×××v4) route is being sent to the specified internal BGP (IBGP) neighbor, and the next-hop address is a loopback that does not have the IP host mask /32. OSPF is being used on this loopback, and the OSPF network type of this interface is LOOPBACK. OSPF advertises this address as a host route with the IP host mask /32, regardless of what mask is configured. Because this configuration conflicts with Tag Distribution Protocol (TDP), which uses configured masks, the TDP neighbors may not receive a tag for this route. This problem can break connectivity between sites that belong to the same ×××.
Recommended Action Configure the loopback that is used as the next hop with the IP host mask /32.
從以上資料才得知,loopback0配置了24位掩碼是問題根源,以前習慣使用32位掩碼的時候從來也沒有遇到這種問題。解決方法有兩個:
1、修改loopback0的掩碼爲32位
2、在loopback0接口下增加一條命令,還原其網絡類型ip ospf net point-to-point