当前位置:网站首页>(Open Shortest Path First,OSPF)实验4
(Open Shortest Path First,OSPF)实验4
2022-07-20 21:03:00 【kaituozhizzz】
1、IP地址命令配置:
r1:
[r1]inter g0/0/0
[r1-GigabitEthernet0/0/0]ip add 16.0.0.1 24
[r1-GigabitEthernet0/0/0]inter g0/0/1
[r1-GigabitEthernet0/0/1]ip add 116.0.0.1 24
[r1-GigabitEthernet0/0/1]inter lo 0
[r1-LoopBack0]ip add 192.168.1.1 24
[r1]display ip interface brief ----查看接口命令配置
r2:
[r2]inter g0/0/0
[r2-GigabitEthernet0/0/0]ip add 26.0.0.1 24
[r2-GigabitEthernet0/0/0]inter lo 0
[r2-LoopBack0]ip add 192.168.2.1 24
r3:
[r3]inter g0/0/0
[r3-GigabitEthernet0/0/0]ip add 36.0.0.1 24
[r3-GigabitEthernet0/0/0]inter lo 0
[r3-LoopBack0]ip add 192.168.3.1 24
[r3-LoopBack0]
r4:
[r4]inter g0/0/0
[r4-GigabitEthernet0/0/0]ip add 46.0.0.1 24
[r4-GigabitEthernet0/0/0]inter lo 0
[r4-LoopBack0]ip add 192.168.4.1 24
r5:
[r5]inter g0/0/0
[r5-GigabitEthernet0/0/0]ip add 56.0.0.1 24
[r5-GigabitEthernet0/0/0]inter lo 0
[r5-LoopBack0]ip add 192.168.5.1 24
r6:
[Huawei]sys isp
[isp]inter g0/0/0
[isp-GigabitEthernet0/0/0]ip add 16.0.0.2 24
[isp-GigabitEthernet0/0/0]inter g0/0/1
[isp-GigabitEthernet0/0/1]ip add 116.0.0.2 24
[isp-GigabitEthernet0/0/1]inter g0/0/2
[isp-GigabitEthernet0/0/2]ip add 56.0.0.2 24
[isp-GigabitEthernet0/0/2]inter g4/0/0
[isp-GigabitEthernet4/0/0]ip add 46.0.0.2 24
[isp-GigabitEthernet4/0/0]inter g3/0/0
[isp-GigabitEthernet3/0/0]ip add 36.0.0.2 24
[isp-GigabitEthernet3/0/0]inter g2/0/0
[isp-GigabitEthernet2/0/0]ip add 26.0.0.2 24
因为R6作为ISP,所有就不配置环回地址了。
2、给每一台路由器配置一条指向ISP的缺省路由
目的是为了使接口之间可以Ping通
r1:
[r1]ip route-static 0.0.0.0 0 16.0.0.2
[r1]ip route-static 0.0.0.0 0 116.0.0.2
r2:
[r2]ip route-static 0.0.0.0 0 26.0.0.2
r3:
[r3]ip route-static 0.0.0.0 0 36.0.0.2
r4:
[r4]ip route-static 0.0.0.0 0 46.0.0.2
r5:
[r5]ip route-static 0.0.0.0 0 56.0.0.2
3、R1/R4/R5为全连的MGRE结构
E1/R4/R5之间彼此即使中心站点又是分支
先配置彼此作为中心站点的命令:
r1:
建立隧道,给隧道接口配置IP地址:
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip add 192.168.6.1 24
选择封装类型为MGRE:
r1-Tunnel0/0/0]tunnel-protocol ?
gre Generic Routing Encapsulation
ipsec IPSEC Encapsulation
ipv4-ipv6 IP over IPv6 encapsulation
ipv6-ipv4 IPv6 over IP encapsulation
mpls MPLS Encapsulation
none Null Encapsulation
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
定义源IP地址(为路由器的接口物理地址):
[r1-Tunnel0/0/0]source 16.0.0.1
创建NHRP域(所有加入这个NHRP域的私网都会向中心站点汇报隧道地址和出接口物理地址的对应关系)
NHRP 的network id具有全局意义,在整个网络中都遵循。
[r1-Tunnel0/0/0]nhrp network-id 100
在中心站点开启伪广播—分别给所有节点发送单播以达到广播的效果:
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
r4:
[r4]inter t 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 46.0.0.1
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
r5:
[r5]inter t0/0/0
[r5-Tunnel0/0/0]ip add 192.168.6.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 56.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
配置彼此作为分支的命令:
r1:
[r1]inter t0/0/0
找中心站点进行注册(entry 加入 register 注册):
[r1-Tunnel0/0/0]nhrp entry 192.168.6.2 46.0.0.1 register
[r1-Tunnel0/0/0]nhrp entry 192.168.6.3 56.0.0.1 register
192.168.6.2/3:中心站点的隧道地址
46/56.0.0.1:中心站点的物理接口地址
R1:
[r1-Tunnel0/0/0]inter t0/0/1
[r1-Tunnel0/0/1]ip add 192.168.7.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 116.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 111
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
R2:
[r2]inter t0/0/0
[r2-Tunnel0/0/0]ip add 192.168.7.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r2-Tunnel0/0/0]nhrp network-id 111
[r2-Tunnel0/0/0]nhrp entry 192.168.7.1 116.0.0.1 register
R3:
[r3]inter t0/0/0
[r3-Tunnel0/0/0]ip add 192.168.7.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r3-Tunnel0/0/0]nhrp network-id 111
[r3-Tunnel0/0/0]nhrp entry 192.168.7.1 116.0.0.1 register
5、所有私有网段可以互相通讯,私有网段使用OSPF完成
R1:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
宣告私有网段
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R2:
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R3:
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
R4:
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
R5:
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
但是此时R1只和R2,R4建立了邻居关系(在全连的MGRE和MGRE封装中,每个选了一个做邻居)
[r1]display ip routing-table protocol ospf
[r1]display ospf peer brief
边栏推荐
- Section 8 of Chapter II: addition, deletion, modification and query of the list
- 架构实战营模块 7 作业
- VSS中上传一个文件夹(包括子文件夹和文件)
- 软链接和硬链接的区别以及文件系统如何取文件
- Xshell determines that if the file exceeds the specified size, the file will be emptied
- 【二叉树】分裂二叉树的最大乘积
- Section 3 of Chapter 2: general operation of string
- 第二章第三节:字符串常规操作
- PLC的通信模式
- Indoor positioning of mobile robot and application of Internet of things based on visible light communication
猜你喜欢
Vulnhub target -doubletrouble
Multiplier technology cloud management and control platform adapts to Alibaba cloud polardb, and jointly promotes the prosperity of cloud native database ecosystem
04 提取最新的数据
Section 3 of Chapter 2: general operation of string
[CVA valuation training camp] read the annual reports of listed companies_ Lesson 2
第二章第十五节:字典的基本操作
[quick start tutorial 3] crazy shell · open source formation UAV - development environment construction
LoRa基站覆盖范围
Intel assembly language programming learning - Chapter 5 process - Part 1
虚拟机内核参数永久生效配置
随机推荐
Web3流量聚合平臺Starfish OS,詮釋真正商業的“P2E”生態
Design details related to sap e-commerce cloud Spartacus UI store
图解LeetCode——1260. 二维网格迁移(难度:简单)
Okaleido tiger NFT即将登录Binance NFT平台,后市持续看好
长城证券手机软件线上炒股开户证券公司佣金低?开户安全吗?
Section 11 of Chapter 2: tuples
Hangzhou dynamic environment monitoring system supplier, dynamic environment monitoring equipment
Web3流量聚合平台Starfish OS,诠释真正商业的“P2E”生态
调研报告之——可见光通信与可见光定位
SQL Server 查询语法汇总
软链接和硬链接的区别以及文件系统如何取文件
Many people think that the development logic of the metauniverse is consistent with that of the Internet, but I don't think so
招财喵|玉喵泰哥扑万两,梨花一支夏清雨
第二章 第四节:替换和切割
Section 13 of Chapter 2: intersection of set And Cross set
.NET Core 加载程序集AssemblyLoadContext
Research Report - visible light communication and visible light positioning
ASP.NET 学习篇(1)
Section 7 of Chapter 2: the concept of list
DAMA-第九章(文件与内容管理)