今天进行了OSPF的多区域组网试验,本来这是个很简单的操作,折腾了好长时间,根本原因只是看了别人写的配置代码,没有真正弄明白里面对应的规则。

  一般情况下,很多单位都使用OSPF进行多区域的组网,大体分为1个核心区域,多个下属单位为独立区域,它们与核心区域进行连接,这样很方便整个网络的管理和运维。

一、知识要点:

⑴基础知识

   ●OSPF(Open Shortest Path First)即开放式最短路径优先,在TCP/IP网络中,它是路由器和三层交换机用来确定数据包转发目的地、组建大型网络常用的路由协议之一。

   ●它的优点是可以快速响应网络的变化并进行负载均衡,不会出现环路问题。

   ●在大型网络中,为了解决因为路由器数量和链路状态信息的增加而引起路由器的负载过大,从而减慢了整个网络的速度,OSPF引入了“区域”的概念,即将整个网络进行区域划分并有效地运营和管理它。划分区域时,会创建一个称为Area 0的中心区域(主干),其他区域(Area 1、Area 2、Area 3等)始终与Area 0相连,连接区域 0 和其他区域的路由器称为区域边界路由器 (ABR)。

⑵查看OSPF的常用命令

   ●display ospf peer brief

    查看OSPF邻居点的概要信息

   ●dis ip routing-table protocol ospf

    查看OSPF的路由信息

   ●dis ip interface brief

    查看接口信息

   ●dis ospf routing

    查看相信的OSPF路由信息表

二、试验结构图:

ospf多区域优点 多区域的ospf协议配置实例_网络

  三、运行结果

ospf多区域优点 多区域的ospf协议配置实例_eNSP_02

  四、具体配置

  R1配置

[V200R003C00]
#
 sysname R1
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
 drop illegal-mac alarm
#
 undo info-center enable
#
 set cpu-usage threshold 80 restore 75
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 172.13.17.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.11.1 255.255.255.252 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.13.17.0 0.0.0.255 
  network 192.168.11.1 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

  R2配置

[V200R003C00]
#
 sysname R2
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
 drop illegal-mac alarm
#
 undo info-center enable
#
 wlan ac-global carrier id other ac id 0
#
 set cpu-usage threshold 80 restore 75
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface Ethernet0/0/0
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface GigabitEthernet0/0/0
 ip address 192.168.11.2 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 192.168.11.5 255.255.255.252 
#
interface NULL0
#
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 192.168.11.5 0.0.0.0 
 area 0.0.0.1 
  network 192.168.11.2 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

  R3配置

[V200R003C00]
#
 sysname R3
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
 drop illegal-mac alarm
#
 undo info-center enable
#
 wlan ac-global carrier id other ac id 0
#
 set cpu-usage threshold 80 restore 75
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface Ethernet0/0/0
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface GigabitEthernet0/0/0
 ip address 192.168.11.6 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 192.168.11.9 255.255.255.252 
#
interface NULL0
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 192.168.11.6 0.0.0.0 
  network 192.168.11.9 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

  R4配置

[V200R003C00]
#
 sysname R4
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
 drop illegal-mac alarm
#
 undo info-center enable
#
 wlan ac-global carrier id other ac id 0
#
 set cpu-usage threshold 80 restore 75
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface Ethernet0/0/0
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface GigabitEthernet0/0/0
 ip address 192.168.11.10 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 192.168.11.13 255.255.255.252 
#
interface NULL0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 
#
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 192.168.11.10 0.0.0.0 
 area 0.0.0.2 
  network 192.168.11.13 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

  R5配置

[V200R003C00]
#
 sysname R5
#
 snmp-agent local-engineid 800007DB03000000000000
 snmp-agent 
#
 clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load flash:/portalpage.zip
#
 drop illegal-mac alarm
#
 undo info-center enable
#
 wlan ac-global carrier id other ac id 0
#
 set cpu-usage threshold 80 restore 75
#
aaa 
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default 
 domain default_admin 
 local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
 local-user admin service-type http
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 192.168.11.14 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 172.16.19.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255 
#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.2 
  network 172.16.19.0 0.0.0.255 
  network 192.168.11.14 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

  这次试验算做OSPF的一个简单入门,因为没有结合其他的组网要求,具体单位的组网要求肯定各不相同,有很多的复杂性在里面,需要丰富的实战经验和扎实的基础理论。

  后面可以进行其他的网络试验,作为一名合格的网络工程师要学习的知识、要掌握的技能还很多,学习之路还很漫长。