本文解決核心問題是單一CE節點到PE節點指定VRF的BGP建鄰居。

SpineWork-ce-pe-rr
整體網絡拓撲上圖所示,PE彙聚路由已與邊緣客戶路由建鄰,指派10.10.10.0/24網段。重點:其中PE端上與CE端互聯的端口必須已指定到建立好的vrf或netns上,該工作需要LinuxShell中執行iproute2指令。
1.PE
彙聚路由BGP設定入下圖所示
router bgp 100
bgp router-id 10.10.20.2
!
router bgp 100 vrf vrf1
bgp router-id 10.10.10.1
neighbor 10.10.10.2 remote-as 50
!
address-family ipv4 unicast
rd vpn export 100:10
rt vpn both 100:10
exit-address-family
!
2.CE
邊緣路由BGP設定入下圖所示
router bgp 50
bgp router-id 10.10.10.2
network 192.168.1.0/24
neighbor 10.10.10.1 remote-as 100
!
3.查詢BGP聯通
#通過如下指令,确認BGP建立連接配接狀态;其中00:19:34後面的數字1,代表接收的路由條目;
$show ip bgp vrf vrf1 summary
IPv4 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 100 vrf-id 1
BGP table version 1
RIB entries 1, using 184 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.10.10.2 4 50 24 23 0 0 0 00:19:34 1
Total number of neighbors 1
#通過如下指令,确定轉發到vrf1中的路由
$show ip bgp vrf vrf1
BGP table version is 1, local router ID is 10.10.10.1, vrf id 1
Default local pref 100, local AS 100
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 10.10.10.2 0 0 50 i
Displayed 1 routes and 1 total paths