1.配置IP地址
[LSR1]vlan batch 10
[LSR1-GigabitEthernet0/0/2]port link-type trunk
[LSR1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[LSR1-Vlanif10]ip add 10.1.1.1 24
[LSR1-LoopBack0]ip add 1.1.1.1 32
[LSR2]vlan batch 10 20
[LSR2-GigabitEthernet0/0/1]port link-type trunk
[LSR2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSR2-GigabitEthernet0/0/3]port link-type trunk
[LSR2-GigabitEthernet0/0/3]port trunk allow-pass vlan 20
[LSR2-Vlanif10]ip add 10.1.1.2 24
[LSR2-Vlanif20]ip add 10.1.2.2 24
[LSR2-LoopBack0]ip add 2.2.2.2 32
[LSR3]vlan batch 20
[LSR3-GigabitEthernet0/0/2]port link-type trunk
[LSR3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[LSR3-Vlanif20]ip add 10.1.2.3 24
[LSR3-LoopBack0]ip add 3.3.3.3 32
2. 配置OSPF协议发布各节点接口所连网段和LSR ID的主机路由
[LSR1]ospf 1
[LSR1-ospf-1]area 0
[LSR1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSR1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[LSR2]ospf 1
[LSR2-ospf-1]area 0
[LSR2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSR2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[LSR3]ospf 1
[LSR3-ospf-1]area 0
[LSR3-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
3. 在各LSR上使能全局MPLS和MPLS LDP
[LSR1]mpls lsr-id 1.1.1.1
[LSR1]mpls
[LSR1]mpls ldp
[LSR2]mpls lsr-id 2.2.2.2
[LSR2]mpls
[LSR2]mpls ldp
[LSR3]mpls lsr-id 3.3.3.3
[LSR3]mpls
[LSR3]mpls ldp
4. 在各LSR的接口上使能MPLS和MPLS LDP
[LSR1-Vlanif10]mpls
[LSR1-Vlanif10]mpls ldp
[LSR2-Vlanif10]mpls
[LSR2-Vlanif10]mpls ldp
[LSR2-Vlanif20]mpls
[LSR2-Vlanif20]mpls ldp
[LSR3-Vlanif20]mpls
[LSR3-Vlanif20]mpls ldp
5. 检查配置
华为设备配置本地LDP会话
最新推荐文章于 2024-07-02 16:21:43 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)