CCNP-9 OSPF试验5

试验拓扑:

试验要求: R1 R2 R3 通过 FR 相连,形成 hub and spoke 网络拓扑, R1 hub 路由器, R2 R3 spoke 路由器, R1 采用点对多点子接口, R2 用物理接口, R3 用点对点子接口,全部起 OSPF
试验目的:一是掌握 NBMA 部分网格环境下,采用点对点子接口时, OSPF 的配置方法,二是掌握不同接口类型是否可以成功建立邻居关系。

实验配置:
R1
R1(config)#int s1/0
R1(config-if)#enca frame-relay
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int s1/0.1 multipoint

R1(config-subif)#ip add 199.99.1.1 255.255.255.0
R1(config-subif)#frame-relay map ip 199.99.1.2 301 broadcast
R1(config-subif)#frame-relay map ip 199.99.1.3 302 broadcast

 

R2
R2(config)#int s1/0
R2(config-if)#enca frame-relay
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#frame-relay map ip 199.99.1.1 103 broadcast
R2(config-if)#frame-relay map ip 199.99.1.2 103 broadcast
R2(config-if)#frame-relay map ip 199.99.1.3 103 broadcast

 

R3
R3(config)#int s1/0
R3(config-if)#enca frame-relay
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int s1/0.1 point-to-point

R3(config-subif)#ip add 199.99.1.3 255.255.255.0
R3(config-subif)#frame-relay interface-dlci 203

 

基本的链路层配置完成,先验证连通性:
R1#ping 199.99.1.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 199.99.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/204/356 ms

 

R1#ping 199.99.1.3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 199.99.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/191/216 ms

 

好了,连路都是通的,下面开始 OSPF 的配置:
R1(config)#int loop0
R1(config-if)#ip add 100.100.100.100 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#router-id 100.100.100.100
R1(config-router)#network 0.0.0.0 255.255.255.255 area 0

 

R2(config)#int loop0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf network point-to-point
R2(config-if)#exit
R2(config)#router ospf 100                      
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 0.0.0.0 255.255.255.255 area 0

 

R3(config)#int loop0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3 
R3(config-router)#network 0.0.0.0 255.255.255.255 area 0

 

配置完成后,用 show ip ospf interface 查看接口 OSPF 配置:
R1#show ip ospf interface
Loopback0 is up, line protocol is up
  Internet Address 100.100.100.100/24, Area 0
  Process ID 100, Router ID 100.100.100.100, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Serial1/0.1 is up, line protocol is up

  Internet Address 199.99.1.1/24, Area 0

  Process ID 100, Router ID 100.100.100.100, Network Type NON_BROADCAST, Cost: 64

  Transmit Delay is 1 sec, State WAITING, Priority 1

  No designated router on this network

  No backup designated router on this network

  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

    oob-resync timeout 120

    Hello due in 00:00:02

    Wait time before Designated router selection 00:01: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 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

R2#show ip ospf interface
Loopback0 is up, line protocol is up
  Internet Address 2.2.2.2/24, Area 0
  Process ID 100, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up

  Internet Address 199.99.1.2/24, Area 0

  Process ID 100, Router ID 2.2.2.2, Network Type NON_BROADCAST, Cost: 64

  Transmit Delay is 1 sec, State WAITING, Priority 1

  No designated router on this network

  No backup designated router on this network

  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

    oob-resync timeout 120

    Hello due in 00:00:11

    Wait time before Designated router selection 00:01:11

  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 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

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 POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Serial1/0.1 is up, line protocol is up

  Internet Address 199.99.1.3/24, Area 0

  Process ID 100, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 64

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  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 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

注意用红色标记的部分: R1 接口的网络类型为 NON_BROADCAST R2 NON_BROADCAST R3 POINT_TO_POINT 。然后查看邻居表会发现无法建立邻居关系。 Debug 信息会显示接口类型不匹配,所以无法建立邻居关系,下面手动修改接口网络类型为 POINT_TO_MULTIPOINT

R1(config)#int s1/0.1 multipoint

R1(config-subif)#ip ospf network point-to-multipoint

 

R2(config)#int s1/0

R2(config-if)#ip ospf network point-to-multipoint

 

R3(config)#int s1/0.1 point-to-point

R3(config-subif)#ip ospf network point-to-multipoint

 

这样修改完成后,再用 show ip ospf interface 命令查看接口网络类型:

R1#show ip ospf interface

Serial1/0.1 is up, line protocol is up

  Internet Address 199.99.1.1/24, Area 0

  Process ID 100, Router ID 100.100.100.100, Network Type POINT_TO_MULTIPOINT, Cost: 64

  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,

  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

    oob-resync timeout 120

    Hello due in 00:00:10

  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 0 msec

  Neighbor Count is 2, Adjacent neighbor count is 1

    Adjacent with neighbor 3.3.3.3

  Suppress hello for 0 neighbor(s)

Loopback0 is up, line protocol is up

  Internet Address 100.100.100.100/24, Area 0

  Process ID 100, Router ID 100.100.100.100, Network Type POINT_TO_POINT, Cost: 1

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    oob-resync timeout 40

  Supports Link-local Signaling (LLS)

  Index 2/2, flood queue length 0

  Next 0x0(0)/0x0(0)

  Last flood scan length is 0, maximum is 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

R2#show ip ospf interface

