广播多路访问链路上的OSPF
一、    实验目的
1、         修改参考带宽
2、         DR选举的控制
3、         广播多路访问链路上的ospf特征
4、         Hello间隔对邻接关系的影响
二、    实验拓扑
 

广播多路访问链路上的ospf_广播

三、    实验步骤
R1
R1(config-if)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.0 255.255.255.0 a 0
R1(config-router)#net 192.168.1.0 255.255.255.0 a 0
R1(config-router)#auto-cost reference-bandwidth 1000
 
 R2
R2(config-if)#router ospf 1
R2(config-router)#router-id 2.2.2.2                 
R2(config-router)#net 192.168.1.0 255.255.255.0 a 0
R2(config-router)#net 2.2.2.0 255.255.255.0 a 0
R2(config-router)#auto-cost reference-bandwidth 1000
 R3
R3(config-if)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.1.0 255.255.255.0 a 0
R3(config-router)#net 3.3.3.0 255.255.255.0 a 0
R3(config-router)#auto-cost reference-bandwidth 1000
 R4
R4(config-if)#router ospf 1  
R4(config-router)#router-id 4.4.4.4
R4(config-router)#net 192.168.1.0 255.255.255.0 a 0
R4(config-router)#net 4.4.4.0 255.255.255.0 a 0
R4(config-router)#auto-cost reference-bandwidth 1000
说明:
Auto-cost reference-bandwidth 要在所有ospf路由器上配置,目的是确保参数标准相同。
 
R4(config-if)#do show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   2WAY/DROTHER    00:00:30    192.168.1.1     Ethernet1/1
2.2.2.2           1   FULL/DR         00:00:33    192.168.1.2     Ethernet1/1
3.3.3.3           1   FULL/BDR        00:00:35    192.168.1.3     Ethernet1/1
注意
邻居关系和邻接关系是不一样的,邻居关系是指达到2WAY状态的两台路由器,而邻接关系是达到FULL状态的两台路由器。
                                     EIGRPOSPF建立邻接关系的要求

