拓扑
要求
一、MPLS静态配置,如图所示为MPLS域,AR1使用LSP-ping的方式访问AR5,且AR5回包方式也通过LSP方式,请抓包查看数据包的分装;
(1)请描述AR1访问AR5的MPLS数据访问过程?
(2)请问ingress设备如何区分MPLS转发还是IP转发?
配置
R1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <huawei>system-view [huawei]sysname AR1
[AR1]mpls lsr-id 1.1.1.1 #必须先配置lsr-id,否则会告警 [AR1]mpls
[AR1]interface GigabitEthernet0/0/0 ip address 10.1.12.1 255.255.255.0 mpls #开启接口mpls功能 [AR1]interface LoopBack0 ip address 1.1.1.1 255.255.255.255
[AR1]ospf 1 #mpls需要路由支持 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.1.12.1 0.0.0.0 [AR1]static-lsp ingress 1t5 destination 5.5.5.5 32 nexthop 10.1.12.2 out-label 17 #静态+入标签(类型为源)+命名+目的地址(除非配置了,否则mpls默认只支持主机地址(32位))+下一跳(对端物理接口地址)+标签
|
R2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <huawei>system-view [huawei]sysname AR2
[AR2]mpls lsr-id 2.2.2.2 #必须先配置lsr-id,否则会告警 [AR2]mpls
[AR2]interface GigabitEthernet0/0/0 ip address 10.1.12.2 255.255.255.0 mpls
[AR2]interface GigabitEthernet0/0/1 ip address 10.1.23.2 255.255.255.0 mpls
[AR2]interface GigabitEthernet0/0/2 ip address 10.1.24.2 255.255.255.0 mpls
[AR2]ospf 1 area 0.0.0.0 network 10.1.12.2 0.0.0.0 network 10.1.23.2 0.0.0.0 network 10.1.24.2 0.0.0.0 [AR2]static-lsp transit 1t5 incoming-interface GigabitEthernet0/0/0 in-label 17 nexth op 10.1.23.3 out-label 19 #静态 + 类型为转发 + 命名 + 标签来源接口(对端路由器接口) + 入方向标签 + 下一跳 + 出方向标签
|
R3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <huawei>system-view [huawei]sysname AR3
[AR3]mpls lsr-id 3.3.3.3 mpls [AR3]interface GigabitEthernet0/0/0 ip address 10.1.23.3 255.255.255.0 mpls interface GigabitEthernet0/0/1 ip address 10.1.34.3 255.255.255.0 mpls
[AR3]ospf 1 area 0.0.0.0 network 10.1.23.3 0.0.0.0 network 10.1.34.3 0.0.0.0
[AR3]static-lsp transit 1t5 incoming-interface GigabitEthernet0/0/1 in-label 19 nexthop 10.1.34.4 out-label 20
|
R4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <huawei>system-view [huawei]sysname AR4 [AR4]mpls lsr-id 4.4.4.4 mpls
[AR4]interface GigabitEthernet0/0/0 ip address 10.1.34.4 255.255.255.0 mpls
[AR4]interface GigabitEthernet0/0/1 ip address 10.1.45.4 255.255.255.0 mpls
[AR4]interface GigabitEthernet0/0/2 ip address 10.1.24.4 255.255.255.0 [AR4]static-lsp transit 1t5 incoming-interface GigabitEthernet0/0/1 in-label 20 nexthop 10.1.45.5 out-label 21
|
R5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <huawei>system-view [huawei]sysname AR5
[AR5]mpls lsr-id 5.5.5.5 mpls
[AR5]interface GigabitEthernet0/0/0 ip address 10.1.45.5 255.255.255.0 mpls
[AR5]interface LoopBack0 ip address 5.5.5.5 255.255.255.255
[AR5]ospf 1 area 0.0.0.0 network 5.5.5.5 0.0.0.0 network 10.1.45.5 0.0.0.0
[AR5]static-lsp egress 1t5 incoming-interface GigabitEthernet0/0/0 in-label 21 #静态 + 类型为目 + 命名 + 本端物理接口 + 入方向标签
|
验证
1 2 3
| 命令: ping lsp -a 1.1.1.1 ip 5.5.5.5 32
1.1.1.1可以ping通5.5.5.5,但是只能做到单方面的通信,要实现互通只要反过来来一遍就好,这时候5.5.5.5 就是源了。
|