一、组网及功能要求

- 某一虚网下,CPE可同时上连到不同POP点VPE。
- 双向连到VPE的CPE,上行流量支持ECMP或主备路径两种选路方式。
二、实现原理
借助BGP选路策略及多路径通告功能实现ECMP或主备路径。路由优先级通过路由MED值来干预,MED值越小,优先级越高。
三、验证过程
验证设备选择CPE14、VPE14及VPE5三台设备,设备BGP基本信息如下
| 设备 | bgp邻居地址 | AS号 |
|---|---|---|
| CPE14 | 192.168.0.105 | 1414 |
| VPE14 | 192.168.0.106 | 1515 |
| VPE5 | 192.168.0.2 | 444 |
- BGP邻居正常建立
```css
//CPE14邻居信息
[CPE14]display bgp peer ipv4 vpn-instance connection-nzy
BGP local router ID: 14.14.14.14
Local AS number: 1414
Total number of peers: 2 Peers in established state: 2
- Dynamically created peer Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State 192.168.0.2 444 1486 1730 0 3 22:02:35 Established 192.168.0.106 1515 1393 1465 0 3 22:31:44 Established
//VPE14邻居信息 [VPE14]display bgp peer ipv4 vpn-instance connection-nzy BGP local router ID: 172.171.15.24 Local AS number: 1515 Total number of peers: 1 Peers in established state: 1
- Dynamically created peer Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State 192.168.0.105 1414 1468 1395 0 5 22:34:01 Established
//VPE5邻居信息 [VPE5]display bgp peer ipv4 vpn-instance fortest BGP local router ID: 44.44.44.44 Local AS number: 444 Total number of peers: 1 Peers in established state: 1
- Dynamically created peer Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State 192.168.0.105 1414 1734 1489 0 4 22:05:34 Established
2. **CPE配置负载分担**```css[CPE14]display current-configuration configuration bgpbgp 1414ip vpn-instance connection-nzycompare-different-as-medpeer 192.168.0.2 as-number 444peer 192.168.0.2 connect-interface Vsi-interface49peer 192.168.0.2 bfd multi-hoppeer 192.168.0.106 as-number 1515peer 192.168.0.106 connect-interface Vsi-interface49peer 192.168.0.106 bfd multi-hop#address-family ipv4 unicastbalance 8balance as-path-neglectbalance as-path-relaxpreference 5 255 255import-route directimport-route staticpeer 192.168.0.2 enablepeer 192.168.0.2 next-hop-localpeer 192.168.0.106 enablepeer 192.168.0.106 next-hop-local
- VPE发布网段相同静态路由 ```css //VPE14发布1.2.3.0/24 [VPE14]display current-configuration configuration | include static ip route-static vpn-instance connection-nzy 1.2.3.0 24 19.1.1.1
//VPE5发布1.2.3.0/24 [VPE5]display current-configuration configuration | include static ip route-static vpn-instance fortest 1.2.3.0 24 17.1.1.2
4. **VPE为CPE邻居配置相同MED值**```css//VPE14配置MED为255[VPE14]display current-configuration configuration bgpbgp 1515ip vpn-instance connection-nzypeer 192.168.0.105 as-number 1414peer 192.168.0.105 connect-interface Vsi-interface55peer 192.168.0.105 bfd multi-hopaddress-family ipv4 unicastdefault med 255balance 8balance as-path-relaxpreference 5 255 255import-route directimport-route staticpeer 192.168.0.105 enablepeer 192.168.0.105 next-hop-local//VPE5配置MED为255[VPE5]display current-configuration configuration bgpbgp 444ip vpn-instance fortestpeer 192.168.0.105 as-number 1414peer 192.168.0.105 connect-interface Vsi-interface1peer 192.168.0.105 bfd multi-hopaddress-family ipv4 unicastdefault med 255balance 8balance as-path-relaxpreference 255 255 255import-route directimport-route staticpeer 192.168.0.105 enablepeer 192.168.0.105 next-hop-local
CPE此时收到两条1.2.3.0/24等价路由 ```css //CPE14收到两条1.2.3.0/24,均为最优 [CPE6_15.21]display bgp routing-table ipv4 vpn-instance connection-nzy Total number of routes: 11 BGP local router ID is 14.14.14.14 Status codes: * - valid, > - best, d - dampened, h - history,
s - suppressed, S - stale, i - internal, e - externalOrigin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
e 1.2.3.0/24 192.168.0.2 255 0 444?
e 192.168.0.106 255 0 1515?
16.1.1.0/24 16.1.1.1 0 32768 ?
16.1.1.1/32 127.0.0.1 0 32768 ?
e 17.1.1.0/24 192.168.0.2 255 0 444?
e 19.1.1.0/24 192.168.0.106 255 0 1515?
52.1.1.0/24 16.1.1.2 0 32768 ?
192.168.0.0/16 192.168.0.105 0 32768 ?
- e 192.168.0.106 255 0 1515?
- e 192.168.0.2 255 0 444?
192.168.0.105/32 127.0.0.1 0 32768 ?
//CPE14转发表包括两条1.2.3.0/24路由 [CPE6_15.21]display ip routing-table vpn-instance connection-nzy Destinations : 21 Routes : 22 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/0 Static 60 0 172.171.0.1 GE2/0 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 1.2.3.0/24 BGP 5 255 192.168.0.2 Vsi49 BGP 5 255 192.168.0.106 Vsi49 16.1.1.0/24 Direct 0 0 16.1.1.1 GE1/0.1006 16.1.1.0/32 Direct 0 0 16.1.1.1 GE1/0.1006 16.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 16.1.1.255/32 Direct 0 0 16.1.1.1 GE1/0.1006 17.1.1.0/24 BGP 5 255 192.168.0.2 Vsi49 19.1.1.0/24 BGP 5 255 192.168.0.106 Vsi49 52.1.1.0/24 Static 60 0 16.1.1.2 GE1/0.1006 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.0.0/16 Direct 0 0 192.168.0.105 Vsi49 192.168.0.0/32 Direct 0 0 192.168.0.105 Vsi49 192.168.0.105/32 Direct 0 0 127.0.0.1 InLoop0 192.168.255.255/32 Direct 0 0 192.168.0.105 Vsi49 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
6. **修改VPE14 MED为300,降低路由优先级**```css//VPE14修改MED为300[VPE14]display current-configuration configuration bgpbgp 1515ip vpn-instance connection-nzypeer 192.168.0.105 as-number 1414peer 192.168.0.105 connect-interface Vsi-interface55peer 192.168.0.105 bfd multi-hopaddress-family ipv4 unicastdefault med 300balance 8balance as-path-relaxpreference 5 255 255import-route directimport-route staticpeer 192.168.0.105 enablepeer 192.168.0.105 next-hop-local
CPE重新择优,MED值较小值优先 ```css //CPE14 1.2.3.0/24路由MED为255最优 [CPE14]display bgp routing-table ipv4 vpn-instance connection-nzy Total number of routes: 11 BGP local router ID is 14.14.14.14 Status codes: * - valid, > - best, d - dampened, h - history,
s - suppressed, S - stale, i - internal, e - externalOrigin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
e 1.2.3.0/24 192.168.0.2 255 0 444?
- e 192.168.0.106 300 0 1515?
16.1.1.0/24 16.1.1.1 0 32768 ?
16.1.1.1/32 127.0.0.1 0 32768 ?
e 17.1.1.0/24 192.168.0.2 255 0 444?
e 19.1.1.0/24 192.168.0.106 300 0 1515?
52.1.1.0/24 16.1.1.2 0 32768 ?
192.168.0.0/16 192.168.0.105 0 32768 ?
- e 192.168.0.106 300 0 1515?
- e 192.168.0.2 255 0 444?
192.168.0.105/32 127.0.0.1 0 32768 ?
//CPE14转发面无1.2.3.0/24 ECMP路由 [CPE14]display ip routing-table vpn-instance connection-nzy Destinations : 21 Routes : 21 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/0 Static 60 0 172.171.0.1 GE2/0 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 1.2.3.0/24 BGP 5 255 192.168.0.2 Vsi49 16.1.1.0/24 Direct 0 0 16.1.1.1 GE1/0.1006 16.1.1.0/32 Direct 0 0 16.1.1.1 GE1/0.1006 16.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 16.1.1.255/32 Direct 0 0 16.1.1.1 GE1/0.1006 17.1.1.0/24 BGP 5 255 192.168.0.2 Vsi49 19.1.1.0/24 BGP 5 300 192.168.0.106 Vsi49 52.1.1.0/24 Static 60 0 16.1.1.2 GE1/0.1006 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 192.168.0.0/16 Direct 0 0 192.168.0.105 Vsi49 192.168.0.0/32 Direct 0 0 192.168.0.105 Vsi49 192.168.0.105/32 Direct 0 0 127.0.0.1 InLoop0 192.168.255.255/32 Direct 0 0 192.168.0.105 Vsi49 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
四、控制器修改点
- BGP peer南向支持配置负载分担、MED比较策略、AS_PATH比较策略
- BGP peer南向支持独立配置MED值
- CPE到VPE 支持多link
- vrf配置流程改造
- 静态路由配置流程改造
- CPE到VPE支持多ipsec policy
- CPE到VPE支持多tunnel
- CPE到VPE支持多BGP peer
- CPE vsi配置流程改造
- CPE vsi interface配置流程改造
