R1的配置:
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#int loopback 0
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#int f0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router ospf 10
R1(config-router)#network 192.168.10.0 0.0.0.255 area 0
R1(config-router)#network 192.168.2.0 0.0.0.255 area 0
R1(config-router)#end
R1#write
R1#show ip protocols
R2的配置:
Router>en
Router#conf t
Router(config)#hostname R2
R2(config)#int f0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int f1/0
R2(config-if)#ip address 192.168.3.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int s3/0
R2(config-if)#ip address 192.168.4.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int s2/0
R2(config-if)#ip address 192.168.5.1 255.255.255.0
R2(config-if)#no shutdown
R2(config)#router ospf 10
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#network 192.168.3.0 0.0.0.255 area 0
R2(config-router)#network 192.168.4.0 0.0.0.255 area 0
R2(config-router)#network 192.168.5.0 0.0.0.255 area 0
R2(config-router)#end
R2#write
R2#show ip protocols
R3的配置:
Router>en
Router#conf t
Router(config)#hostname R3
R3(config)#int s2/0
R3(config-if)#ip address 192.168.5.2 255.255.255.0
R3(config-if)#clock rate 56000
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int loopback 0
R3(config-if)#ip address 192.168.40.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#
R3(config)#router ospf 10
R3(config-router)#network 192.168.5.0 0.0.0.255 area 0
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0
R3(config-router)#end
R3#write
R3#show ip protocols
R4的配置:
Router>en
Router#conf t
Router(config)#hostname R4
R4(config)#int f0/0
R4(config-if)#ip address 192.168.3.2 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#int loopback 0
R4(config-if)#ip address 192.168.20.1 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#
R4(config)#router ospf 10
R4(config-router)#network 192.168.3.0 0.0.0.255 area 0
R4(config-router)#network 192.168.20.0 0.0.0.255 area 0
R4(config-router)#end
R4#write
R4#show ip protocols
R5的配置:
Router>en
Router#conf t
Router(config)#hostname R5
R5(config)#int s2/0
R5(config-if)#ip address 192.168.4.2 255.255.255.0
R5(config-if)#clock rate 56000
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#int loopback 0
R5(config-if)#ip address 192.168.30.1 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#router ospf 10
R5(config-router)#network 192.168.4.0 0.0.0.255 area 0
R5(config-router)#network 192.168.30.0 0.0.0.255 area 0
R5(config-router)#end
R5#write
R5#show ip protocols