实验拓扑
- 该拓扑底层网络配置已完成;
- 且,域内已通过 OSPF 互通(仅宣告必要端口);
- 且,域内已部署 SR MPLS BE 环境;
实验需求
- 实现 PC1 与 PC2 互通;
实验过程
配置思路:
- 通过 BGP Labeled Unicast 技术,实现两端 PE 设备互通;
- 在 PE 设备互通的基础上,部署 VPNv4 技术来进行路由通告;
配置过程
# ----------------------------------------------------------------------------- # BGP Labeled Unicast # ------------------------------------------------- # CX1 and CX3 [CX1]bgp 100 [CX1-bgp]peer 3.3.3.3 as-number 100 [CX1-bgp]peer 3.3.3.3 connect-interface LoopBack 0 [CX1-bgp]ipv4-family labeled-unicast [CX1-bgp-af-ipv4-labeled]peer 3.3.3.3 enable [CX3]bgp 100 [CX3-bgp]peer 1.1.1.1 as-number 100 [CX3-bgp]peer 1.1.1.1 connect-interface LoopBack 0 [CX3-bgp]ipv4-family labeled-unicast [CX3-bgp-af-ipv4-labeled]peer 1.1.1.1 enable # ------------------------------------------------- # CX4 and CX6 [CX4]bgp 200 [CX4-bgp]peer 6.6.6.6 as-number 200 [CX4-bgp]peer 6.6.6.6 connect-interface LoopBack 0 [CX4-bgp]ipv4-family labeled-unicast [CX4-bgp-af-ipv4-labeled]peer 6.6.6.6 enable [CX6]bgp 200 [CX6-bgp]peer 4.4.4.4 as-number 200 [CX6-bgp]peer 4.4.4.4 connect-interface LoopBack 0 [CX6-bgp]ipv4-family labeled-unicast [CX6-bgp-af-ipv4-labeled]peer 4.4.4.4 enable # ------------------------------------------------- # CX3 and CX4 [CX3]bgp 100 [CX3-bgp]peer 10.0.34.4 as-number 200 [CX3-bgp]ipv4-family labeled-unicast [CX3-bgp-af-ipv4-labeled]peer 10.0.34.4 enable [CX4]bgp 200 [CX4-bgp]peer 10.0.34.3 as-number 100 [CX4-bgp]ipv4-family labeled-unicast [CX4-bgp-af-ipv4-labeled]peer 10.0.34.3 enable # ------------------------------------------------- # Route Advertising and Importing [CX1]bgp 100 [CX1-bgp]ipv4-family labeled-unicast [CX1-bgp-af-ipv4-labeled]network 1.1.1.1 32 [CX1-bgp]ipv4-family unicast [CX1-bgp-af-ipv4]import-rib public labeled-unicast [CX6]bgp 200 [CX6-bgp]ipv4-family labeled-unicast [CX6-bgp-af-ipv4-labeled]network 6.6.6.6 32 [CX6-bgp]ipv4-family unicast [CX6-bgp-af-ipv4]import-rib public labeled-unicast # ----------------------------------------------------------------------------- # BGP VPNv4 [CX1]bgp 100 [CX1-bgp]peer 6.6.6.6 as-number 200 [CX1-bgp]peer 6.6.6.6 connect-interface LoopBack 0 [CX1-bgp]peer 6.6.6.6 ebgp-max-hop [CX1-bgp]ipv4-family vpnv4 unicast [CX1-bgp-af-vpnv4]peer 6.6.6.6 enable [CX6]bgp 200 [CX6-bgp]peer 1.1.1.1 as-number 100 [CX6-bgp]peer 1.1.1.1 connect-interface LoopBack 0 [CX6-bgp]peer 1.1.1.1 ebgp-max-hop [CX6-bgp]ipv4-family vpnv4 unicast [CX6-bgp-af-vpnv4]peer 1.1.1.1 enable # ----------------------------------------------------------------------------- # IPv4 Family Unicast [CX1]ip vpn-instance SiteA [CX1-vpn-instance-SiteA]ipv4-family unicast [CX1-vpn-instance-SiteA-af-ipv4]route-distinguisher 10:1 [CX1-vpn-instance-SiteA-af-ipv4]vpn-target 10:1 [CX1-vpn-instance-SiteA-af-ipv4]vpn-target 20:1 [CX1]interface Ethernet 1/0/0 [CX1-Ethernet1/0/0]ip binding vpn-instance SiteA [CX1-Ethernet1/0/0]ip address 192.168.10.254 24 [CX1]bgp 100 [CX1-bgp]ipv4-family vpn-instance SiteA [CX1-bgp-SiteA]network 192.168.10.0 24 [CX6]ip vpn-instance SiteB [CX6-vpn-instance-SiteB]ipv4-family unicast [CX6-vpn-instance-SiteB-af-ipv4]route-distinguisher 20:1 [CX6-vpn-instance-SiteB-af-ipv4]vpn-target 20:1 [CX6-vpn-instance-SiteB-af-ipv4]vpn-target 10:1 [CX6]interface Ethernet 1/0/1 [CX6-Ethernet1/0/1]ip binding vpn-instance SiteB [CX6-Ethernet1/0/1]ip address 192.168.20.254 24 [CX6]bgp 200 [CX6-bgp]ipv4-family vpn-instance SiteB [CX6-bgp-SiteB]network 192.168.20.254 24
测试方法:
- PC1 ping PC2 能够成功
- 并且在 CE1 链路抓包,能够看到 3 层标签;
排查方法:
- 查看 BGP IPv4 Labeled Unicast 关系:display bgp labeled peer
- 查看标签 display bgp labeled routing-table label
- ping -a 1.1.1.1 6.6.6.6