前言:
经过一系列的理论知识学习,接下来我们将使用ENSP进行我们的第一个实验,也就是关于静态路由的相关配置。本次实验涉及的知识点包括但不限于:IP地址配置方法、环回地址配置方法、合理进行子网汇总、缺省路由、空路由接口、浮动静态路由等知识点。
内容:
实验题目:
1,分析题目
首先让我们看一下题目要求:
1.1
该网络拓扑图中拥有14个广播域,所以我们基于192.168.1.0/24划分出十四个网段,并根据顺时针方向分别对GE口进行分配IP地址,对AR5进行环回地址配置。
AR1-AR2为192.168.1.0/30
AR2-AR4为192.168.1.4/30
AR4-AR3为192.168.1.8/30
AR4-AR1为192.168.1.12/30
AR4-AR5下方G0/0/2-G0/0/0为192.168.1.20/30
AR4-AR5上方G4/0/0-G0/0/1为192.168.1.16/30
1.2
AR1-AR5每个路由器配置两个环回接口,我们从192.168.1.32/28到192.168.1.128/28进行分配。
1.3
通过利用缺省路由(默认路由)进行低保保护,让数据包从0.0.0.0/0地址访问5.5.5.0/24。
1.4
通过合理子网手工汇总,减少路由条目数量,合理利用空路由接口,避免环路出现。
1.5
AR4与AR5之间运用浮动静态路由完成题目要求。
二,实验操作
2.1
打开ENSP,搭建好网络拓扑图,并开启设备,网线接口为绿色即为启动成功。
2.2
点击AR1进入配置页面,
通过system-view 进入[huawei],sysname r1改名,并依次重复以上操作,实现r1,r2,r3,r4,r5
interface g0/0/0接口进行ip address 192.168.1.1配置,通过interface LoopBack配置环回地址
配置完成后可以用display进行查看:
r1:
r2:
r3:
r4:
r5:
2.3
通过利用缺省路由实现低保,即使不用编写静态路由依然可以访问5.5.5.0/24网段。
知识点:缺省路由--- 华为体系中也叫默认路由。一旦路由黑洞和缺省路由相遇,将100%出现路
由环路。
缺省路由就是一条不限定目标的路由条目。缺省路由一定是路由表中所有路由条目都无法匹配时,才最后匹配。
[r1]ip route-static 0.0.0.0 0 就近原则
每个路由器之间需要进行互相访问需要通过[r1]ip route-static命令来写入路由表,使数据包访问时知道下一跳的地址与路由条目。
2.4
利用“取相同,去不同”对环回地址进行手工汇总可以尽量减少路由条目
r1:
192.168.1.32/28
192.168.1.48/28
192.168.1.00100000/28
192.168.1.00110000/28
子网汇总:192.168.1.32/27
r2:
192.168.1.64/28
192.168.1.80/28
192.168.1.01000000/28
192.168.1.01010000/28
子网汇总:192.168.1.64/27
r3:
192.168.1.96/28
192.168.1.112/28
192.168.1.01100000/28
192.168.1.01110000/28
子网汇总:192.168.1.96/27
r4:
192.168.1.144/28
192.168.1.128/28
192.168.1.10010000/28
192.168.1.10000000/28
子网汇总:192.168.1.128/27
2.6
为避免环路出现,使用空接口路由
NULL0 --- 空接口 --- 虚拟接口 --- 如果一条路由条目,出接口为空接口,则如果匹配到这条路由条目,则将直接丢弃该数据包。
[r1]ip route-static 地址 NULL 0
r1:r1-r4路由表内容设置基本一致,不进行图片演示
只需要看Static即可
r5:
2.7
浮动静态路由 --- 通过修改默认的优先级,实现静态路由的备份效果。
[r5]ip route-static 0.0.0.0 0 192.168.1.22 preference 70 --- 手动修改静态路由的优先级
[r5]display ip routing-table protocol static --- 过滤静态路由
[r5-GigabitEthernet0/0/0]shutdown --- 手动关闭接口
三,实验结果
3.1 全网可达:
[r2]ping 192.168.1.32
PING 192.168.1.32: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.33: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 192.168.1.33: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.1.33: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.1.33: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 192.168.1.33: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.32 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/26/30 ms
[r2]ping 192.168.1.364
Error: Unknown host 192.168.1.364.
[r2]ping 192.168.1.64
PING 192.168.1.64: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.65: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 192.168.1.65: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.65: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.65: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.65: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.1.64 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/4/20 ms
[r2]ping 192.168.1.96
PING 192.168.1.96: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.97: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 192.168.1.97: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.1.97: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.1.97: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 192.168.1.97: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.96 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/30 ms
[r2]ping 192.168.1.128
PING 192.168.1.128: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.129: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 192.168.1.129: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 192.168.1.129: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 192.168.1.129: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.1.129: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 192.168.1.128 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/30/30 ms
[r2]ping 192.168.1.18
PING 192.168.1.18: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.18: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 192.168.1.18: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.1.18: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 192.168.1.18 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/36/40 ms
[r2]ping 192.168.1.22
PING 192.168.1.22: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.22: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 192.168.1.22: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 192.168.1.22: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 192.168.1.22: bytes=56 Sequence=4 ttl=254 time=40 ms
Reply from 192.168.1.22: bytes=56 Sequence=5 ttl=254 time=20 ms
--- 192.168.1.22 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/32/40 ms
3.2 通过缺省路由访问5.5.5.0/24:
r1:
r2:
r3:
r4:
3.3 r5G0/0/0口断开后,由优先级为70的的100M链路通信:
总结:
还是多注意实验操作,将理论知识运用到实际操作中,细心划分好子网。最后希望大家开心每一天,心想事成,万事如意!