-
配置各接口所属的VLAN
[LSW1]vlan 10
[LSW1-GigabitEthernet0/0/2]port link-type trunk
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[LSW2]vlan batch 10 20
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 20
[LSW3]vlan 20
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20 -
配置各接口的IP地址
[LSW1-Vlanif10]ip add 10.1.0.1 24
[LSW2-Vlanif10]ip add 10.1.0.2 24
[LSW2-Vlanif20]ip add 10.1.1.2 24
[LSW3-Vlanif20]ip add 10.1.1.3 24
[LSW1]int LoopBack 0
[LSW1-LoopBack0]ip add 10.1.1.1 32
[LSW2]int LoopBack 0
[LSW2-LoopBack0]ip add 10.2.2.2 32
[LSW3]int LoopBack 0
[LSW3-LoopBack0]ip add 10.3.3.3 32 -
配置OSPF基本功能
[LSW1]ospf 1 router-id 10.1.1.1
[LSW1-ospf-1]area 0
[LSW1-ospf-1-area-0.0.0.0]network 10.1.0.0 0.0.0.255
[LSW2]ospf 1 router-id 10.2.2.2
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.0.0 0.0.0.255
[LSW2-ospf-1]area 1
[LSW2-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[LSW3]ospf 1 router-id 10.3.3.3
[LSW3-ospf-1]area 1
[LSW3-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255 -
配置LSW1引入静态路由
[LSW1]ip route-static 10.0.0.0 8 NULL 0
[LSW1]ospf 1
[LSW1-ospf-1]import-route static type 1
-
配置Area1为Stub区域
[LSW2]ospf 1
[LSW2-ospf-1]area 1
[LSW2-ospf-1-area-0.0.0.1]stub
[LSW3]ospf 1
[LSW3-ospf-1]area 1
[LSW3-ospf-1-area-0.0.0.1]stub
-
配置Area1为Totally Stub区域
[LSW2]ospf 1
[LSW2-ospf-1]area 1
[LSW2-ospf-1-area-0.0.0.1]stub no-summary -
验证配置
华为设备配置OSPF的Stub区域
最新推荐文章于 2023-11-14 14:45:44 发布