华为设备配置OSPF的NSSA区域_华为

1. 配置各接口所属的VLAN

[LSW1]vlan batch 13 14

[LSW1-GigabitEthernet0/0/3]port link-type trunk  

[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 13

[LSW1-GigabitEthernet0/0/4]port link-type trunk  

[LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 14

[LSW2]vlan batch 23 24

[LSW2-GigabitEthernet0/0/3]port link-type trunk  

[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 23

[LSW2-GigabitEthernet0/0/4]port link-type trunk  

[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 24

[LSW3]vlan batch 13 23

[LSW3-GigabitEthernet0/0/1]port link-type trunk  

[LSW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 13

[LSW3-GigabitEthernet0/0/2]port link-type trunk  

[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 23

[LSW4]vlan batch 14 24

[LSW4-GigabitEthernet0/0/1]port link-type trunk  

[LSW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 14

[LSW4-GigabitEthernet0/0/2]port link-type trunk  

[LSW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 24

2. 配置各接口的IP地址

[LSW1-Vlanif13]ip add 10.1.13.1 24

[LSW1-Vlanif14]ip add 10.1.14.1 24

[LSW2-Vlanif23]ip add 10.1.23.2 24

[LSW2-Vlanif24]ip add 10.1.24.2 24

[LSW3-Vlanif13]ip add 10.1.13.3 24

[LSW3-Vlanif23]ip add 10.1.23.3 24

[LSW4-Vlanif14]ip add 10.1.14.4 24

[LSW4-Vlanif24]ip add 10.1.24.4 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

[LSW4]int LoopBack 0

[LSW4-LoopBack0]ip add 10.4.4.4 32

3. 配置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.13.0 0.0.0.255

[LSW1-ospf-1]area 10

[LSW1-ospf-1-area-0.0.0.10]network 10.1.14.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.23.0 0.0.0.255

[LSW2-ospf-1]area 10                      

[LSW2-ospf-1-area-0.0.0.10]network 10.1.24.0 0.0.0.255

[LSW3]ospf 1 router-id 10.3.3.3

[LSW3-ospf-1]area 0

[LSW3-ospf-1-area-0.0.0.0]network 10.1.13.0 0.0.0.255

[LSW3-ospf-1-area-0.0.0.0]network 10.1.23.0 0.0.0.255

[LSW4]ospf 1 router-id 10.4.4.4

[LSW4-ospf-1]area 10

[LSW4-ospf-1-area-0.0.0.10]network 10.1.14.0 0.0.0.255

[LSW4-ospf-1-area-0.0.0.10]network 10.1.24.0 0.0.0.255

4. 配置Area10区域为NSSA区域

[LSW1]ospf 1

[LSW1-ospf-1]area 10

[LSW2]ospf 1

[LSW2-ospf-1]area 10

[LSW2-ospf-1-area-0.0.0.10]nssa

[LSW4]ospf 1

[LSW4-ospf-1]area 10

[LSW4-ospf-1-area-0.0.0.10]nssa

5. 配置LSW4引入静态路由

[LSW4]ip route-static 10.1.0.0 16 NULL 0

[LSW4]ospf 1

[LSW4-ospf-1]import-route static

华为设备配置OSPF的NSSA区域_NSSA_02

     可以看出NSSA区域引入的AS外部路由是通过LSW1向其他区域发布的,即LSW1将Type7 LSA转换成了Type5 LSA  

6. 配置LSW2为转换路由器

[LSW2]ospf 1

[LSW2-ospf-1]area 10

[LSW2-ospf-1-area-0.0.0.10]nssa translator-always

7. 验证配置

华为设备配置OSPF的NSSA区域_华为_03

     可以看出NSSA区域引入的AS外部路由是通过LSW2向其他区域发布的,即LSW2成了转换路由器