第7章单区域OSPF配置
第7章 单区域OSPF配置
7.1单区域OSPF配置 7.1.1单区域OSPF配置 单区域OSPF的配置分为两个步骤 >启动OSPF路由器协议进程 Router(config)router ospf Process-ID >声明运行OSPF协议的路由器接口IP地址或子网地址 o Router(config-router)#network A.B.C. D A.B.C.D area area-id
7.1 单区域OSPF配置 7.1.1 单区域OSPF配置 单区域OSPF的配置分为两个步骤: 启动OSPF路由器协议进程。 Router(config)#router ospf Process-ID 声明运行OSPF协议的路由器接口IP地址或子网地址。 Router(config-router)#network A.B.C.D A.B.C.D area area-id
7,2点到点链路○SP「配置 7.2.1点到点链路OSPF配置 Lo0:10.0.0.1/32 Lol:1.1.1.1/24 Router A S0/0:192.168.1.1/24 S0/1:192.168.2.124 OSPF Process 2 Area 1 S0/0:192.168.12/24 S0/0:192.168.2.2/24 S0/1:192.168.3.1/24 SO/1:192.16832/24 Router B Router c Lo0:20.0.0.1/32 Lol:222.2/24 Lo0:30.0.0.1/32 Lo1:3.333/24 图7-2-1点到点链路OSP配置
7.2 点到点链路OSPF配置 7.2.1 点到点链路OSPF配置 图7-2-1 点到点链路OSPF配置 Router B Router C Router A Lo0:20.0.0.1/32 S0/1:192.168.2.1/24 Lo1:2.2.2.2/24 Lo0:30.0.0.1/32 Lo1:3.3.3.3/24 Lo0:10.0.0.1/32 Lo1:1.1.1.1/24 S0/0:192.168.1.1/24 S0/0:192.168.1.2/24 S0/1:192.168.3.1/24 S0/1:192.168.3.2/24 S0/0:192.168.2.2/24 Area 1 OSPF Process 2
>以下是路由器A的配置命令 RouterA(config)router ospf 2 RouterA(config-router)network 1. 1.1.00.0.0.255 area 1 o RouterA(config-router )#network 192.168.1.1 0.0.0.0 area 1 o RouterAconfig-router )#network 192.168.2.1 0.0.0.0 area 以下是路由器B的配置命令: Router B(config)router ospf 2 o Router B(config-router )network 2.2.2.0 0.0.0.255 area 1 RouterB(config-router)#network 192. 168. 0.0.0.0 area 1 RouterB(config-router)#network 192 168.3. 1 0.0.0.0 area 1 >以下是路由器C的配置命令: RouterC(config)router ospf 2 RouterC(config-router)#network 3.3. 0.0.0.255 area 1 o RouterC(config-router )#network 192. 168.2.20.0.0.0 area 1 RouterC(config-router)#network 192. 0.0.0.0 area 1
以下是路由器A的配置命令: RouterA(config)#router ospf 2 RouterA(config-router)#network 1.1.1.0 0.0.0.255 area 1 RouterA(config-router)#network 192.168.1.1 0.0.0.0 area 1 RouterA(config-router)#network 192.168.2.1 0.0.0.0 area 1 以下是路由器B的配置命令: RouterB(config)#router ospf 2 RouterB(config-router)#network 2.2.2.0 0.0.0.255 area 1 RouterB(config-router)#network 192.168.1.2 0.0.0.0 area 1 RouterB(config-router)#network 192.168.3.1 0.0.0.0 area 1 以下是路由器C的配置命令: RouterC(config)#router ospf 2 RouterC(config-router)#network 3.3.3.0 0.0.0.255 area 1 RouterC(config-router)#network 192.168.2.2 0.0.0.0 area 1 RouterC(config-router)#network 192.168.3.2 0.0.0.0 area 1
7,2.2点到点链路OSPF诊断 1. log-adjacency-Changes RouterA(config-router)# log-adjacency-changes 00: 03: 13: %OSPF-5-ADJCHG: Process 2, Nbr 10.0.0. 1 on Serial0/0 from FULL to DOWN. 2. Neighbor Down: Inter face down or detached 3. 00: 03: 14: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down 4. 00 03: 14: LINK-3-UPDOWN. Interface Serial0/1. changed state to down 5. RouterC# 6.100: 03: 14: %OSPF-5-ADJCHG: Process 2, Nbr 20.0.0. 1 on Serial0/1 from FULL to DOWN, 7. Neighbor Down: Interface down or detached 8.00: 03: 15: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down 图7-2-2命令 log-adjacency-changes的输出
7.2.2 点到点链路OSPF诊断 1.log-adjacency-changes RouterA(config-router)#log-adjacency-changes 图7-2-2 命令log-adjacency-changes的输出 00:03:13: %OSPF-5-ADJCHG: Process 2, Nbr 10.0.0.1 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached 00:03:14: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down 00:03:14: %LINK-3-UPDOWN: Interface Serial0/1, changed state to down RouterC# 00:03:14: %OSPF-5-ADJCHG: Process 2, Nbr 20.0.0.1 on Serial0/1 from FULL to DOWN, Neighbor Down: Interface down or detached 00:03:15: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down 1. 2. 3. 4. 5. 6. 7. 8
1. 00: 05: 49: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up 2. 00: 05: 50:%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up 3. 00: 05: 50: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up 4. 00: 05: 51: %LINEPROTO-5-UPDOWN: Line protocol on Interface SerialO/1, changed state to up 5. 00: 05: 59: %0SPF-5-ADJCHG: Process 2, Nbr 10.0.0. 1 on Serial0/0 from LOADING to FULL, Loading Done 6.100: 06: 00: %0SPF-5-ADJCHG: Process 2. Nbr 20.0.0. 1 on Serial0/1 from LOADING to FULL Loading Done 图7-2-3命令 log-adjacency-changes的输出
图7-2-3 命令log-adjacency-changes的输出 00:05:49: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up 00:05:50: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up 00:05:50: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up 00:05:51: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up 00:05:59: %OSPF-5-ADJCHG: Process 2, Nbr 10.0.0.1 on Serial0/0 from LOADING to FULL, Loading Done 00:06:00: %OSPF-5-ADJCHG: Process 2, Nbr 20.0.0.1 on Serial0/1 from LOADING to FULL, Loading Done 1. 2. 3. 4. 5. 6
OSPF相关诊断命令 2. show ip protocol 3. show ip route 4. show ip ospf neighbor 5. show ip ospf neighbor detail 6. show ip ospf database 7. show ip ospf interface
OSPF相关诊断命令 2.show ip protocol 3.show ip route 4.show ip ospf neighbor 5.show ip ospf neighbor detail 6.show ip ospf database 7.show ip ospf interface
OSPF相关诊断命令(续) 8. show ip ospf flood-list 9. show ip ospf process-id 10. debug ip ospf hello 11. debug ip ospf ad 12. debug ip ospf events 13. debug ip ospf flood 14. debug ip ospf packet 15. debug ip ospf SI
OSPF相关诊断命令(续) 8.show ip ospf flood-list 9.show ip ospf process-id 10.debug ip ospf hello 11.debug ip ospf adj 12.debug ip ospf events 13.debug ip ospf flood 14.debug ip ospf packet 15.debug ip ospf spf
7.3广播厕络OSPF配置 7.3.1广播网络OSPF配置 图7-3-1广播网络OSPF配置
7.3 广播网络OSPF配置 7.3.1 广播网络OSPF配置 图7-3-1 广播网络OSPF配置
>以下是路由器A的配置命令 RouterA(config)router ospf 1 RouterA(config-router)#network 1.0.0.0 0.255.255.255 area RouterA(config-router)#network 192.168.1.1 0.0.0.0 area 1 >以下是路由器B的配置命令 Router B(config)router ospf 1 Router B(config-router )#network 2.0.0.0 0. 255.255.255 area Router B(config-router)#network 192. 168. 0.0.0.0 area 1 >以下是路由器C的配置命令 RouterC(config)router ospf 1 RouterC(config-router)#network 3.0.0.00.255.255.255 area RouterC(config-router)#network 192. 168. 1.3 0.0.0.0 area 1
以下是路由器A的配置命令: RouterA(config)#router ospf 1 RouterA(config-router)#network 1.0.0.0 0.255.255.255 area 1 RouterA(config-router)#network 192.168.1.1 0.0.0.0 area 1 以下是路由器B的配置命令: RouterB(config)#router ospf 1 RouterB(config-router)#network 2.0.0.0 0.255.255.255 area 1 RouterB(config-router)#network 192.168.1.2 0.0.0.0 area 1 以下是路由器C的配置命令: RouterC(config)#router ospf 1 RouterC(config-router)#network 3.0.0.0 0.255.255.255 area 1 RouterC(config-router)#network 192.168.1.3 0.0.0.0 area 1