![图片[1]-15.3 MPLS VPN-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片57-1-1024x550.png)
1.骨干网PE之间配置OSPF
1)PE1配置OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2)P配置OSPF
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
3)PE1配置OSPF
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
2.骨干网配置MPLS基本能力和MPLS LDP,建立MPLS LSP
1)PE1配置MPLS
[R1]mpls lsr-id 1.1.1.1
[R1]mpls
[R1]mpls ldp
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]mpls
[R1-GigabitEthernet0/0/0]mpls ldp
2)P配置MPLS
[R2]mpls lsr-id 2.2.2.2
[R2]mpls
[R2]mpls ldp
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]mpls
[R2-GigabitEthernet0/0/0]mpls ldp
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp
3)PE2配置MPLS
[R3]mpls lsr-id 3.3.3.3
[R3]mpls
[R3]mpls ldp
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp
3.PE上配置使能IPv4地址族VPN实例,并把与CE相连的接口和相应的VPN实例绑定
1)PE1配置VPN实例,并将CE1接入PE1
[R1]ip vpn-instance dsrwa
[R1-vpn-instance-dsrwa]ipv4-family
[R1-vpn-instance-dsrwa-af-ipv4]route-distinguisher 100:1
[R1-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 export-extcommunity
[R1-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 import-extcommunity
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip binding vpn-instance dsrwa
[R1-GigabitEthernet0/0/1]ip address 14.1.1.1 8
2)PE2配置VPN实例,并将CE2接入PE2
[R3]ip vpn-instance dsrwa
[R3-vpn-instance-dsrwa]ipv4-family
[R3-vpn-instance-dsrwa-af-ipv4]route-distinguisher 200:1
[R3-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 export-extcommunity
[R3-vpn-instance-dsrwa-af-ipv4]vpn-target 111:1 import-extcommunity
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip binding vpn-instance dsrwa
[R3-GigabitEthernet0/0/0]ip address 35.1.1.3 8
4.PE之间配置MP-IBGP交换VPN路由信息
1)PE1配置IBGP
[R1]bgp 123
[R1-bgp]peer 3.3.3.3 as-number 123
[R1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R1-bgp]ipv4-family vpnv4
[R1-bgp-af-vpnv4]peer 3.3.3.3 enable
2)PE2配置IBGP
[R3]bgp 123
[R3-bgp]peer 1.1.1.1 as-number 123
[R3-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R3-bgp]ipv4-family vpnv4
[R3-bgp-af-vpnv4]peer 1.1.1.1 enable
5.CE与PE之间配置EBGP交换VPN路由信息
1)CE1配置EBGP
[R4]bgp 400
[R4-bgp]peer 14.1.1.1 as-number 123
[R4-bgp]ipv4-family unicast
[R4-bgp-af-ipv4]network 4.4.4.4 255.255.255.255
2)PE1配置EBGP
[R1]bgp 123
[R1-bgp]ipv4-family vpnv4
[R1-bgp]ipv4-family vpn-instance dsrwa
[R1-bgp-dsrwa]peer 14.1.1.4 as-number 400
3)CE2配置EBGP
[R5]bgp 500
[R5-bgp]peer 35.1.1.3 as-number 123
[R5-bgp]ipv4-family unicast
[R5-bgp-af-ipv4]network 5.5.5.5 255.255.255.255
4)PE2配置EBGP
[R3]bgp 123
[R3-bgp]ipv4-family vpnv4
[R3-bgp]ipv4-family vpn-instance dsrwa
[R3-bgp-dsrwa]peer 35.1.1.5 as-number 500
6.检查配置结果
[R1]display ip routing-table vpn-instance dsrwa
4.4.4.4/32 EBGP 255 0 D 14.1.1.4 GigabitEthernet0/0/1
5.5.5.5/32 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/0/0
14.0.0.0/8 Direct 0 0 D 14.1.1.1 GigabitEthernet0/0/1
14.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
14.255.255.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
7.连通性测试
[R4]ping -a 4.4.4.4 5.5.5.5
PING 5.5.5.5: 56 data bytes, press CTRL_C to break
Reply from 5.5.5.5: bytes=56 Sequence=1 ttl=252 time=40 ms
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容