![图片[1]-第32章 MPLS VPN PE和CE运行静态-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片6-20.png)
1.CE1配置静态路由
[CE1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
2.CE2配置静态路由
[CE2]ip route-static 0.0.0.0 0.0.0.0 34.1.1.3
3.PE1创建配置VPN实例
[PE1]ip vpn-instance vpn1
[PE1-vpn-instance-vpn1]route-distinguisher 1:1
[PE1-vpn-instance-vpn1-af-ipv4]vpn-target 1:1 export-extcommunity
[PE1-vpn-instance-vpn1-af-ipv4]vpn-target 1:1 import-extcommunity
4.PE1配置MPLS、LDP
[PE1]mpls lsr-id 2.2.2.2
[PE1]mpls
[PE1]mpls ldp
[PE1]interface GigabitEthernet 0/0/0
[PE1-GigabitEthernet0/0/0]mpls ldp
[PE1]interface GigabitEthernet 0/0/1
[PE1-GigabitEthernet0/0/1]ip binding vpn-instance vpn1
//私网侧接口与VPN绑定
[PE1-GigabitEthernet0/0/1]ip address 12.1.1.2 8
5.PE1配置BGP
[R2]bgp 23
[R2-bgp]peer 3.3.3.3 as-number 23
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[PE1-bgp]ipv4-family vpnv4
[PE1-bgp-af-vpnv4]policy vpn-target
[PE1-bgp-af-vpnv4]peer 3.3.3.3 enable
//使能对等体交换VPNv4路由信息的能力
[R2-bgp]ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1]import-route static
//引入私网的静态路由
6.PE1配置OSPF
[PE1]ospf 1 router-id 2.2.2.2
[PE1-ospf-1]area 0
[PE1-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[PE1-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
7.PE1配置VPN实例静态路由
[PE1]ip route-static vpn-instance vpn1 1.1.1.1 255.255.255.255 12.1.1.1
8.PE2创建配置VPN实例
[PE2]ip vpn-instance vpn1
[PE2-vpn-instance-vpn1]route-distinguisher 1:1
[PE2-vpn-instance-vpn1-af-ipv4]vpn-target 1:1 export-extcommunity
[PE2-vpn-instance-vpn1-af-ipv4]vpn-target 1:1 import-extcommunity
9.PE2配置MPLS、LDP
[PE2]mpls lsr-id 3.3.3.3
[PE2]mpls
[PE2]mpls ldp
[PE2]interface GigabitEthernet 0/0/0
[PE2-GigabitEthernet0/0/0]mpls
[PE2-GigabitEthernet0/0/0]mpls ldp
[PE2]interface GigabitEthernet 0/0/1
[PE2-GigabitEthernet0/0/1]ip binding vpn-instance vpn1
[PE2-GigabitEthernet0/0/1]ip address 34.1.1.3 8
//私网侧接口与VPN绑定
10.PE2配置BGP
[PE2]bgp 23
[PE2-bgp]peer 2.2.2.2 as-number 23
[PE2-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[PE2-bgp]ipv4-family vpnv4
[PE2-bgp-af-vpnv4]policy vpn-target
[PE2-bgp-af-vpnv4]peer 2.2.2.2 enable
//使能对等体交换VPNv4路由信息的能力
[PE2-bgp]ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1]import-route static
//引入私网的静态路由
11.PE2配置OSPF
[PE2]ospf 1 router-id 3.3.3.3
[PE2-ospf-1]area 0
[PE2-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
12.PE2配置VPN实例静态路由
[PE2]ip route-static vpn-instance vpn1 4.4.4.4 255.255.255.255 34.1.1.4
13.CE1连通性测试CE2
<R1>ping -a 1.1.1.1 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Request time out
Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=290 ms
Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=30 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=30 ms
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容