MPLS的静态LSP
1.配置IP地址
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[AR1-LoopBack0]ip add 1.1.1.1 32
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 23.1.1.1 24
[AR2-GigabitEthernet0/0/1]int lo 0
[AR2-LoopBack0]ip add 2.2.2.2 32
[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[AR3-GigabitEthernet0/0/0]int lo 0
[AR3-LoopBack0]ip add 3.3.3.3 32
2.配置OSPF
[AR1]ospf
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[AR2-LoopBack0]ospf
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR3-LoopBack0]ospf
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
测试一下是否能ping通3.3.3.3
可以看到图中是不能ping通3.3.3.3,因为我们的MPLS的隧道还没有建立。
3.配置MPLS静态LDP
[AR1]mpls lsr-id 1.1.1.1
[AR1]mpls
Info: Mpls starting, please wait... OK!
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]mpls
[AR2]mpls lsr-id 2.2.2.2
Warning: Can't configure lsr-id when MPLS is enabled.
[AR2]mpls
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]mpls
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]mpls
[AR3]mpls lsr-id 3.3.3.3
[AR3]mpls
Info: Mpls starting, please wait... OK!
[AR3-GigabitEthernet0/0/0]mpls
3.配置标签
[AR1]static-lsp ingress 1-3 destination 3.3.3.3 32 nexthop 12.1.1.2 out-label 200 ##建立一个静态的LSP隧道,压入名字为1-3的目的地址为3.3.3.3子网掩码为32位,下一跳为12.1.1.2,出口标签打上200
查看AR1的MPLS的LSP
[AR2]static-lsp transit 1-3 incoming-interface GigabitEthernet 0/0/0 in-label 20
0 nexthop 23.1.1.2 out-label 100 ## 建立一个lsp静态隧道,交换名字为1-3,进入的接口为g0/0/0入标签为200,下一跳为23.1.1.2,出标签为100
查看AR2的MPLS的LSP
[AR3]static-lsp egress 1-3 incoming-interface GigabitEthernet0/0/0 in-label 100 ##建立一个LSP的隧道,弹出名字为1-3,进入的接口为g0/0/0,入标签为100
查看AR3的MPLS的LSP
[AR3]static-lsp ingress 3-1 destination 1.1.1.1 32 nexthop 23.1.1.1 out-label 10
0
[AR2]static-lsp transit 3-1 incoming-interface g0/0/1 in-label 100 nexthop 12.1
.1.1 out-label 200
[AR1]static-lsp egress 3-1 incoming-interface GigabitEthernet 0/0/0 in-label 20
0
查看MPLS隧道
4.测试连通性