OSPF 单域 配置
1.实验拓扑OSPF 单域 配置_网络
 
2实验目的:2.1 按照拓扑正确连接3台路由器
          2.2  按要求完成各接口的 IP 地址
          2.3 完成OSPF单域路由协议的配置,并验证,完成OSPF计数器的配置
3.配置操作步骤:
Step 1. 配置路由器A BC 相应接口的 IP 地址   
路由器A配置如下:
Router>
Router>en
Router#conf t
Router(config)#HO A
A(config)#int f0/0
A(config-if)#ip add 192.168.1.1 255.255.255.0
A(config-if)#no shut
A(config-if)#exit
A(config)#int lo0
A(config-if)#ip add 192.168.31.11 255.255.255.255
A(config-if)#no shut
A(config-if)#exit
路由器B配置如下:
Router(config)#HO B
B(config)#int f0/0
B(config-if)#ip add 192.168.1.2 255.255.255.0
B(config-if)#no shut
B(config-if)#exit
B(config)#int lo0
B(config-if)#ip add 192.168.31.22 255.255.255.255
B(config-if)#no shut
B(config-if)#exit
 
路由器C配置如下:
Router>
Router>en
Router#conf t
Router(config)#ho C
C(config)#int f0/0
C(config-if)#ip add 192.168.1.3 255.255.255.0
C(config-if)#no shut
C(config-if)#exit
C(config)#int lo0
C(config-if)#ip add 192.168.31.33 255.255.255.255
C(config-if)#no shut
C(config-if)#exit
交换机SW配置如下:
Router#conf t
Router(config)#ho SW
SW(config)#int range f0/0 - 15
SW(config-if-range)#no shut
SW(config-if-range)#exit
SW(config)#
Setp 2. 配置OSPF
 
路由器A配置如下:
A(config)#router ospf 6
A(config-router)#net 192.168.1.0 0.0.0.255 area 0
A(config-router)#net 192.168.31.11 0.0.0.0 area 0
A(config-router)#exit
A(config)#
 
路由器C配置如下:
C(config)#router ospf 8
C(config-router)#net 192.168.1.0 0.0.0.255 area 0
C(config-router)#net 192.168.31.33 0.0.0.0 area 0
C(config-router)#exit
C(config)#
路由器B配置如下:
B(config)#router ospf 7
B(config-router)#net 192.168.1.0 0.0.0.255 area 0
B(config-router)#net 192.168.31.22 0.0.0.0 area 0
B(config-router)#exit
 
查看路由器A的路由表
A#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     192.168.31.0/32 is subnetted, 3 subnets
O       192.168.31.33 [110/2] via 192.168.1.3, 00:00:23, FastEthernet0/0
O       192.168.31.22 [110/2] via 192.168.1.2, 00:00:23, FastEthernet0/0
C       192.168.31.11 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
A#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.1/24, Area 0
  Process ID 6, Router ID 192.168.31.11, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 192.168.31.22, Interface address 192.168.1.2
  Backup Designated router (ID) 192.168.31.33, Interface address 192.168.1.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.22  (Designated Router)
    Adjacent with neighbor 192.168.31.33  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
查看邻接关系表
A#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.31.22     1   FULL/DR         00:00:33    192.168.1.2     FastEthernet0/
0
192.168.31.33     1   FULL/BDR        00:00:31    192.168.1.3     FastEthernet0/
0
查看链路状态数据库
A#show ip ospf database
 
            OSPF Router with ID (192.168.31.11) (Process ID 6)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.31.11   192.168.31.11   245         0x80000003 0x00ECA0 2
