拓扑图:
1.配置MPLS VPN公网部分
[r2]interface g0/0/2 [r2-GigabitEthernet0/0/2]ip address 23.0.0.1 24 Nov 4 2022 16:12:47-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. [r2-GigabitEthernet0/0/2]q [r2]int l0 [r2-LoopBack0]ip address 2.2.2.2 24 [r2-LoopBack0]q [r2]ospf 1 router-id 2.2.2.2 [r2-ospf-1]a 0 [r2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 全局激活MPLS [r2]mpls Warning: Please configure mpls lsr-id first. [r2]mpl [r2]mpls l [r2]mpls ls [r2]mpls lsr-id 2.2.2.2 [r2]mpls Info: Mpls starting, please wait... OK! [r2-mpls]mpls ldp 接口激活MPLS [r2]int g0/0/2 [r2-GigabitEthernet0/0/2]mpls [r2-GigabitEthernet0/0/2]mpls ldp
[r3]int g0/0/0 [r3-GigabitEthernet0/0/0]ip address 23.0.0.2 24 Nov 4 2022 16:13:58-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [r3-GigabitEthernet0/0/0]q [r3]int g0/0/1 [r3-GigabitEthernet0/0/1]ip address 34.0.0.1 24 Nov 4 2022 16:14:19-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [r3-GigabitEthernet0/0/1]q [r3]int l0 [r3-LoopBack0]ip address 3.3.3.3 24 [r3]ospf 1 router-id 3.3.3.3 [r3-ospf-1]a 0 [r3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255 [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 34.0.0.0 0.0.0.255 MPLS激活 [r3]mpl [r3]mpls ls [r3]mpls lsr-id 3.3.3.3 [r3]mpls Info: Mpls starting, please wait... OK! [r3-mpls]mpls ldp [r3-mpls-ldp]q [r3]int g0/0/0 [r3-GigabitEthernet0/0/0]mpls [r3-GigabitEthernet0/0/0]mpls ldp [r3-GigabitEthernet0/0/0]q [r3]int g0/0/1 [r3-GigabitEthernet0/0/1]mpls [r3-GigabitEthernet0/0/1]mpls ldp
[r4]int g0/0/0 [r4-GigabitEthernet0/0/0]ip address 34.0.0.2 24 Nov 4 2022 16:15:25-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [r4-GigabitEthernet0/0/0]q [r4]int l0 [r4-LoopBack0]ip address 4.4.4.4 24 [r4-LoopBack0]q [r4]int g4/0/0 [r4-GigabitEthernet4/0/0]ip address 47.0.0.1 24 [r4-GigabitEthernet4/0/0] Nov 4 2022 16:16:50-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet4/0/0 has entered the UP state. [r4]o