網絡工程師交換試驗手冊之十四:NBMA網絡上OPSF實驗

實驗目的:
熟悉OSPF的基本配置,熟悉OSPF在NBMA網絡中的配置方法,理解NBMA網絡中配置OSPF協議與普通網絡中的不同。
實驗拓撲:



實驗內容:
1.配置數據鏈路層
R3上的配置:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 192.168.10.3 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 102 broadcast
frame-relay map ip 192.168.10.4 102 broadcast
frame-relay map ip 192.168.10.5 103 broadcast
no frame-relay inverse-arp
router ospf 100
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 192.168.10.0 0.0.0.255 area 0
neighbor 192.168.10.5 priority 1
neighbor 192.168.10.4 priority 1
R4上的配置:
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.168.10.4 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 201 broadcast
frame-relay map ip 192.168.10.4 201 broadcast
frame-relay map ip 192.168.10.5 201 broadcast
no frame-relay inverse-arp
router ospf 100
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 192.168.10.0 0.0.0.255 area 0
R5上的配置:
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.168.10.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 301 broadcast
frame-relay map ip 192.168.10.4 301 broadcast
frame-relay map ip 192.168.10.5 301 broadcast
no frame-relay inverse-arp
!
router ospf 100
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 192.168.10.0 0.0.0.255 area 0
2.配置OSPF協議
  R3上啓用OSPF
R3(config-if)#router ospf 100
R3(config-router)#net 3.3.3.3 0.0.0.0 area 0
R3(config-router)#net 192.168.10.0 0.0.0.255 area 0
R3(config-router)# neighbor 192.168.10.5 priority 1 定義對端的優先級爲1,這樣自己的優先級就可以成爲0,那麼我就可以成功的選舉成DR了,這一步是NBMA網絡中的關鍵步驟。
R3(config-router)# neighbor 192.168.10.4 priority 1
R4上啓用OSPF
R4(config-if)#router ospf 100
R4(config-router)#net 4.4.4.4 0.0.0.0 area 0
R4(config-router)#net 192.168.10.0 0.0.0.255 area 0
R5上啓用OSPF
R5(config)#router ospf 100
R5(config-router)#net 5.5.5.5 0.0.0.0 area 0
R5(config-router)#net 192.168.10.0 0.0.0.255 area 0
3.察看OSPF路由表
R3上查看
R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 192.168.10.4, 00:03:00, Serial1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 192.168.10.5, 00:03:00, Serial1
C    192.168.10.0/24 is directly connected, Serial1
R3#show ip route ospf
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 192.168.10.4, 00:04:07, Serial1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 192.168.10.5, 00:04:07, Serial1
R4上察看
R4#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.10.3, 00:04:31, Serial0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/129] via 192.168.10.3, 00:04:31, Serial0
C    192.168.10.0/24 is directly connected, Serial0
R4#show ip route ospf
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.10.3, 00:04:48, Serial0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/129] via 192.168.10.3, 00:04:48, Serial0
R5上查看
R5#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.10.3, 00:05:16, Serial0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 192.168.10.3, 00:05:16, Serial0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
C    192.168.10.0/24 is directly connected, Serial0
R5#show ip route ospf
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.10.3, 00:05:33, Serial0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 192.168.10.3, 00:05:33, Serial0
4.DEBUG packet信息:
R3#debug ip ospf packet
OSPF packet debugging is on
R3#
02:46:33: OSPF: rcv. v:2 t:1 l:48 rid:5.5.5.5
      aid:0.0.0.0 chk:217C aut:0 auk: from Serial1
R3#
02:46:40: OSPF: rcv. v:2 t:1 l:48 rid:4.4.4.4
      aid:0.0.0.0 chk:237E aut:0 auk: from Serial1
R3#
02:47:03: OSPF: rcv. v:2 t:1 l:48 rid:5.5.5.5
      aid:0.0.0.0 chk:217C aut:0 auk: from Serial1
R3#
02:47:10: OSPF: rcv. v:2 t:1 l:48 rid:4.4.4.4
      aid:0.0.0.0 chk:237E aut:0 auk: from Serial1
R3#
02:47:33: OSPF: rcv. v:2 t:1 l:48 rid:5.5.5.5
      aid:0.0.0.0 chk:217C aut:0 auk: from Serial1
R3#
02:47:40: OSPF: rcv. v:2 t:1 l:48 rid:4.4.4.4
aid:0.0.0.0 chk:237E aut:0 auk: from Serial1
   DEBUG packet信息
   R3#debug ip ospf hello
