7.2配置OSPF
TCP/IP 7.2配置OSPF_第1张图片
配置和net文件在附件中
Rubens(config-if)#router ospf 1
Rubens(config-router)#net 0.0.0.0 255.255.255.255 a 1
 
Chardin(config-if)#router ospf 1
Chardin(config-router)#net 192.168.20.0 0.0.0.255 a 0
Chardin(config-router)#net 192.168.30.0 0.0.0.255 a 1
 
Goya(config-if)#router ospf 1
Goya(config-router)#net 192.168.20.0 0.0.0.3 a 0.0.0.0
Goya(config-router)#net 192.168.10.0 0.0.0.31 a 192.168.10.0
 
Matisse(config-if)#router ospf 1
Matisse(config-router)#net 0.0.0.0 255.255.255.255 a 192.168.10.0
 
 
使用loopback接口设置路由器的ID
注意:如果找不到一个有效的IP地址作为他的路由器IDOSPF将不会启动。
这个在这种情况下会发生,刷OSPF配置,如果接口没有起 ospf命令刷不上去了。这个地方要注意在刷配置的时候。
这边就会发现loopback的接口始终是up
控制路由器ID使单个OSPF路由器更加容易识别。
配置的时候:只要主机掩码保持一种整齐的格式
还有一种方法就是手动指定OSPF的路由器ID
Router-id
 
 
Rubens(config)#int lo0      
Rubens(config-if)#ip add 192.168.50.1 255.255.255.255
Rubens(config-if)#router ospf 1
Rubens(config-router)#net 192.168.30.0 0.0.0.255 a 1
 
 
Chardin(config)#int lo0
Chardin(config-if)#ip add 192.168.50.2 255.255.255.255
Chardin(config-if)#router ospf 20
Chardin(config-router)#net 192.168.30.0 0.0.0.255 a 1
Chardin(config-router)#net 192.168.20.0 0.0.0.255 a 0
 
 
Goya(config)#int lo0
Goya(config-if)#ip add 192.168.50.3 255.255.255.255
Goya(config-if)#router ospf 1
Goya(config-router)#net 192.168.20.0 0.0.0.3 a 0.0.0.0
Goya(config-router)#net 192.168.10.0 0.0.0.31 a 192.168.10.0
 
 
Matisse(config)#int lo1
Matisse(config-if)#ip add 192.168.50.4 255.255.255.255
Matisse(config-if)#router ospf 1
Matisse(config-router)#net 192.168.10.2 0.0.0.0 a 192.168.10.0 
 
Rubens#sh ip ospf
 Routing Process "ospf 1" with ID 192.168.50.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 External flood list length 0
    Area 1
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm last executed 00:12:26.888 ago
        SPF algorithm executed 3 times
        Area ranges are
        Number of LSA 4. Checksum Sum 0x021200
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0