侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

CCNP(BSCI)实验:配有OSPF协议帧中继Hub and Spoke物理接口

2023-04-05 星期三 / 0 评论 / 0 点赞 / 72 阅读 / 5012 字

R1、R2、R3的预配置R1(config)#int lo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#int s3/0R1(con

.


R1、R2、R3的预配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s3/0
R1(config-if)#ip add 123.1.1.1 255.255.255.0
R1(config-if)#en fr
R1(config-if)#no fr inv
R1(config-if)#fr map ip 123.1.1.2 102 b
R1(config-if)#fr map ip 123.1.1.3 103 b
R1(config-if)#no sh
R1(config-if)#end

R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int s3/0
R2(config-if)#ip add 123.1.1.2 255.255.255.0
R2(config-if)#en fr
R2(config-if)#no fr inv
R2(config-if)#fr map ip 123.1.1.1 201 b
R2(config-if)#fr map ip 123.1.1.3 201 b
R2(config-if)#no sh

R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int s3/0
R3(config-if)#ip add 123.1.1.3 255.255.255.0
R3(config-if)#en fr
R3(config-if)#no fr inv
R3(config-if)#fr map ip 123.1.1.1 301 b
R3(config-if)#fr map ip 123.1.1.2 301 b
R3(config-if)#no sh
实验过程:
第一步:在R1、R2、R3上配置ospf
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router os 11
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 1.1.1.1 255.255.255.0 area 0
R1(config-router)#net 123.1.1.1 0.0.0.255 a 0
R1(config-router)#end

R2#conf t
R2(config)#router os 11
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 2.2.2.2 0.0.0.255 a 0
R2(config-router)#net 123.1.1.2 0.0.0.255 a 0
R2(config-router)#end
R2(config)#int s3/0
R2(config-if)#ip os priority 0
R2(config-if)#

R3(config)#router os 11
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 3.3.3.3 0.0.0.255 a 0
R3(config-router)#net 123.1.1.3 0.0.0.255 a 0
R3(config-router)#exit
R3(config)#int s3/0
R3(config-if)#exit(这里并没有给R3的接口,设置优先级,我们猜想R3会成为DR)
R3(config)#
第二步:经过查看,没有邻居
第三步:查看物理接口的网络类型


//我们在这里看到网络类型为非广播(非广播选举DR和BDR,但是为非广播,不能传送hello包,不知道要发给谁,点到点直接传给对方,广播传给224.0.0.5/6这两个组播地址,但非广播就傻了)
第四步:更改网络类型(这是此实验成功的关键内容,在多点子接口实验中我们演示手动添加邻居,目的是为了给手动指定的地址传送hello)
R1(config)#int s3/0
R1(config-if)#ip os
R1(config-if)#ip ospf network broadcast

R2(config)#int s3/0
R2(config-if)#ip os net b
R2(config-if)#exit

R3(config)#int s3/0
R3(config-if)#ip o net b
R3(config-if)#exit
第五步:在R1上查看邻居
R1#sh ip o nei
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DROTHER 00:00:35 123.1.1.2 Serial3/0
3.3.3.3 1 FULL/BDR 00:00:31 123.1.1.3 Serial3/0
//这里R1为DR,符合我们的要求
当清除邻居关系后
R1#sh ip o nei
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DROTHER 00:00:30 123.1.1.2 Serial3/0
3.3.3.3 1 FULL/DR 00:00:30 123.1.1.3 Serial3/0
//我们却看到了R3为BDR,在实际中不符合我们的要求,我们可以通过修改优先级来影响DR和BDR的选举,在实际中我们将spoke端的R2和R3都设为DRother。

第六步:更改R2、R3的优先级为“0”
R2(config)#int s3/0
R2(config-if)#ip ospf priority 0
R2(config-if)#end
//这里我们更改了int s3/0的优先级
R3(config)#int s3/0
R3(config-if)#ip o p 0
R3(config-if)#
第七步:清除并查看邻居关系
R1#sh ip o n

Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/DROTHER 00:00:33 123.1.1.2 Serial3/0
3.3.3.3 0 FULL/DROTHER 00:00:34 123.1.1.3 Serial3/0
//有两个DRother符合了我们的要求
第八步:小小的测试
R2#ping
Protocol [ip]:
Target IP address: 3.3.3.3
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 2.2.2.2
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/56/88 ms
R2#
R2#

.

广告 广告

评论区