实验拓扑
Jan16 公司有北京总部、广州分部和上海分部 3 个办公地点,各分部与总部之间使用路由器互联。公司要求通过配置单区域 OSPF 动态路由,实现公司之间能够互相访问。
1.基本配置
1.1基础配置
北京总部使用 192.168.1.0 网段,上海分部使用 172.16.1.0 网段,广州分部使用10.10.10.0 网段,R1 与 R2 之间为 20.20.20.0 网段,R1 与R3 之间为 30.30.30.0 网段,R2与 R3 之间为 40.40.40.0 网段,所有网段均使用 24 位子网掩码。路由器需配置单区域 OSPF 动态路由,使所有计算机均能互访。 配置步骤如下:
1.2配置路由器接口
R1 的配置
system-view
sysname R1
interface GigabitEthernet 0/0/0
ip address 192.168.1.1 255.255.255.0
interface GigabitEthernet 0/0/1
ip address 20.20.20.1 255.255.255.0
interface GigabitEthernet 0/0/2
ip address 30.30.30.1 255.255.255.0
quit
R2 的配置
system-view
sysname R2
interface GigabitEthernet 0/0/0
ip address 172.16.1.2 255.255.255.0
interface GigabitEthernet 0/0/1
ip address 20.20.20.2 255.255.255.0
interface GigabitEthernet 0/0/2
ip address 40.40.40.2 255.255.255.0
quit
R3 的配置
system-view
sysname R3
interface GigabitEthernet 0/0/0
ip address 10.10.10.3 255.255.255.0
interface GigabitEthernet 0/0/1
ip address 40.40.40.3 255.255.255.0
interface GigabitEthernet 0/0/2
ip address 30.30.30.3 255.255.255.0
quit
1.3部署单区域 OSPF 网络
首先创建并运行 OSPF,接着创建区域并进入 OPSF 区域视图,指定运行 OSPF 协议的接口和接口所属的区域。
R1 的配置
ospf 1
area 0
network 192.168.1.0 0.0.0.255
network 20.20.20.0 0.0.0.255
network 30.30.30.0 0.0.0.255
R2 的配置
ospf 1
area 0
Network 172.16.1.0 0.0.0.255
network 20.20.20.0 0.0.0.255
network 40.40.40.0 0.0.0.255
R3 的配置
ospf 1
area 0
network 10.10.10.0 0.0.0.255
network 40.40.40.0 0.0.0.255
network 30.30.30.0 0.0.0.255
1.4配置各计算机的 IP 地址