OSPF hello events debugging is on
R3#
02:49:03: OSPF: Rcv hello from 5.5.5.5 area 0 from Serial1 192.168.10.5
02:49:03: OSPF: End of hello processing
R3#
02:49:10: OSPF: Rcv hello from 4.4.4.4 area 0 from Serial1 192.168.10.4
02:49:10: OSPF: End of hello processing
R3#
02:49:33: OSPF: Rcv hello from 5.5.5.5 area 0 from Serial1 192.168.10.5
02:49:33: OSPF: End of hello processing
R3#
02:49:40: OSPF: Rcv hello from 4.4.4.4 area 0 from Serial1 192.168.10.4
02:49:40: OSPF: End of hello processing
5.查看OSPF信息
R3#show ip ospfexternal,
Routing Process "ospf 100" with ID 3.3.3.3
Supports only single TOS(TOS0) routes
Supports opaque LSA
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 0. Checksum Sum 0x0
Number of opaque AS LSA 0. Checksum Sum 0x0
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 BACKBONE(0)
        Number of interfaces in this area is 2
        Area has no authentication
        SPF algorithm executed 12 times
        Area ranges are
        Number of LSA 4. Checksum Sum 0x13D90
        Number of opaque link LSA 0. Checksum Sum 0x0
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
6.查看OSPF數據庫
R3#show ip ospf database
       OSPF Router with ID (3.3.3.3) (Process ID 100)
                Router Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.3         3.3.3.3         74          0x80000002 0x517F   2
4.4.4.4         4.4.4.4         74          0x80000002 0x4182   2
5.5.5.5         5.5.5.5         75          0x80000002 0x3185   2
                Net Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum
192.168.10.3    3.3.3.3         74          0x80000001 0x790A
7.查看OSPF接口
R3#show ip ospf interface
Loopback0 is up, line protocol is up
  Internet Address 3.3.3.3/24, Area 0
  Process ID 100, Router ID 3.3.3.3, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
Serial1 is up, line protocol is up
  Internet Address 192.168.10.3/24, Area 0
  Process ID 100, Router ID 3.3.3.3, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 192.168.10.3
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    Hello due in 00:00:16
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 2, maximum is 4
  Last flood scan time is 4 msec, maximum is 4 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 5.5.5.5
    Adjacent with neighbor 4.4.4.4
  Suppress hello for 0 neighbor(s)
8.查看OSPF鄰居
R3#show ip ospf nei
Neighbor ID     Pri   State           Dead Time   Address         Interface
5.5.5.5           0   FULL/DROTHER    00:01:31    192.168.10.5    Serial1
4.4.4.4           0   FULL/DROTHER    00:01:38    192.168.10.4    Serial1
9.查看OSPF協議
R3#show ip protocols
Routing Protocol is "ospf 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 3.3.3.3
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    3.3.3.0 0.0.0.255 area 0
    192.168.10.0 0.0.0.255 area 0
  Routing Information Sources:
    Gateway         Distance      Last Update
    4.4.4.4              110      00:02:25
    5.5.5.5              110      00:02:25
    3.3.3.3              110      00:02:25
  Distance: (default is 110)
10.查看OSPF路由
R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 192.168.10.4, 00:03:09, Serial1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 192.168.10.5, 00:03:09, Serial1
C    192.168.10.0/24 is directly connected, Serial1
R3#show ip route ospf
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 192.168.10.4, 00:02:53, Serial1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 192.168.10.5, 00:02:53, Serial1
11.查看OSPF的進程
R3#show ip ospf 100
Routing Process "ospf 100" with ID 3.3.3.3
Supports only single TOS(TOS0) routes
Supports opaque LSA
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 0. Checksum Sum 0x0
Number of opaque AS LSA 0. Checksum Sum 0x0
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 BACKBONE(0)
        Number of interfaces in this area is 2
        Area has no authentication
        SPF algorithm executed 12 times
        Area ranges are
        Number of LSA 4. Checksum Sum 0x13D90
        Number of opaque link LSA 0. Checksum Sum 0x0
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
實驗總結:
這個實驗是OSPF單區中比較綜合的一個實驗了,OSPF單區域的重點就是不同的網絡類型上,比如:點對點,廣播,NBMA的廣播,NBMA的非廣播,點對多點。這些模式如果都掌握了,那麼你就沒有問題了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章