要求
OSPF
EIGRP
接口的主IP地址必须属于同一子网
连接的接口不能处于被动状态
必须位于同一个区域
N/A
Hello间隔/定时器以及保持定时器(EIGRP)或失效定时器(OSPF)必须相同
路由器ID必须是唯一的
必须通过邻居的身分验证(如果配置)
用于计算度量值的K值必须相同
N/A
必须在配置命令router中使用了相同的ASN(EIGRP)或进程(OSPF
IP MTU 必须相同(MTU)不同可能导致无法交换拓扑数据

修改Hello-interval
R4(config-if)#ip ospf hello-interval 8
R4(config-if)#do show ip ospf int e1/1
Ethernet1/1 is up, line protocol is up
 Internet Address 192.168.1.4/24, Area 0
 Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 100
 Transmit Delay is 1 sec, State DROTHER, Priority 1
 Designated Router (ID) 2.2.2.2, Interface address 192.168.1.2
 Backup Designated router (ID) 3.3.3.3, Interface address 192.168.1.3
 Timer intervals configured, Hello 8, Dead 32, Wait 32, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:00
 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 1
 Last flood scan time is 0 msec, maximum is 4 msec
 Neighbor Count is 3, Adjacent neighbor count is 2
    Adjacent with neighbor 2.2.2.2 (Designated Router)
    Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
 Suppress hello for 0 neighbor(s)
R4(config-if)#
*Mar 1 00:51:42.235: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Ethernet1/1 from FULL to DOWN, Neighbor Down: Dead timer expired
R4(config-if)#
*Mar 1 00:51:47.671: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet1/1 from EXSTART to DOWN, Neighbor Down: Dead timer expired
R4(config-if)#
*Mar 1 00:51:51.003: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet1/1 from FULL to DOWN, Neighbor Down: Dead timer expired
 R4的邻接关系中断了,因为Hello定时器和失效定时器不匹配,然而,仅当失效定时器到期后邻接关系才中断。R4(config-if)#ip ospf dead-interval 40 可修改失效定时器。
OSPF邻接关系建立过程中,接口状态的变化包括DOWN2WAYEXSTARTEXCHANGELoading FULL
*Mar 1 01:20:54.219: OSPF: Neighbor change Event on interface Ethernet1/1
*Mar 1 01:20:54.219: OSPF: DR/BDR election on Ethernet1/1
*Mar 1 01:20:54.219: OSPF: Elect BDR 0.0.0.0
*Mar 1 01:20:54.219: OSPF: Elect DR 4.4.4.4
*Mar 1 01:20:54.219:        DR: 4.4.4.4 (Id)   BDR: none
*Mar 1 01:20:54.223: OSPF: 4.4.4.4 address 192.168.1.4 on Ethernet1/1 is dead, state DOWN
*Mar 1 01:20:54.223: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Ethernet1/1 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar 1 01:20:54.227: OSPF: Neighbor change Event on interface Ethernet1/1
*Mar 1 01:20:54.231: OSPF: DR/BDR election on Ethernet1/1
*Mar 1 01:20:54.231: OSPF: Elect BDR 0.0.0.0
*Mar 1 01:20:54.231: OSPF: Elect DR 0.0.0.0
*Mar 1 01:20:54.231:        DR: none
R1#   BDR: none
*Mar 1 01:20:54.231: OSPF: Remember old DR 4.4.4.4 (id)
*Mar 1 01:20:54.231: OSPF: Interface Loopback0 going Down
*Mar 1 01:20:54.235: OSPF: 1.1.1.1 address 1.1.1.1 on Loopback0 is dead, state DOWN
*Mar 1 01:20:54.299: OSPF: Interface Ethernet1/1 going Up
*Mar 1 01:20:54.303: OSPF: Interface Loopback0 going Up
*Mar 1 01:20:54.715: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x80000001
R1#
*Mar 1 01:21:00.031: OSPF: 2 Way Communication to 2.2.2.2 on Ethernet1/1, state 2WAY
*Mar 1 01:21:01.175: OSPF: 2 Way Communication to 3.3.3.3 on Ethernet1/1, state 2WAY
*Mar 1 01:21:01.179: OSPF: Backup seen Event before WAIT timer on Ethernet1/1
*Mar 1 01:21:01.183: OSPF: DR/BDR election on Ethernet1/1
*Mar 1 01:21:01.183: OSPF: Elect BDR 3.3.3.3
*Mar 1 01:21:01.183: OSPF: Elect DR 3.3.3.3
*Mar 1 01:21:01.187:        DR: 3.3.3.3 (Id)   BDR: 3.3.3.3 (Id)
*Mar 1 01:21:01.191: OSPF: Send DBD to 3.3.3.3 on Ethernet1/1 seq 0x26CE opt 0x52 flag 0x7 len 32
*Mar 1 01:21:01.303: OSPF: Rcv DBD from 3.3.3.3 on Ethernet1/1 seq 0x16A5 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 01:21:01.307: OSPF: Nbr 3.3.3.3 has larger interface MTU
*Mar 1 01:21:01.391: OSPF: 2 Way Communication to 4.4.4.4 on Ethernet1/1, state 2WAY
*Mar 1 01:22:21.251: OSPF: Send DBD to 3.3.3.3 on Ethernet1/1 seq 0x26CE opt 0x52 flag 0x7 len 32
*Mar 1 01:22:21.255: OSPF: Retransmitting DBD to 3.3.3.3 on Ethernet1/1 [16]
*Mar 1 01:22:21.259: OSPF: Rcv DBD from 3.3.3.3 on Ethernet1/1 seq 0x16A5 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 01:22:21.263: OSPF: Nbr 3.3.3.3 has larger interface MTU
*Mar 1 01:22:21.443: OSPF: Rcv DBD from 4.4.4.4 on Ethernet1/1 seq 0x2477 opt 0x52 flag 0x7 len 32 mtu 1498 state EXSTART
*Mar 1 01:22:21.447: OSPF: Nbr 4.4.4.4 has larger interface MTU
*Mar 1 01:22:21.483: OSPF: Send DBD to 4.4.4.4 on Ethernet1/1 seq 0x181D opt 0x52 flag 0x7 len 32
*Mar 1 01:25:56.451: OSPF: Rcv DBD from 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x7 len 32 mtu 1498 state EXCHANGE
*Mar 1 01:25:56.455: OSPF: Nbr 4.4.4.4 has smaller interface MTU
*Mar 1 01:25:56.459: OSPF: Send DBD to 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x2 len 132
R1#
*Mar 1 01:26:01.471: OSPF: Rcv DBD from 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x7 len 32 mtu 1498 state EXCHANGE
*Mar 1 01:26:01.475: OSPF: Nbr 4.4.4.4 has smaller interface MTU
*Mar 1 01:26:01.479: OSPF: Send DBD to 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x2 len 132
R1#
*Mar 1 01:26:06.447: OSPF: Rcv DBD from 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x7 len 32 mtu 1498 state EXCHANGE
*Mar 1 01:26:06.451: OSPF: Nbr 4.4.4.4 has smaller interface MTU
*Mar 1 01:26:06.455: OSPF: Send DBD to 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x2 len 132
R1#
*Mar 1 01:26:11.431: OSPF: Rcv DBD from 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x7 len 32 mtu 1498 state EXCHANGE
*Mar 1 01:26:11.435: OSPF: Nbr 4.4.4.4 has smaller interface MTU
*Mar 1 01:26:11.439: OSPF: Send DBD to 4.4.4.4 on Ethernet1/1 seq 0x1F2F opt 0x52 flag 0x2 len 132
修改MTU的值为1480
*Mar 1 01:24:51.303: OSPF: Rcv DBD from 3.3.3.3 on Ethernet1/1 seq 0x9DB opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 01:24:51.307: OSPF: Nbr 3.3.3.3 has larger interface MTU
在建立邻接关系时会提示MTU值不匹配。将不能时入EXCHANGE状态。