本文共 7075 字,大约阅读时间需要 23 分钟。
OSPF
参考拓扑1.OSPF的邻居拍错(续)1.1 相邻设备的RID不能重复[R6-ospf-1]ospf router-id 5.5.5.5 //修改RID和邻居相同<R6>reset ospf process //YDec 10 2017 10:09:00-08:00 R6 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[7]:OSPF Router id conflict is detected on interface. (ProcessId=256, RouterId=5.5.5.5, AreaId=56.0.0.0, InterfaceName=Serial2/0/0, IpAddr=6.56.1.10, PacketSrcIp=5.56.1.10) <R6>display ospf errorOSPF Process 1 with Router ID 5.5.5.5 OSPF error statistics
General packet errors:
0 : IP: received my own packet 0 : Bad packet0 : Bad version 0 : Bad checksum0 : Bad area id 0 : Drop on unnumbered interface0 : Bad virtual link 0 : Bad authentication type0 : Bad authentication key 0 : Packet too small0 : Packet size > ip length 0 : Transmit error0 : Interface down 0 : Unknown neighbor0 : Bad net segment 0 : Extern option mismatch10 : Router id confusion //RID包含在OSPF头部中,所以出现在通用错误!同一区域中不相邻的设备,RID冲突会引发缺少路由(1类LSA的通告者引发的)1.2 Hello和死亡时间都需要匹配[SW1]dis ospf int Vlanif 30OSPF Process 1 with Router ID 10.10.10.10 Interfaces
Interface: 10.1.30.10 (Vlanif30)
Cost: 1 State: BDR Type: Broadcast MTU: 1500 Priority: 1Designated Router: 10.1.30.3Backup Designated Router: 10.1.30.10Timers: Hello 10 , Dead 40 [R4]dis ospf int s1/0/0OSPF Process 1 with Router ID 4.4.4.4 Interfaces
Interface: 10.1.1.4 (Serial1/0/0)
Cost: 48 State: BDR Type: NBMA MTU: 1500 Priority: 1Designated Router: 10.1.1.1Backup Designated Router: 10.1.1.4Timers: Hello 30 , Dead 120 ,[R6-Serial2/0/0]ospf timer hello 9 //修改Hello时间为9秒,dead时间默认会随之改变为36。但是死亡时间也可以自定义(不是4倍关系),如果仅仅修改死亡时间,Hello时间不变[R6-Serial2/0/0]dis ospf int s2/0/0OSPF Process 1 with Router ID 6.6.6.6 Interfaces
Interface: 10.1.56.6 (Serial2/0/0) --> 10.1.56.5
Cost: 48 State: P-2-P Type: P2P MTU: 1500 Timers: Hello 9 , Dead 36[R6-Serial2/0/0]dis ospf errorHELLO packet errors:
0 : Netmask mismatch 6 : Hello timer mismatch0 : Dead timer mismatch 0 : Virtual neighbor unknown0 : NBMA neighbor unknown 0 : Invalid Source AddressHELLO packet errors:
0 : Netmask mismatch 92 : Hello timer mismatch1 : Dead timer mismatch // 1 : Dead timer mismatch ,死亡时间不匹配2-way1.3 MTU检测ospf mtu-enable命令用来使能接口在发送DBD(数据库描述报文)报文时填MTU值在发送DBD的时候默认填充为0,不在意该值R3(S MTU1492 ENABLE)SW1(S MTU 0 UNDO)0.0.0.34 Vlanif30 3.3.3.3 Full !2侧开启MTU,M设备较大全部exstart0.0.0.34 Vlanif30 3.3.3.3 ExStart !S设备的MTU较大,两侧开启MTU-ENABLE<R3>dis ospf peer brief //SLAVE看到MASTER,交互了!OSPF Process 1 with Router ID 3.3.3.3 Peer Statistic Information
Area Id Interface Neighbor id State
0.0.0.34 GigabitEthernet0/0/1 10.10.10.10 Exchange[SW1-Vlanif30]dis ospf peer brief //MASTER设备看到对端exstartOSPF Process 1 with Router ID 10.10.10.10 Peer Statistic Information
Area Id Interface Neighbor id State
0.0.0.34 Vlanif30 3.3.3.3 ExStart DD packet errors:0 : Neighbor state low 0 : Unknown LSA type141 : MTU option mismatch //MTU不匹配引发的错误2.OSPF的链路状态和网络类型
网络物理介质1)光纤、双绞线 --OSPF的网络类型->广播2)串口的FR物理链路--OSPF的网络类型->NBMA3)串口的点到的 --OSPF的网络类型->P2P4) --OSPF的网络类型->P2MP(点到多点)为了适应复杂的企业网接入2.1 OSPF的点到点网络类型仅仅适用于链路上只有2个设备的情况邻居如何发现呢?单播发现组播发现如下几个角度去考虑:1)如何发现邻居:组播2)时间:10,403)是否需要DR(指定路由器,在多点接入网络就需要DR):不需要<R5>dis ospf int s2/0/0
OSPF Process 1 with Router ID 5.5.5.5 Interfaces
Interface: 10.1.56.5 (Serial2/0/0) --> 10.1.56.6
Cost: 48 State: P-2-P Type: P2P MTU: 15002.2 OSPF的广播的网络类型
如下几个角度去考虑:1)如何发现邻居:组播自动发现2)时间:10,403)是否需要DR:需要DR需要选举,waiting time(40s)OSPF Process 1 with Router ID 1.1.1.1 Interfaces
Interface: 10.1.1.1 (Serial1/0/0)
Cost: 48 State: P-2-P Type: P2MP MTU: 1500 Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1 华为设备P2MP的OSPF网络类型,类比封装为P2P的链路会自动得到对端直连地址的/32位主机路由2.5 NBMAinterface Serial1/0/0link-protocol fr //物理链路为FR,所以默认OSPF网络类型为NBMAip address 10.1.1.1 255.255.255.0 ospf dr-priority 10ospf enable 1 area 0.0.0.0<R1>dis ospf int s1/0/0OSPF Process 1 with Router ID 1.1.1.1 Interfaces
Interface: 10.1.1.1 (Serial1/0/0)
Cost: 48 State: DR Type: NBMA MTU: 1500 ospf 1 router-id 1.1.1.1 peer 10.1.1.4 //相互指定对端的直连地址邻居,作为HUB指定了R4和R5peer 10.1.1.5area 0.0.0.0 area 0.0.0.15 R4:ospf 1 router-id 4.4.4.4 peer 10.1.1.1area 0.0.0.0 area 0.0.0.34Public routing table : OSPF
Destinations : 11 Routes : 13OSPF routing table status : <Active>
Destinations : 11 Routes : 13Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.15.0/24 OSPF 10 49 D 10.1.1.1 Serial1/0/0 OSPF 10 49 D 10.1.1.5 Serial1/0/0 10.1.30.0/24 OSPF 10 49 D 10.1.34.3 Serial2/0/0 10.1.35.0/24 OSPF 10 49 D 10.1.1.5 Serial1/0/0 10.1.56.0/24 OSPF 10 96 D 10.1.1.5 Serial1/0/0 10.10.10.9/32 O_ASE 150 1 D 10.1.34.3 Serial2/0/010.10.10.10/32 OSPF 10 49 D 10.1.34.3 Serial2/0/0 11.1.1.1/32 OSPF 10 48 D 10.1.1.1 Serial1/0/015.15.15.15/32 OSPF 10 49 D 10.1.1.1 Serial1/0/0 OSPF 10 49 D 10.1.1.5 Serial1/0/0 33.1.1.1/32 OSPF 10 49 D 10.1.1.5 Serial1/0/0 55.1.1.1/32 OSPF 10 48 D 10.1.1.5 Serial1/0/0 66.1.1.1/32 OSPF 10 96 D 10.1.1.5 Serial1/0/0
到达66.1.1.1的下一跳为10.1.1.5
HUB&SPOKE结构(分支间没有直连的封装)
不建议使用NBMA(需要使得HUB成为DR、需要手工指定邻居、没有去往下一跳的封装)不建议使用Broadcast(需要使得HUB成为DR、不需要手工指定邻居、没有去往下一跳的封装)推荐使用P2MPOSPF接口开销
公式=参考带宽/物理带宽3.1 修改公式的分母interface GigabitEthernet0/0/1ip address 10.1.30.3 255.255.255.0 ospf mtu-enableospf network-type p2pospf enable 1 area 0.0.0.34undo negotiation auto //关闭自动协商speed 10 //修改速率为10,修改分母dis ospf int g0/0/1OSPF Process 1 with Router ID 3.3.3.3 Interfaces
Interface: 10.1.30.3 (GigabitEthernet0/0/1) --> 10.1.30.10
Cost: 10 State: P-2-P Type: P2P MTU: 1500 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1 100Mbps/10Mbps=103.2 修改公式的分子[R1-ospf-1]bandwidth-reference ?INTEGER<1-2147483648> The reference bandwidth (Mbits/s)作业:
1.区域0观察广播、NBMA和p2mp类型的时的下一跳情况以及数据通信情况2.所有的(除了area 15)修改为不需要DR的网络环境转载于:https://blog.51cto.com/enderjoe/2049140