OSPF路由协议及单区域的配置
1.配置每个节点IP地址。
router2
enable
conf t
interface f0/0
no shutdown
ip address 192.168.10.1 255.255.255.0
interface f0/1
no shutdown
ip address 192.168.20.1 255.255.255.0
router3
enable
conf t
interface f0/0
no shutdown
ip address 192.168.20.2 255.255.255.0
interface f0/1
no shutdown
ip address 192.168.30.1 255.255.255.0
router4
enable
conf t
interface f0/0
no shutdown
ip address 192.168.30.2 255.255.255.0
interface f0/1
no shutdown
ip address 192.168.40.1 255.255.255.0
2.配置路由协议ospf
Router2
Router(config)#
Router(config)#router ospf 1
Router(config-router)#network 192.168.10.0 0.0.0.255 area 0
Router(config-router)#network 192.168.20.0 0.0.0.255 area 0
Router3
Router(config)#router ospf 1
Router(config-router)#network 192.168.20.0 0.0.0.255 area 0
Router(config-router)#network 192.168.30.0 0.0.0.255 area 0
Router4
Router(config)#router ospf 1
Router(config-router)#network 192.168.30.0 0.0.0.255 area 0
Router(config-router)#network 192.168.40.0 0.0.0.255
area 0