华为ospf、静态路由综合网络实验配置

华为ospf、静态路由综合网络实验配置_第1张图片需求:黄色区域为ospf区域0,绿色区域为静态路由,不允许写缺省路由

配置如下:

dis cu 
#
 sysname AR1
#
interface GigabitEthernet0/0/0
 ip address 10.0.12.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.41.254 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 10.0.13.1 255.255.255.0 
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 1.1.1.1 0.0.0.0 
  network 10.0.12.0 0.0.0.255 
  network 10.0.13.0 0.0.0.255 
  network 192.168.41.0 0.0.0.255 

dis cu 
#
 sysname AR2
#
interface GigabitEthernet0/0/0
 ip address 10.0.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.23.2 255.255.255.0 
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255 
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.0.12.0 0.0.0.255 
  network 10.0.23.0 0.0.0.255 

dis cu 
#
 sysname AR3
#
interface GigabitEthernet0/0/0
 ip address 10.0.34.3 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.23.3 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 10.0.13.3 255.255.255.0 
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
#
ospf 1 router-id 3.3.3.3 
 import-route static
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 10.0.13.0 0.0.0.255 
  network 10.0.23.0 0.0.0.255 
  network 10.0.34.0 0.0.0.255 
#
ip route-static 10.0.45.0 255.255.255.0 10.0.34.4
ip route-static 10.0.56.0 255.255.255.0 10.0.34.4
ip route-static 192.168.42.0 255.255.255.0 10.0.34.4

dis cu 
#
 sysname AR4
#
interface GigabitEthernet0/0/0
 ip address 10.0.34.4 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.45.4 255.255.255.0 
#
ip route-static 10.0.12.0 255.255.255.0 10.0.34.3
ip route-static 10.0.13.0 255.255.255.0 10.0.34.3
ip route-static 10.0.23.0 255.255.255.0 10.0.34.3
ip route-static 10.0.56.0 255.255.255.0 10.0.45.5
ip route-static 192.168.41.0 255.255.255.0 10.0.34.3
ip route-static 192.168.42.0 255.255.255.0 10.0.45.5

dis cu 
#
 sysname AR5
#
interface GigabitEthernet0/0/0
 ip address 10.0.56.5 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.45.5 255.255.255.0 
#
ip route-static 10.0.12.0 255.255.255.0 10.0.45.4
ip route-static 10.0.13.0 255.255.255.0 10.0.45.4
ip route-static 10.0.23.0 255.255.255.0 10.0.45.4
ip route-static 10.0.34.0 255.255.255.0 10.0.45.4
ip route-static 192.168.41.0 255.255.255.0 10.0.45.4
ip route-static 192.168.42.0 255.255.255.0 10.0.56.6

dis cu 
#
 sysname AR6
#
interface GigabitEthernet0/0/0
 ip address 10.0.56.6 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.42.254 255.255.255.0 
#
ip route-static 10.0.12.0 255.255.255.0 10.0.56.5
ip route-static 10.0.13.0 255.255.255.0 10.0.56.5
ip route-static 10.0.23.0 255.255.255.0 10.0.56.5
ip route-static 10.0.34.0 255.255.255.0 10.0.56.5
ip route-static 10.0.45.0 255.255.255.0 10.0.56.5
ip route-static 192.168.41.0 255.255.255.0 10.0.56.5

华为ospf、静态路由综合网络实验配置_第2张图片

你可能感兴趣的:(eNSP基础实验系列,网络,华为,网络协议,ip,ospf,静态路由,路由引入)