当前位置:网站首页>ospf实验(mgre)
ospf实验(mgre)
2022-07-21 05:17:00 【那年牛奶不太纯】
一、配置路由器ip
R1:
g0/0/1:116.0.0.1 24
g0/0/0:16.0.0.1 24
缺省路由:
lookback0:192.168.1.1 24
R2:
g0/0/0: 26.0.0.1 24
缺省路由:
lookback0:192.168.2.1 24
R3:
g0/0/0:36.0.0.1 24
缺省路由:
lookback0:192.168.3.1 24
R4:
g0/0/0:46.0.0.1 24
缺省路由:
lookback0:192.168.4.1 24
R5:
g0/0/0: 56.0.0.1 24
缺省路由:
lookback0:192.168.5.1 24
ISP(R6):
g0/0/0: 16.0.0.2 24
g0/0/1: 116.0.0.2 24
g0/0/2: 56.0.0.2 24
g2/0/0: 26.0.0.2 24
g3/0/0: 36.0.0.2 24
g4/0/0: 46.0.0.2 24
配置好上述i端口ip后,在相关路由下敲一以命令
R1:
ip route-static 0.0.0.0 0 16.0.0.2
ip route-static 0.0.0.0 0 116.0.0.2
R2:
ip route-static 0.0.0.0 0 26.0.0.2
R3:
ip route-static 0.0.0.0 0 36.0.0.2
R4:
ip route-static 0.0.0.0 0 46.0.0.2
R5:
ip route-static 0.0.0.0 0 56.0.0.2
分别在R1、R2、R3、R4、R5上ping相关端口的IP地址,实现相互ping通。
二、实现R1、R4、R5为全连的mgre结构,R1、R2、R3为星型的拓扑结构其中R1为中心站点,使用ospf完成私有网段相互通讯。
1.实现R1、R4、R5为全连的mgre结构
R1:
int t0/0/1
ip address 192.168.7.1 24
tunnel-protocol gre p2mp
source 116.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.2 46.0.0.1 register
nhrp entry network 192.168.7.3 56.0.0.1 register
R4:
int t0/0/0
ip address 192.168.7.2 24
tunnel-protocol gre p2mp
source 46.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.1 116.0.0.1 register
nhrp entry network 192.168.7.3 56.0.0.1 register
R5:
int t0/0/0
ip address 192.168.7.3 24
tunnel-protocol gre p2mp
source 56.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.1 116.0.0.1 register
nhrp entry network 192.168.7.2 46.0.0.1 register
在R1中输入display nhrp peer all 有
2、R1、R2、R3为星型的拓扑结构其中R1为中心站点。
R1:
进入隧道端口:
int t0/0/0
配置ip:
ip address 192.168.6.1 24
定义封装类型:
tunnel-protocol gre p2mp
中心源端口地址
source 16.0.0.1
加入名为100的域
nhrp network-id 100
进行伪广播
nhrp entry multicast dynamic
R2:
int t0/0/0
ip address 192.168.6.2 24
tunnel-protocol gre p2mp
source g 0/0/0(由于分支地址不固定,因此直接标记端口号,R3同理)
nhrp network-id 100
R3:
int t0/0/0
ip address 192.168.6.3 24
tunnel-protocol gre p2mp
source g 0/0/0
nhrp network-id 100
输入命令display nhrp peer all检验,如下图
3.配置ospf的相关命令
R1:
ospf 1 router-id 1.1.1.1
area 0
network 192.168.1.0 0.0.0.255
network 192.168.6.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R2:
ospf 1 router-id 2.2.2.2
area 0
network 192.168.2.0 0.0.0.255
network 192.168.6.0 0.0.0.255
R3:
ospf 1 router-id 3.3.3.3
area 0
network 192.168.3.0 0.0.0.255
network 192.168.6.0 0.0.0.255
R4:
ospf 1 router-id 4.4.4.4
area 0
network 192.168.4.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R5:
ospf 1 router-id 5.5.5.5
area 0
network 192.168.5.0 0.0.0.255
network 192.168.7.0 0.0.0.255
由于本题中的星状结构与mgre结构要求不同,因此要改变相应端口的封装类型
进入相应隧道端口,修改封装类型:
R1:
int t 0/0/0
ospf network-type p2mp
R2、R3:
int t 0/0/0
ospf network-type p2mp
R1:
int t 0/0/1
ospf network-type broadcast
R4、R5:
int t 0/0/0
ospf network-type broadcast
在各个路由器中输入命令:display ip routing-table protocol ospf
如下图:
R1:
R2:
R3:
R4:
R5:
边栏推荐
- Directx11--窗口初始化(win32)
- P1111 修复公路(并查集)
- CocosCreator3.x 接入腾讯游戏联机对战引擎笔记
- Teach you how to realize an efficient im long connection adaptive heartbeat keeping mechanism
- Mapping between sets and potential of sets
- 力扣记录:动态规划3打家劫舍——198 打家劫舍,213 打家劫舍II,337 打家劫舍III
- Cocos Creator 3.x 绘制扇形网格组件
- 企业应该如何搭建客服机器人
- 二叉堆的c#实现
- Cocos Creator 3. X draw sector mesh components
猜你喜欢
随机推荐
第一周ACM训练报告
STL初步了解
tmux学习记录
Redis主从复制的配置原理和过程
unity 粒子特效从相机外进入相机 应该是激活状态结果没有播放
企业应该如何搭建客服机器人
Complete the tutorial of setting up MySQL database master-slave replication cluster
局域网电话软件系统功能与应用
Special topic on long connection Gateway Technology (VIII): evolution of microservice based API gateway in station B from 0 to 1
437. Path sum III
VOIP软交换与选线路之间的对比
长连接网关技术专题(八):B站基于微服务的API网关从0到1的演进之路
74. Search two-dimensional matrix
微信团队分享:微信后台在海量并发请求下是如何做到不崩溃的
jwt 的创建和验证 demo
Predicate 条件筛选
windows mysql 5.7+ 修改表名大小写敏感属性
234. Palindrome linked list
Seventh week ACM training report
Probability theory - maximum likelihood estimation