192.168.31.22   192.168.31.22   316         0x80000003 0x00C4A6 2
192.168.31.33   192.168.31.33   199         0x80000003 0x009CAC 2
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.2     192.168.31.22   504         0x80000002 0x0084C9
查看路由器B的路由表
B#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     192.168.31.0/32 is subnetted, 3 subnets
O       192.168.31.33 [110/2] via 192.168.1.3, 00:00:29, FastEthernet0/0
C       192.168.31.22 is directly connected, Loopback0
O       192.168.31.11 [110/2] via 192.168.1.1, 00:00:29, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
查看接口F0/0的接口数据结构:
B#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.2/24, Area 0
  Process ID 7, Router ID 192.168.31.22, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.31.22, Interface address 192.168.1.2
  Backup Designated router (ID) 192.168.31.33, Interface address 192.168.1.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:08
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.11
    Adjacent with neighbor 192.168.31.33  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
查看链路状态数据库
B#show ip ospf database
 
            OSPF Router with ID (192.168.31.22) (Process ID 7)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.31.11   192.168.31.11   259         0x80000003 0x00ECA0 2
192.168.31.22   192.168.31.22   328         0x80000003 0x00C4A6 2
192.168.31.33   192.168.31.33   212         0x80000003 0x009CAC 2
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.2     192.168.31.22   516         0x80000002 0x0084C9
 
查看路由器C的路由表
C#show ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     192.168.31.0/32 is subnetted, 3 subnets
C       192.168.31.33 is directly connected, Loopback0
O       192.168.31.22 [110/2] via 192.168.1.2, 00:00:17, FastEthernet0/0
O       192.168.31.11 [110/2] via 192.168.1.1, 00:00:17, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
查看接口F0/0的接口数据结构:
C#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.3/24, Area 0
  Process ID 8, Router ID 192.168.31.33, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 192.168.31.22, Interface address 192.168.1.2
  Backup Designated router (ID) 192.168.31.33, Interface address 192.168.1.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:06
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.11
    Adjacent with neighbor 192.168.31.22  (Designated Router)
  Suppress hello for 0 neighbor(s)
查看链路状态数据库
C#show ip ospf database
 
            OSPF Router with ID (192.168.31.33) (Process ID 8)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.31.11   192.168.31.11   277         0x80000003 0x00ECA0 2
192.168.31.22   192.168.31.22   347         0x80000003 0x00C4A6 2
192.168.31.33   192.168.31.33   229         0x80000003 0x009CAC 2
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.2     192.168.31.22   535         0x80000002 0x0084C9
 
Step 3. 更新计数器
路由器A配置如下:
A(config)#int f0/0
A(config-if)#ip ospf hello-interval 5
A(config-if)#ip ospf dead-interval 20
A(config-if)#end
路由器B配置如下:
B#conf t
B(config)#int f0/0
B(config-if)#ip ospf hello-interval 5
B(config-if)#ip ospf dead-interval 20
B(config-if)#end
 
路由器C配置如下:
C#config t
C(config)#int f0/0
C(config-if)#ip ospf hello-interval 5
C(config-if)#ip ospf dead-interval 20
C(config-if)#end
 
查看接口F0/0的接口数据结构:
A#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.1/24, Area 0
  Process ID 6, Router ID 192.168.31.11, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 192.168.31.33, Interface address 192.168.1.3
  Backup Designated router (ID) 192.168.31.22, Interface address 192.168.1.2
  Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:01
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.22  (Backup Designated Router)
    Adjacent with neighbor 192.168.31.33  (Designated Router)
  Suppress hello for 0 neighbor(s)
 
查看接口F0/0的接口数据结构:
B#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.2/24, Area 0
  Process ID 7, Router ID 192.168.31.22, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 192.168.31.33, Interface address 192.168.1.3
  Backup Designated router (ID) 192.168.31.22, Interface address 192.168.1.2
  Flush timer for old DR LSA due in 00:02:02
  Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:01
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 4 msec, maximum is 4 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.11
    Adjacent with neighbor 192.168.31.33  (Designated Router)
  Suppress hello for 0 neighbor(s)
 
查看接口F0/0的接口数据结构:
C#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.3/24, Area 0
  Process ID 8, Router ID 192.168.31.33, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.31.33, Interface address 192.168.1.3
  Backup Designated router (ID) 192.168.31.22, Interface address 192.168.1.2
  Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 192.168.31.11
    Adjacent with neighbor 192.168.31.22  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)