网络工程师交换试验手册之十四: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的非广播,点对多点。这些模式如果都掌握了,那么你就没有问题了。

你可能感兴趣的:(休闲,交换,网络工程师,试验手册)