OSPF主要配置方式
ospf 100?router-id 1.1.1.1? ? ? ? ? ? ?//100为区域号,router-id用于唯一标识路由器
area 0? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//创建区域 0
network 192.168.1.0 0.0.0.255?? ??//添加相邻的网段
network 192.168.2.0 0.0.0.255? ? ?//添加相邻的网段
?MSR36-20_1路由器配置
int g0/1
ip add 192.168.1.2 24
int g0/0
ip add 192.168.2.1 24
quit
ospf 100 router-id 3.3.3.3
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
?MSR36-20_2路由器配置
int g0/0
ip add 192.168.2.2 24
int g0/2
ip add 192.168.3.1 24
quit
ospf 100 router-id 2.2.2.2
area 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
?MSR36-20_3路由器配置
int g0/1
ip add 192.168.4.1 24
int g0/2
ip add 192.168.3.2 24
quit
ospf 100 router-id 1.1.1.1
area 0.0.0.0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
连通性测试
PC_4 PING PC_5
查看OSPF的LSDB数据库
dis ospf lsdb
查询路由表
ip routing-table