3)非广播型多路访问网络类型NBMA
![图片[1]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片24-7.png)
![图片[2]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片25-6-1024x605.png)
(1)R1、R2、R3 上做DLCI等配置
[R1]interface Serial 0/0/1
[R1-Serial0/0/1]link-protocol fr ietf //在接口封装帧中继
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[R1-Serial0/0/1]undo fr inarp //关闭反向的 ARP
[R1-Serial0/0/1]ip add 123.1.1.1 255.255.255.0
[R1-Serial0/0/1]fr map ip 123.1.1.2 102 broadcast //手动配置映射
[R1-Serial0/0/1]fr map ip 123.1.1.3 103 broadcast
[R2]interface Serial 0/0/2
[R2-Serial0/0/2]link-protocol fr ietf
[R2-Serial0/0/2]undo fr inarp
[R2-Serial0/0/2]ip add 123.1.1.2 255.255.255.0
[R2-Serial0/0/2]fr map ip 123.1.1.1 201 broadcast
[R3]interface Serial 0/0/3
[R3-Serial0/0/3]link-protocol fr ietf
[R3-Serial0/0/3]undo fr inarp
[R3-Serial0/0/3]ip add 123.1.1.3 255.255.255.0
[R3-Serial0/0/3]fr map ip 123.1.1.1 301 broadcast
(2)R1、R2、R3 上做OSPF配置
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 123.0.0.0 0.255.255.255
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 123.0.0.0 0.255.255.255
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 123.0.0.0 0.255.255.255
(3)由于默认的网络类型是 NBMA,手动指邻居,而且必两边都指定邻居
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]peer 123.1.1.2
[R1-ospf-1]peer 123.1.1.3
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]peer 123.1.1.1
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]peer 123.1.1.1
(4)在R2与R3上做二层的映射关系,使R2 与 R3 畅通
[R2-Serial0/0/2]fr map ip 123.1.1.3 201 broadcast
[R3-Serial0/0/3]fr map ip 123.1.1.2 301 broadcast
(5)测试
[R1]ping 3.3.3.3
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=40 ms
<R2>ping 1.1.1.1
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=30 ms
<R2>ping 3.3.3.3
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=60 ms
<R3>ping 2.2.2.2
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=30 ms
4)点对多点式网络类型P2MP
(1)在 R1、R2、R3 上修改接口的 OSPF 网络类型
[R1]interface Serial 0/0/1
[R1-Serial0/0/1]ospf network-type p2mp
[R2]interface Serial0/0/2
[R2-Serial0/0/2]ospf network-type p2mp
[R3]interface Serial 0/0/3
[R3-Serial0/0/3]ospf network-type p2mp
(2)查看邻居表,没有了 DR/BDR 的选举
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 123.1.1.1(Serial0/0/1)'s neighbors
Router ID: 2.2.2.2 Address: 123.1.1.2
State: Full Mode:Nbr is Master Priority: 0
DR: None BDR: None MTU: 0
Dead timer due in 96 sec
Retrans timer interval: 5
Neighbor is up for 00:00:53
Authentication Sequence: [ 0 ]
Router ID: 3.3.3.3 Address: 123.1.1.3
State: Full Mode:Nbr is Master Priority: 0
DR: None BDR: None MTU: 0
Dead timer due in 92 sec
Retrans timer interval: 5
Neighbor is up for 00:00:25
Authentication Sequence: [ 0 ]
[R2-Serial0/0/2]display ospf interface Serial 0/0/2
OSPF Process 1 with Router ID 2.2.2.2
Interfaces
Interface: 123.1.1.2 (Serial0/0/2)
Cost: 1562 State: P-2-P Type: P2MP MTU: 1500
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
(3)在修改为NMBA,进行查看
[R1-Serial0/0/2]ospf network-type nbma
[R2-Serial0/0/2]display ospf interface Serial 0/0/2
OSPF Process 1 with Router ID 2.2.2.2
Interfaces
Interface: 123.1.1.2 (Serial0/0/2)
Cost: 1562 State: DROther Type: NBMA MTU: 1500
Priority: 0
Designated Router: 123.1.1.1
Backup Designated Router: 0.0.0.0
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
5)点到点的子接口网络类型
![图片[3]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片26-5.png)
(1)R1、R2、R3子接口DLCI等配置
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 32
[R1]interface Serial 0/0/1
[R1-Serial0/0/1]link-protocol fr
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[R1]interface Serial 0/0/1.12
[R1-Serial0/0/1.12]ip address 12.1.1.1 8
[R1-Serial0/0/1.12]fr dlci 102
[R1]interface Serial 0/0/1.13
[R1-Serial0/0/1.13]ip address 13.1.1.1 8
[R1-Serial0/0/1.13]fr dlci 103
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 32
[R2]interface Serial 0/0/2
[R2-Serial0/0/2]link-protocol fr
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[R2]interface Serial 0/0/2.12
[R2-Serial0/0/2.12]ip address 12.1.1.2 8
[R2-Serial0/0/2.12]fr dlci 201
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 32
[R3]interface Serial 0/0/3
[R3-Serial0/0/3]link-protocol fr
Warning: The encapsulation protocol of the link will be changed.
Continue? [Y/N]:y
[R3]interface Serial 0/0/3.13
[R3-Serial0/0/3.13]ip address 13.1.1.3 255.0.0.0
[R3-Serial0/0/3.13]fr dlci 301
(2)配置OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.0.0.0 0.255.255.255
[R1-ospf-1-area-0.0.0.0]network 13.0.0.0 0.255.255.255
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.0.0.0 0.255.255.255
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 13.0.0.0 0.255.255.255
(3)查看接口的网络类型,将NBMA类型修改为所以需要点到点网络类型
Error: Wrong parameter found at '^' position.
[R1]display ospf interface Serial 0/0/1.12
Interface: 12.1.1.1 (Serial0/0/1.12)
Cost: 1562 State: DR Type: NBMA MTU: 1500
Priority: 1
Designated Router: 12.1.1.1
Backup Designated Router: 0.0.0.0
Timers: Hello 30 , Dead 120 , Poll 120 , Retransmit 5 , Transmit Delay 1
[R1]interface Serial 0/0/1.12
[R1-Serial0/0/1.12]ospf network-type p2p
[R1]interface Serial 0/0/1.13
[R1-Serial0/0/1.13]ospf network-type p2p
[R2]interface Serial 0/0/2.12
[R2-Serial0/0/2.12]ospf network-type p2p
[R3]interface Serial 0/0/3.13
[R3-Serial0/0/3.13]ospf network-type p2p
(4)查看OSPF 路由表
[R1]display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1562 D 12.1.1.2 Serial0/0/1.12
3.3.3.3/32 OSPF 10 1562 D 13.1.1.3 Serial0/0/1.13
(5)测试
[R1]ping 2.2.2.2
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms
[R1]ping 3.3.3.3
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=60 ms
[R2]ping 3.3.3.3
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=80 ms
[R3]ping 2.2.2.2
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=60 ms
8.DR和BDR的概念
为减少网络中OSPF邻接关系数量,同时减少不必要的协议流量,OSPF会在MA网络(Multiple-Access多路访问)中选举DR(指定路由器)和BDR(备用指定路由器),不是DR和BDR的路由器为DRother,MA网络中DRother只和DR和BDR建立邻接关系,DR和BDR之间也建立邻接关系。DR负责侦听网络拓扑更新并及时通知其他路由器,BDR会监听DR状态,如有故障则接替DR工作。DR和BDR是通过Hello报文(DR优先级)实现的,优先级取值范围0-255,优先级为0的接口不具备DR和BDR选举资格,ospf dr-priority修改优先级,优先级高的成为DR,优先级相等时Router-ID大的成为DR,BDR选举类似。
使用Display ospf interface (GigabitEthernet 0/0/0)命令查看OSPF信息。
9.区域概念和多区域部署
1)一系列连续的OSPF路由器组成的网络称为OSPF域,域内路由器拥有相同的LSDB,确保网络信息一致。为减少网络规模太大,OSPF引入区域(Area)概念,域内划分不同区域,每个区域都有一个编号,采用点分十进制标识,骨干区域为Area0,只能有一个Area0,任何非骨干区域必须与Area0相连,介于骨干区域和非骨干区域之间的路由器称为ABR。
![图片[4]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片27-4.png)
2)非骨干区域与骨干区域不相连,采用OSPF虚电路(Virtual Link)解决。R2与R3之间建立虚电路解决不相连问题。
![图片[5]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片28-3.png)
10.OSPF路由器的角色
1)内部路由器IR
所有接口在同一个区域内,R1、R4、R5。
2)区域边界路由器ABR
接入多个区域的路由器,并且至少一个接口在Area0内,R2、R3。
3)骨干路由器BR
接入Area0的路由器,R1、R2、R3、R6。
4)AS边界路由器
在AS边界的路由器,R6。
![图片[6]-第3章OSPF-3.1 OSPF基础-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片29-2.png)
1 2
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容