MPLS 虚拟专用网络 配置实验
骨干网配置
1 在MPLS VPN骨干网络内部署OSPF,MPLS VPN骨干网络内部署的OSPF
用于实现骨干网络内部的路由互通。
2 在PE1、P、PE2节点配置MPLS及LDP,以PE1为例。
3 在PE1及PE2之间建立MP-BGP对等体关系,以PE1为例。
[PE1]bgp 123
[PE1-bgp]router-id 1.1.1.1
[PE1-bgp]peer 3.3.3.3 as-number 123
[PE1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
#进入BGP-VPNv4地址族视图,并使能与对等体3.3.3.3的VPNv4地址族能力。
[PE1-bgp]ipv4-family vpnv4 unicast
[PE1-bgp-af-vpnv4]peer 3.3.3.3 enable
用户接入配置
1 创建VPN实例并按照规划配置RD与RT参数,以PE1为例
[PE1]ip vpn-instance VPNX
[PE1-vpn-instance-VPNX]route-distinguisher 100:1
[PE1-vpn-instance-VPNX-af-ipv4] vpn-target 100:321 import-extcommunity
IVT Assignment result:
Info: VPN-Target assignment is successful.
[PE1-vpn-instance-VPNX-af-ipv4] 100:123 export-extcommunity
EVT Assignment result:
Info: VPN-Target assignment is successful.
[PE1-vpn-instance-VPNX-af-ipv4] quit
[PE1-vpn-instance-VPNX]quit
[PE1]ip vpn-instance VPNY
[PE1-vpn-instance-VPNY]route-distinguisher 200:1
[PE1-vpn-instance-VPNY-af-ipv4]vpn-target 200:234 import-extcommunity
[PE1-vpn-instance-VPNY-af-ipv4]vpn-target 200:432 export-extcommunity
[PE1-vpn-instance-VPNY-af-ipv4]quit
[PE1-vpn-instance-VPNY]quit
2 将接口绑定到VPN实例
[PE1]interface GigabitEthernet 0/0/1
[PE1-GigabitEthernet0/0/1]ip binding vpn-instance VPNX
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[PE1-GigabitEthernet0/0/1]ip address 192.168.100.2 24
[PE1-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/2
[PE1-GigabitEthernet0/0/2]ip binding vpn-instance VPNY
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[PE1-GigabitEthernet0/0/2]ip address 192.168.100.2 24
3 部署CE1-PE1、CE3-PE2间的路由信息交互,以PE1为例
#创建与实例绑定的OSPF进程
[PE1]ospf 2 vpn-instance VPNX
[PE1-ospf-2]area 0
[PE1-ospf-2-area-0.0.0.0]network 192.168.100.0 0.0.0.255
[PE1-ospf-2-area-0.0.0.0]quit
配置OSPF进程与MP-BGP之间的路由双向引入
[PE1]ospf 2 vpn-instance VPNX
[PE1-ospf-2]import-route bgp
[PE1-ospf-2]quit
[PE1]bgp 123
[PE1-bgp]ipv4-family vpn-instance VPNX
[PE1-bgp-VPNX]import-route ospf 2
4 部署CE2-PE1、CE4-PE2间的路由信息交互,以CE2和PE1为例
配置CE2上的EBGP,并引入直连路由192.168.1.0/24
[CE2]BGP 200
[CE2-bgp]peer 192.168.100.2 as-number 123
[CE2-bgp]network 192.168.1.0 24
[CE2-bgp]quit
#配置PE1上VPN实例的EBGP对等体
[PE1]bgp 123
[PE1-bgp]ipv4-family vpn-instance VPNY
[PE1-bgp-VPNY]peer 192.168.100.1 as-number 200