ospf是典型的链路状态路由协议,使用最短路径算法计算与选择路由。一般中大型企业使用ospf动态路由协议。
ospf协议的有点:无环路、收敛速度快、扩展型好、支持认证。ospf报文封装在IP报文中,协议号是89。
ensp仿真平台搭建:
1、项目功能需求:配置ospf动态路由协议,实现全网互通。把所有的路由划分到区域,若是单区域,采用area0。
拓扑如下:
2、路由接口ip配置如下:
①、AR1配置如下
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname AR1
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 192.168.10.1 24
[AR1-GigabitEthernet0/0/0]quit
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 10.1.10.254 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]interface GigabitEthernet 0/0/2
[AR1-GigabitEthernet0/0/2]ip address 192.168.30.1 24
[AR1-GigabitEthernet0/0/2]quit
[AR1]quit
<AR1>save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
It will take several minutes to save configuration file, please wait.......
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated
<AR1>
②、AR2配置如下
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname AR2
[AR2]inter
[AR2]interface G
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 192.168.10.2 24
[AR2-GigabitEthernet0/0/0]quit
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 192.168.20.2 24
[AR2-GigabitEthernet0/0/1]quit
[AR2]interface GigabitEthernet 0/0/2
[AR2-GigabitEthernet0/0/2]ip add 60.222.227.130 24
[AR2-GigabitEthernet0/0/2]quit
[AR2]quit