![图片[1]-第35章 MPLS VPN 重叠VPN-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片3-21.png)
1.PE1配置OSPF
[PE1]ospf 1 router-id 1.1.1.1
[PE1-ospf-1]area 0
[PE1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2.P配置OSPF
[P]ospf 1 router-id 2.2.2.2
[P-ospf-1]area 0
[P-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[P-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
3.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
4.PE1配置MPLS基本能力和MPLS LDP,建立LDP LSP
[PE1]mpls lsr-id 1.1.1.1
[PE1]mpls
[PE1]mpls ldp
[PE1]interface GigabitEthernet 0/0/0
[PE1-GigabitEthernet0/0/0]mpls
[PE1-GigabitEthernet0/0/0]mpls ldp
5.P配置MPLS基本能力和MPLS LDP,建立LDP LSP
[P]mpls lsr-id 2.2.2.2
[P]mpls
[P]mpls ldp
[P]interface GigabitEthernet 0/0/0
[P-GigabitEthernet0/0/0]mpls
[P-GigabitEthernet0/0/0]mpls ldp
[P]interface GigabitEthernet 0/0/1
[P-GigabitEthernet0/0/1]mpls
[P-GigabitEthernet0/0/1]mpls ldp
6.PE2配置MPLS基本能力和MPLS LDP,建立LDP LSP
[PE2]mpls lsr-id 3.3.3.3
[PE2]mpls
[PE2]mpls ldp
[PE2]interface GigabitEthernet 0/0/1
[PE2-GigabitEthernet0/0/1]mpls
[PE2-GigabitEthernet0/0/1]mpls ldp
7.PE1配置VPN实例,将CE接入PE
[PE1]ip vpn-instance dsrwa
[PE1-vpn-instance-dsrwa]ipv4-family
[PE1-vpn-instance-dsrwa-af-ipv4]route-distinguisher 100:100
[PE1-vpn-instance-dsrwa-af-ipv4]vpn-target 100:100 export-extcommunity
[PE1-vpn-instance-dsrwa-af-ipv4]vpn-target 100:100 import-extcommunity
[PE1]ip vpn-instance dsrwb
[PE1-vpn-instance-dsrwb]ipv4-family
[PE1-vpn-instance-dsrwb]route-distinguisher 300:300
[PE1-vpn-instance-dsrwb-af-ipv4] vpn-target 200:200 export-extcommunity
[PE1-vpn-instance-dsrwb-af-ipv4]vpn-target 200:200 import-extcommunity
[PE1]interface GigabitEthernet 0/0/1
[PE1-GigabitEthernet0/0/1]ip binding vpn-instance dsrwa
[PE1-GigabitEthernet0/0/1]ip address 46.1.1.1 8
[PE1]interface GigabitEthernet 0/0/2
[PE1-GigabitEthernet0/0/2] ip binding vpn-instance dsrwb
[PE1-GigabitEthernet0/0/2]ip address 46.1.1.1 8
8.PE2配置VPN实例,将CE接入PE
[PE2]ip vpn-instance dsrwa
[PE2-vpn-instance-dsrwa]ipv4-family
[PE2-vpn-instance-dsrwa-af-ipv4]route-distinguisher 200:200
[PE2-vpn-instance-dsrwa-af-ipv4]vpn-target 100:100 export-extcommunity
[PE2-vpn-instance-dsrwa-af-ipv4]vpn-target 100:100 import-extcommunity
[PE2]ip vpn-instance dsrwb
[PE2-vpn-instance-dsrwb]ipv4-family
[PE2-vpn-instance-dsrwb-af-ipv4]route-distinguisher 400:400
[PE2-vpn-instance-dsrwb-af-ipv4]vpn-target 200:200 export-extcommunity
[PE2-vpn-instance-dsrwb-af-ipv4]vpn-target 200:200 import-extcommunity
[PE2]interface GigabitEthernet 0/0/0
[PE2-GigabitEthernet0/0/0]ip binding vpn-instance dsrwa
[PE2-GigabitEthernet0/0/0]ip address 57.1.1.3 8
[PE2]interface GigabitEthernet 0/0/2
[PE2-GigabitEthernet0/0/2]ip binding vpn-instance dsrwb
[PE2-GigabitEthernet0/0/2]ip address 57.1.1.3 8
9.配置CE1
[CE1]interface GigabitEthernet 0/0/1
[CE1-GigabitEthernet0/0/1]ip address 46.1.1.4 8
10.配置CE2
[CE2]interface GigabitEthernet 0/0/0
[CE2-GigabitEthernet0/0/0]ip address 57.1.1.5 8
11.配置CE3
[CE3]interface GigabitEthernet 0/0/2
[CE3-GigabitEthernet0/0/2]ip address 46.1.1.4 8
12.配置CE4
[CE4]interface GigabitEthernet 0/0/2
[CE4-GigabitEthernet0/0/2]ip address 57.1.1.5 8
13.PE1测试dsrwa
[PE1]ping -vpn-instance dsrwa 46.1.1.4
PING 46.1.1.4: 56 data bytes, press CTRL_C to break
Reply from 46.1.1.4: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 46.1.1.4: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 46.1.1.4: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 46.1.1.4: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 46.1.1.4: bytes=56 Sequence=5 ttl=255 time=20 ms
14.PE1配置MP-IBGP对等体
[PE1]bgp 13
[PE1-bgp]peer 3.3.3.3 as-number 13
[PE1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[PE1-bgp]ipv4-family vpnv4
[PE1-bgp-af-vpnv4]peer 3.3.3.3 enable
[PE1-bgp]ipv4-family vpn-instance dsrwa
[PE1-bgp-vpna]import-route direct
[PE1-bgp]ipv4-family vpn-instance dsrwb
[PE1-bgp-vpnb]import-route direct
15.PE3配置MP-IBGP对等体
[PE2]bgp 13
[PE2-bgp]peer 1.1.1.1 as-number 13
[PE2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[PE2-bgp]ipv4-family vpnv4
[PE2-bgp-af-vpnv4]peer 1.1.1.1 enable
[PE2-bgp]ipv4-family vpn-instance dsrwa
[PE2-bgp-vpna]import-route direct
[PE2-bgp]ipv4-family vpn-instance dsrwb
[PE2-bgp-vpnb]import-route direct
16.PE1查看PE之间的BGP对等体关系
[PE1]display bgp peer
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
3.3.3.3 4 13 6 9 0 00:02:25 Established 0
17.CE1、CE2、CE3、CE4配置静态路由
[CE1]ip route-static 0.0.0.0 0.0.0.0 46.1.1.1
[CE3]ip route-static 0.0.0.0 0.0.0.0 46.1.1.1
[CE2]ip route-static 0.0.0.0 0.0.0.0 57.1.1.3
[CE4]ip route-static 0.0.0.0 0.0.0.0 57.1.1.3
18.PE1查看静态路由
[PE1]display ip routing-table vpn-instance dsrwa
46.0.0.0/8 Direct 0 0 D 46.1.1.1 GigabitEthernet0/0/1
46.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
46.255.255.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
57.0.0.0/8 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[PE1]display ip routing-table vpn-instance dsrwb
46.0.0.0/8 Direct 0 0 D 46.1.1.1 GigabitEthernet0/0/2
46.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
46.255.255.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
57.0.0.0/8 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
19.CE1连通性测试CE2、CE3
[CE1]ping 57.1.1.5
PING 57.1.1.5: 56 data bytes, press CTRL_C to break
Reply from 57.1.1.5: bytes=56 Sequence=1 ttl=252 time=40 ms
Reply from 57.1.1.5: bytes=56 Sequence=2 ttl=252 time=40 ms
Reply from 57.1.1.5: bytes=56 Sequence=3 ttl=252 time=50 ms
Reply from 57.1.1.5: bytes=56 Sequence=4 ttl=252 time=40 ms
Reply from 57.1.1.5: bytes=56 Sequence=5 ttl=252 time=50 ms
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容