实验需求
R1、R2和R3之间已经部署了IGP协议,故192.168.10.0/24与192.168.20.0/24网络之间已经能够互访。现要求通过配置 静态LSP,使得这两个网络之间能基于MPLS进行互访,标签分配如图
组网图
实验思路
1、R1、R2和R3之间已经部署了IGP协议
2、配置 静态LSP
部署了IGP协议
R1
<Huawei>un ter mon
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R1
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0] ip address 10.1.12.1 255.255.255.0
[R1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.10.1 255.255.255.0
[R1]ospf 1
[R1-ospf-1] area 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.1.12.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]q
[R1-ospf-1]q
R2
<Huawei>un ter mon
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R2
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.1.12.2 255.255.255.0
[R2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.1.23.1 255.255.255.0
[R2-GigabitEthernet0/0/1]ospf 1
[R2-ospf-1] area 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.1.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.1.23.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]q
R3
<Huawei>un ter mon
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R3
[R3]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.1.23.2 255.255.255.0
[R3-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.20.1 255.255.255.0
[R3-GigabitEthernet0/0/1]ospf 1
[R3-ospf-1] area 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.1.23.2 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]q
使能MPLS
R1
[R1]mpls lsr-id 11.1.1.1
[R1]mpls
Info: Mpls starting, please wait... OK!
[R1-mpls]q
R2
[R2]mpls lsr-id 22.1.1.1
[R2]mpls
Info: Mpls starting, please wait... OK!
[R2-mpls]q
R3
[R3]mpls lsr-id 33.1.1.1
Warning: Can't configure lsr-id when MPLS is enabled.
[R3]mpls
[R3-mpls]q
接口下使能mpls
R1
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0] mpls
R2
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0] mpls
[R2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] mpls
R3
[R3]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0] mpls
LSR配置(我做的双向的,命令一起粘贴出来了,方向:先正后反)
R1
[R1]static-lsp ingress PC1_PC2 destination 192.168.20.0 24 nexthop 10.1.12.2 out
-label 100
[R1]static-lsp egress PC2_PC1 incoming-interface GigabitEthernet0/0/0 in-label 1
00
R2
[R2]static-lsp transit PC1_PC2 incoming-interface GigabitEthernet0/0/0 in-label
100 nexthop 10.1.23.2 out-label 200
[R2]static-lsp transit PC2_PC1 incoming-interface GigabitEthernet0/0/1 in-label
200 outgoing-interface GigabitEthernet0/0/0 nexthop 10.1.12.1 out-label 100
R3
[R3]static-lsp egress PC1_PC2 incoming-interface GigabitEthernet0/0/0 in-label 2
00
[R3]static-lsp ingress PC2_PC1 destination 192.168.10.0 24 nexthop 10.1.23.1 out
-label 200
查看结果
实验完成