实验需求
R1、R2、R3和R4之间运行了IGP协议,已经实现了IP层面的互联互通。
需求:通过配置MPLS以及LDP,使得192.168.10.0/24网段和192.168.20.0/24网段,可以通过标签交换的方式实现互访
组网图
实验思路
1、基本链路通信以及配置IGP协议(此实验采用的IGP协议是ISIS)
2、配置mpls ldp
基本链路通信以及配置IGP协议
R1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei][Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad 10.1.12.1 24
[R1-GigabitEthernet0/0/0]int loo0
[R1-LoopBack0]ip ad 11.1.1.1 32
[R1-LoopBack0]int loo1
[R1-LoopBack1]ip ad 192.168.10.1 24
[R1-LoopBack1]q
[R1]isis
[R1-isis-1]network-entity 49.0001.0110.0100.1001.00
[R1-isis-1]cost-style wide
Info: Cost style changed, Resetting ISIS...
[R1-isis-1]is-name R1
[R1-isis-1]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]isis enable 1
[R1-GigabitEthernet0/0/0]int loo0
[R1-LoopBack0]isis enable 1
[R1-LoopBack0]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]sysn R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip ad 10.1.12.2 24
[R2-GigabitEthernet0/0/0]int loo0
[R2-LoopBack0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip ad 10.1.23.2 24
[R2-GigabitEthernet0/0/1]int loo0
[R2-LoopBack0]ip ad 22.1.1.1 32
[R2-LoopBack0]q
[R2]isis
[R2-isis-1]network-entity 49.0001.0220.0100.1001.00
[R2-isis-1]cost-style wide
Info: Cost style changed, Resetting ISIS...
[R2-isis-1]is-name R2
[R2-isis-1]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]isis enable 1
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]isis enable 1
[R2-GigabitEthernet0/0/1]int loo0
[R2-LoopBack0]isis enable 1
[R2-LoopBack0]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]sysn R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad 10.1.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip ad 10.1.34.3 24
[R3-GigabitEthernet0/0/1]int loo0
[R3-LoopBack0]ip ad 33.1.1.1 32
[R3-LoopBack0]q
[R3]isis
[R3-isis-1]network-entity 49.0001.0330.0100.1001.00
[R3-isis-1]cost-style wide
Info: Cost style changed, Resetting ISIS...
[R3-isis-1]is-name R3
[R3-isis-1]q
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]isis enable 1
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]isis enable 1
[R3-GigabitEthernet0/0/1]int loo0
[R3-LoopBack0]isis enable 1
[R3-LoopBack0]q
R4
<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]sysn R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad 10.1.34.4 24
[R4-GigabitEthernet0/0/0]int loo0
[R4-LoopBack0]ip ad 44.1.1.1 32
[R4-LoopBack0]int loo1
[R4-LoopBack1]ip ad 192.168.20.1 24
[R4-LoopBack1]q
[R4]isis
[R4-isis-1]network-entity 49.0001.0440.0100.1001.00
[R4-isis-1]cost-style wide
Info: Cost style changed, Resetting ISIS...
[R4-isis-1]is-name R4
[R4-isis-1]q
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]isis enable 1
[R4-GigabitEthernet0/0/0]int loo0
[R4-LoopBack0]isis enable 1
[R4-LoopBack0]int loo1
[R4-LoopBack1]isis enable 1
[R4-LoopBack1]q
查看isis邻居关系是否建立
配置mpls、mpls ldp 并在接口下使能
R1
[R1]mpls lsr-id 11.1.1.1
[R1]mpls
Info: Mpls starting, please wait... OK!
[R1-mpls]q
[R1]mpls ldp
[R1-mpls-ldp]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]mpls
[R1-GigabitEthernet0/0/0]mpls ldp
[R1-GigabitEthernet0/0/0]q
R2
[R2]mpls lsr-id 22.1.1.1
[R2]mpls
Info: Mpls starting, please wait... OK!
[R2-mpls]q
[R2]mpls ldp
[R2-mpls-ldp]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]mpls
[R2-GigabitEthernet0/0/0]mpls ldp
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp
[R2-GigabitEthernet0/0/1]q
R3
[R3]mpls lsr-id 33.1.1.1
[R3]mpls
Info: Mpls starting, please wait... OK!
[R3-mpls]q
[R3]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]int g0/0/1
[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp
[R3-GigabitEthernet0/0/1]q
R4
[R4]mpls lsr-id 44.1.1.1
[R4]mpls
Info: Mpls starting, please wait... OK!
[R4-mpls]q
[R4]mpls ldp
[R4-mpls-ldp]q
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]mpls
[R4-GigabitEthernet0/0/0]mpls ldp
[R4-GigabitEthernet0/0/0]q
查看mpls 会话
mpls ldp设置成功
触发LSP的策略
R1
[R1]ip ip-prefix LDP permit 192.168.10.0 24
[R1]ip ip-prefix LDP permit 192.168.20.0 24
[R1]mpls
[R1-mpls]lsp-trigger ip-prefix LDP
[R1-mpls]q
R4
[R4]ip ip-prefix LDP permit 192.168.10.0 24
[R4]ip ip-prefix LDP permit 192.168.20.0 24
[R4]mpls
[R4-mpls]lsp-trigger ip-prefix LDP
[R4-mpls]q
查看标签
生成标签,没问题,至此采用ISIS作为IGP协议的的mpls ldp实验已完成。
总配置
R1
un ter mon
sys
un in en
sysname R1
int g0/0/0
ip ad 10.1.12.1 24
int loo0
ip ad 11.1.1.1 32
int loo1
ip ad 192.168.10.1 24
q
isis
network-entity 49.0001.0110.0100.1001.00
cost-style wide
is-name R1
q
int g0/0/0
isis enable 1
int loo0
isis enable 1
q
//配置MPLS、MPLS LDP
mpls lsr-id 11.1.1.1
mpls
q
mpls ldp
q
//接口使能
int g0/0/0
mpls
mpls ldp
q
//查看tunnel id
dis FIB
//触发LSP的策略
ip ip-prefix LDP permit 192.168.10.0 24
ip ip-prefix LDP permit 192.168.20.0 24
mpls
lsp-trigger ip-prefix LDP
q
//查看会话
dis mpls ldp session
//查看标签
dis mpls lsp
//tunnel id全为0查看路由表,tunnel id 不为0查看FIB表
//ping lsp +ip能直接 通信 ,说明走的是lsp
//tracert lsp + ip 查看走的路径
R2
un ter mon
sys
un in en
sysn R2
int g0/0/0
ip ad 10.1.12.2 24
int loo0
int g0/0/1
ip ad 10.1.23.2 24
int loo0
ip ad 22.1.1.1 32
q
isis
network-entity 49.0001.0220.0100.1001.00
cost-style wide
is-name R2
q
int g0/0/0
isis enable 1
int g0/0/1
isis enable 1
int loo0
isis enable 1
q
//配置MPLS、MPLS LDP
mpls lsr-id 22.1.1.1
mpls
q
mpls ldp
q
//接口使能
int g0/0/0
mpls
mpls ldp
int g0/0/1
mpls
mpls ldp
q
//查看会话
dis mpls ldp session
//查看标签
dis mpls lsp
//
dis mpls lsp in-label 1027//(根据自己查看到的标签值也查看)
//查看下一跳转发表项
dis mpls lsp
R3
un ter mon
sys
un in en
sysn R3
int g0/0/0
ip ad 10.1.23.3 24
int g0/0/1
ip ad 10.1.34.3 24
int loo0
ip ad 33.1.1.1 32
q
isis
network-entity 49.0001.0330.0100.1001.00
cost-style wide
is-name R3
q
int g0/0/0
isis enable 1
int g0/0/1
isis enable 1
int loo0
isis enable 1
q
//配置MPLS、MPLS LDP
mpls lsr-id 33.1.1.1
mpls
q
mpls ldp
q
//接口使能
int g0/0/0
mpls
mpls ldp
int g0/0/1
mpls
mpls ldp
q
//查看会话
dis mpls ldp session
//查看标签
dis mpls lsp
R4
un ter mon
sys
un in en
sysn R4
int g0/0/0
ip ad 10.1.34.4 24
int loo0
ip ad 44.1.1.1 32
int loo1
ip ad 192.168.20.1 24
q
isis
network-entity 49.0001.0440.0100.1001.00
cost-style wide
is-name R4
q
int g0/0/0
isis enable 1
int loo0
isis enable 1
int loo1
isis enable 1
q
//配置MPLS、MPLS LDP
mpls lsr-id 44.1.1.1
mpls
q
mpls ldp
q
//接口使能
int g0/0/0
mpls
mpls ldp
q
//触发LSP的策略,起始点终止点都要触发一次
ip ip-prefix LDP permit 192.168.20.0 24
ip ip-prefix LDP permit 192.168.10.0 24
mpls
lsp-trigger ip-prefix LDP
q
//查看会话
dis mpls ldp session
//查看标签
dis mpls lsp
标签:R4,isis,GigabitEthernet0,int,ip,mpls,ldp,实验
From: https://blog.csdn.net/m0_62452465/article/details/141090736