华为eNSP配置MPLS实验
1、一、搭建本次实验的拓扑
两台交换机、三台路由器
2、二、配置设备的接口信息
[Huawei]sysname S1
[S1]interface Vlanif 1
[S1-Vlanif1]ip address 10.0.1.2 24
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.1.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]interface s1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24
[R1-Serial1/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]ip address 2.2.2.2 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface s1/0/0
[R2-Serial1/0/0]ip address 10.0.12.2 24
[R2-Serial1/0/0]quit
[R2]interface s2/0/0
[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]ip address 3.3.3.3 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 10.0.2.1 24
[R3-GigabitEthernet0/0/2]quit
[R3]interface s2/0/0
[R3-Serial2/0/0]ip address 10.0.23.3 24
[R3-Serial2/0/0]quit
[R3]interface loopback 0
[R3-LoopBack0]ip address 4.4.4.4 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname S2
[S2]interface Vlanif 1
[S2-Vlanif1]ip address 10.0.2.2 24
3、三、配置单区域的OSPF,让网络通畅
[S1]ospf 1 router-id 1.1.1.1
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R1]ospf 1 router-id 2.2.2.2
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]net 2.2.2.0 0.0.0.255
[R2]ospf 1 router-id 3.3.3.3
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]net 3.3.3.0 0.0.0.255
[R3]ospf 1 router-id 4.4.4.4
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 4.4.4.0 0.0.0.255
[S2]ospf 1 router-id 5.5.5.5
[S2-ospf-1]area 0
[S2-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255
4、四、验证网络连通性
[R2]ping 10.0.1.2
PING 10.0.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.2: bytes=56 Sequence=1 ttl=253 time=36 ms
Reply from 10.0.1.2: bytes=56 Sequence=2 ttl=253 time=31 ms
Reply from 10.0.1.2: bytes=56 Sequence=3 ttl=253 time=31 ms
Reply from 10.0.1.2: bytes=56 Sequence=4 ttl=253 time=31 ms
Reply from 10.0.1.2: bytes=56 Sequence=5 ttl=253 time=31 ms
--- 10.0.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/32/36 ms
[R2]ping 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=253 time=38 ms
Reply from 10.0.2.2: bytes=56 Sequence=2 ttl=253 time=33 ms
Reply from 10.0.2.2: bytes=56 Sequence=3 ttl=253 time=33 ms
Reply from 10.0.2.2: bytes=56 Sequence=4 ttl=253 time=33 ms
Reply from 10.0.2.2: bytes=56 Sequence=5 ttl=253 time=33 ms
--- 10.0.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 33/34/38 ms
5、五、配置MPLS
[R1]mpls lsr-id 2.2.2.2
[R1]mpls
Info: Mpls starting, please wait... OK!
[R1-mpls]mpls ldp
[R2]mpls lsr-id 3.3.3.3
[R2]mpls
Info: Mpls starting, please wait... OK!
[R2-mpls]mpls ldp
[R3]mpls lsr-id 4.4.4.4
[R3]mpls
Info: Mpls starting, please wait... OK!
[R3-mpls]mpls ldp
R1]interface Serial 1/0/0
[R1-Serial1/0/0]mpls
[R1-Serial1/0/0]mpls ldp
[R2]inter Serial 1/0/0
[R2-Serial1/0/0]mpls
[R2-Serial1/0/0]mpls ldp
[R2-Serial1/0/0]interface Serial 2/0/0
[R2-Serial2/0/0]mpls
[R2-Serial2/0/0]mpls ldp
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]mpls
[R3-Serial2/0/0]mpls ldp
6、六、配置LSP
[R1]mpls
[R1-mpls]lsp-trigger all
[R2]mpls
[R2-mpls]lsp-trigger all
[R3]mpls
[R3-mpls]lsp-trigger all
7、七、查看MPLS的变化信息