Serial1/0 is up, line protocol is up

  Internet Address 199.99.1.2/24, Area 0

  Process ID 100, Router ID 2.2.2.2, Network Type POINT_TO_MULTIPOINT, Cost: 64

  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,

  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

    oob-resync timeout 120

    Hello due in 00:00:12

  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 0 msec

  Neighbor Count is 1, Adjacent neighbor count is 1

    Adjacent with neighbor 100.100.100.100

  Suppress hello for 0 neighbor(s)

Loopback0 is up, line protocol is up

  Internet Address 2.2.2.2/24, Area 0

  Process ID 100, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 1

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    oob-resync timeout 40

  Supports Link-local Signaling (LLS)

  Index 2/2, flood queue length 0

  Next 0x0(0)/0x0(0)

  Last flood scan length is 0, maximum is 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

R3#show ip ospf interface

Serial1/0.1 is up, line protocol is up

  Internet Address 199.99.1.3/24, Area 0

  Process ID 100, Router ID 3.3.3.3, Network Type POINT_TO_MULTIPOINT, Cost: 64

  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,

  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

    oob-resync timeout 120

    Hello due in 00:00:15

  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 4 msec, maximum is 4 msec

  Neighbor Count is 1, Adjacent neighbor count is 1

    Adjacent with neighbor 100.100.100.100

  Suppress hello for 0 neighbor(s)

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 POINT_TO_POINT, Cost: 1

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    oob-resync timeout 40

  Supports Link-local Signaling (LLS)

  Index 2/2, flood queue length 0

  Next 0x0(0)/0x0(0)

  Last flood scan length is 0, maximum is 0

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 0, Adjacent neighbor count is 0

  Suppress hello for 0 neighbor(s)

 

上面用红颜色标记的部分不仅显示了接口的网络类型为 POINT_TO_MULTIPOINT ,还显示了 默认的 HELLO 时间间隔为 30 秒,等待时间和死亡时间为 HELLO 时间间隔的 4 120 ,然后在用 show ip ospf neighbor 查看邻居关系:

R1#show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

3.3.3 .3           0   FULL/  -        00:01:59    199.99.1.3      Serial1/0.1

2.2.2 .2           0   FULL/  -        00:01:57    199.99.1.2      Serial1/0.1

 

R2#show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

100.100.100.100   0   FULL/  -        00:01:58    199.99.1.1      Serial1/0

 

R3#show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

100.100.100.100   0   FULL/  -        00:01:50    199.99.1.1      Serial1/0.1

 

邻居关系自动建立,并且不需要选举 DR/BDR sopke 路由器只和 hub 路由器建立邻居关系, 最后查看一下每台路由器的路由表:

R1#show ip route

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

 

     100.0.0.0/24 is subnetted, 1 subnets

C       100.100.100.0 is directly connected, Loopback0

     3.0.0.0/24 is subnetted, 1 subnets

O       3.3.3.0 [110/65] via 199.99.1.3, 00:00:10, Serial1/0.1

     199.99.1.0/24 is variably subnetted, 2 subnets, 2 masks

C       199.99.1.0/24 is directly connected, Serial1/0.1

O       199.99.1.3/32 [110/64] via 199.99.1.3, 00:00:10, Serial1/0.1

 

R2#show ip route

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

 

     2.0.0.0/24 is subnetted, 1 subnets

C       2.2.2.0 is directly connected, Loopback0

     100.0.0.0/24 is subnetted, 1 subnets

O       100.100.100.0 [110/65] via 199.99.1.1, 00:00:05, Serial1/0

     3.0.0.0/24 is subnetted, 1 subnets

O       3.3.3.0 [110/129] via 199.99.1.1, 00:00:05, Serial1/0

     199.99.1.0/24 is variably subnetted, 3 subnets, 2 masks

O       199.99.1.1/32 [110/64] via 199.99.1.1, 00:00:05, Serial1/0

C       199.99.1.0/24 is directly connected, Serial1/0

O       199.99.1.3/32 [110/128] via 199.99.1.1, 00:00:05, Serial1/0

 

R3#show ip route

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

 

     2.0.0.0/24 is subnetted, 1 subnets

O       2.2.2.0 [110/129] via 199.99.1.1, 00:00:10, Serial1/0.1

     100.0.0.0/24 is subnetted, 1 subnets

O       100.100.100.0 [110/65] via 199.99.1.1, 00:00:10, Serial1/0.1

     3.0.0.0/24 is subnetted, 1 subnets

C       3.3.3.0 is directly connected, Loopback0

     199.99.1.0/24 is variably subnetted, 3 subnets, 2 masks

O       199.99.1.1/32 [110/64] via 199.99.1.1, 00:00:11, Serial1/0.1

C       199.99.1.0/24 is directly connected, Serial1/0.1

O       199.99.1.2/32 [110/128] via 199.99.1.1, 00:00:11, Serial1/0.1

 

OK ,发现每台路由器里都学到了“ O ”路由。 并且通过 OSPF 学到的接口地址是 32 位的主机路由。

实验总结: 掌握在 NBMA 模式下,采用点对多点子接口的时候 OSPF 路由协议的配置,并且邻居关系是自动建立,无需手动指定邻居,无 DR/BDR 选举,默认的 HELLO 时间间隔为 30 秒,等待时间和死亡时间为 HELLO 时间间隔的 4 倍, 120 秒。还有就是接口地址是以 32 位主机路由的方式泛洪出去的。