OSPF组播拓展
文章目录
- OSPF组播拓展
- 一、拓扑结构
- 二、基础配置
- 三、测试验证
- 启动 OSPF 协议后 , OSPF 将向本地所有运行 OSPF 协议的接口以组播224.0.0.5的形式发送hello报
文 ; hello 报文中将携带本地 RID 值 , 以及本地已知的邻居的RID值( 通过接收其他邻居的 hello报
文来获取本地邻居 , 建立一邻居表); - 邻居关系建立后 , 进行条件匹配 , 匹配失败则停留在邻居关系 , 仅hello包保活 。 成功则进入邻接关
系的建立过程 ; - 使用未携带数据的DBD报文进行主从关系选举 ,主设备先进入下一步操作 。 两者使用携带数据的
DBD 报文来共享数据目录信息 。 之后本地使用 LSR/LSU /LSAck 报文来获取完整 LSA 信息 ( 链路状态
通告 ) 。 完成本地 LSDB ( 链路状态数据库 ) 的建立–生成数据库表; - 之后将本地基于数据库生成有向图和最短路径树 , 并计算本地到达拓扑中所有的网段的最短路径 ,
并将其加入到 OSPF 路由表中 。 将优选的路由加入到全局路由表 ; - 首次收敛完成 , 之后进行hello包保活, 并进行 30min一次的周期链路刷新 。
- 为减小多路访问网络中OSPF流量,OSPF会选择一个指定路由器(DR)和一个备份指定路由器(BDR)。当多路访问网络发生变化时,DR负责更新其他所有OSPF路由器。BDR会监控DR 的状态,并在当前DR发生故障时接替其角色。
一、拓扑结构
二、基础配置
R1:
#配置IP
<Huawei>sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.0.0.1 24
[Huawei-GigabitEthernet0/0/1]q
#配置DHCP
[Huawei]dhcp enable
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select int
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8
[Huawei-GigabitEthernet0/0/0]q
#配置OSPF
[Huawei]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
R2:
#配置IP
<Huawei>sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.0.0.2 24
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 23.0.0.1 24
[Huawei-GigabitEthernet0/0/2]q
#配置DHCP
[Huawei]dhcp enable
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select int
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8
[Huawei-GigabitEthernet0/0/0]q
#配置OSPF
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 1.0.0.0 network 23.0.0.0 0.0.0.255
R3:
#配置IP
<Huawei>sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 23.0.0.2 24
[Huawei-GigabitEthernet0/0/1]q
#配置DHCP
[Huawei]dhcp enable
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 8.8.8.8
[Huawei-GigabitEthernet0/0/0]q
#
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
三、测试验证
R3的邻居关系简表,邻居关系表,OSPF路由表以及OSPF数据库
#邻居关系简表
[Huawei-ospf-1-area-0.0.0.0]display ospf peer brief
OSPF Process 1 with Router ID 3.3.3.3
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/1 2.2.2.2 Full
----------------------------------------------------------------------------
#邻居关系表
[Huawei-ospf-1-area-0.0.0.0]display ospf peer
OSPF Process 1 with Router ID 3.3.3.3
Neighbors
Area 0.0.0.0 interface 23.0.0.2(GigabitEthernet0/0/1)'s neighbors
Router ID: 2.2.2.2 Address: 23.0.0.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 23.0.0.1 BDR: 23.0.0.2 MTU: 0
Dead timer due in 38 sec
Retrans timer interval: 5
Neighbor is up for 00:01:17
Authentication Sequence: [ 0 ]
#OSPF路由表
[Huawei-ospf-1-area-0.0.0.0]display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
23.0.0.0/24 1 Transit 23.0.0.2 3.3.3.3 0.0.0.0
192.168.3.0/24 1 Stub 192.168.3.1 3.3.3.3 0.0.0.0
12.0.0.0/24 2 Transit 23.0.0.1 1.1.1.1 0.0.0.0
192.168.1.0/24 3 Stub 23.0.0.1 1.1.1.1 0.0.0.0
192.168.2.0/24 2 Stub 23.0.0.1 2.2.2.2 0.0.0.0
Total Nets: 5
Intra Area: 5 Inter Area: 0 ASE: 0 NSSA: 0
#OSPF数据库
[Huawei-ospf-1-area-0.0.0.0]display ospf lsdb
OSPF Process 1 with Router ID 3.3.3.3
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 457 60 8000000A 1
Router 1.1.1.1 1.1.1.1 540 48 80000007 1
Router 3.3.3.3 3.3.3.3 443 48 80000005 1
Network 23.0.0.1 2.2.2.2 457 32 80000002 0
Network 12.0.0.1 1.1.1.1 540 32 80000002 0
[Huawei-ospf-1-area-0.0.0.0]
PC1pingPC5
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe66:1686
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-66-16-86
DNS server........................: 8.8.8.8
#配置OSPF前
PC>ping 192.168.3.254
Ping 192.168.3.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
--- 192.168.3.254 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
#配置OSPF后
PC>ping 192.168.3.254
Ping 192.168.3.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.3.254: bytes=32 seq=2 ttl=125 time=62 ms
From 192.168.3.254: bytes=32 seq=3 ttl=125 time=78 ms
From 192.168.3.254: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.3.254: bytes=32 seq=5 ttl=125 time=79 ms
--- 192.168.3.254 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/74/79 ms
感谢你的阅读ε≡٩(๑>₃<)۶