计算机网络基础 ---- 静态路由----经典实验;看完保证你会透彻(详细解析,详细配置信息)

一、网络雏形:

在这里插入图片描述

二、实验要求:

  • 全网用192.168.1.0/24进行IP地址分配
  • R5作为DHCP服务器为PC分配地址
  • R1-R4上均县备2个环回地址
  • R4与R5之间正常走1000M,备份走100n
  • 全网尽量负载均衡
  • 减少路由表数量,并避免环路产生
  • 全网可达

三、思路分析:

(1)IP地址规划:

第一步:我们要进行合理的 IP地址规划,其目的就是我们在配置路由项时,减少路由的产生,并且防止出现路由黑洞

分析:

  • 题目要求每个路由器上要有两个环回接口,则可以先把这两个环回接口看成一个网段,在进行一分为二,防止产生路由黑洞;
  • 把主干电路看成一个网段,再进行划分;则大致分为4个环回接口,一个主干电路,一共5个网段;
  • 因需要5个网段,则应该网络位向主机位借3位,可以拿到8个网段,还剩3个网段进行后续的升级;
  • 主干电路的 ip一般只有两个,则直接借位到第30位,就有且仅有两个可用 IP;
  • 环回接口上可一分为二,便于汇总;

母网: 192.168.1.0/24-------192.168.00000001.00000000
主干电路:
192.168.00000001.000 00000 192.168.1.0/27
-----------------------------------------192.168.00000000.000 000 00 ---- 192.168.1.0/30
-----------------------------------------192.168.00000000.000 001 00 ---- 192.168.1.4/30
-----------------------------------------192.168.00000000.000 010 00 ---- 192.168.1.8/30
-----------------------------------------192.168.00000000.000 011 00 ---- 192.168.1.12/30
-----------------------------------------192.168.00000000.000 100 00 ---- 192.168.1.16/30
-----------------------------------------192.168.00000000.000 101 00 ---- 192.168.1.20/30
-----------------------------------------192.168.00000000.000 110 00 ---- 192.168.1.24/30
-----------------------------------------192.168.00000000.000 111 00 ---- 192.168.1.28/30
环回接口:
192.168.00000001.001 00000 192.168.1.32/27
-------------------------------------------------192.168.1.32/28
-------------------------------------------------192.168.1.48/28
192.168.00000001.010 00000 192.168.1.64/27
-------------------------------------------------192.168.1.64/28
-------------------------------------------------192.168.1.80/28
192.168.00000001.011 00000 192.168.1.96/27
-------------------------------------------------192.168.1.96/28
-------------------------------------------------192.168.1.112/28
192.168.00000001.100 00000 192.168.1.128/27
-------------------------------------------------192.168.1.128/28
-------------------------------------------------192.168.1.144/28
DHCP服务的网段:
192.168.00000001.110 00000 192.168.1.192/27
网络可进行升级的IP:
192.168.00000001.101 00000 192.168.1.160/27
192.168.00000001.111 00000 192.168.1.224/27

(2)进行配置IP:

  • 进入命令视图下配置即可,详细请浏览下方的配置信息;
  • 配置路由器接口的 IP;
  • 配置环回接口的 IP;

(3)配置路由项:

  • 根据规划好的网段,添加相应的路由项,配置的时候要注意掩码、下一跳是否正确
  • 如果碰到不易汇总的网段,可配置缺省路由,配置时要注意缺省路由的方向要相同,防止出现路由环路
  • 如果有备份路由,设置路由的优先级即可

(4)配置空接口路由:

当某个网段突然消失的时候,再和缺省路由相遇,很可能会出现路由环路,设置空接口路由防环;

四、配置:

(一)主干道路的 IP添加:

(1)R1设备 IP地址的添加:

<Huawei>system-view
[Huawei]sysname R1
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]quit
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30

(2)R2设备 IP地址的添加:

<Huawei>system-view
[Huawei]sysname R2
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]quit
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30

(3)R3设备 IP地址的添加:

<Huawei>system-view
[Huawei]sysname R3
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R3-GigabitEthernet0/0/0]quit
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30

(4)R4设备 IP地址的添加:

<Huawei>system-view 
[Huawei]sysname R4
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R4-GigabitEthernet0/0/0]quit
[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]quit
[R4]interface g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]quit
[R4]interface g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30

(5)R5设备 IP地址的添加:

<Huawei>system-view 
[Huawei]sysname R5
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]quit
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/1]quit
[R5]interface g0/0/2
[R5-GigabitEthernet0/0/2]ip add 192.168.1.193 27

(二)环回接口的 IP添加:

(1)R1设备的环回接口:

[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]quit
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28

(2)R2设备的环回接口:

[R2]interface LoopBack 0
[R2-LoopBack0]ip add 192.168.1.97 28
[R2-LoopBack0]quit
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.113 28

(3)R3设备的环回接口:

[R3]interface LoopBack 0
[R3-LoopBack0]ip add 192.168.1.65 28
[R3-LoopBack0]quit
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 192.168.1.81 28

(4)R4设备的环回接口:

[R4]interface LoopBack 0
[R4-LoopBack0]ip add 192.168.1.129 28
[R4-LoopBack0]quit
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.145 28

(5)R5设备的环回接口:

[R5]interface LoopBack 0
[R5-LoopBack0]ip add 192.168.1.161 28
[R5-LoopBack0]quit
[R5]interface LoopBack 1
[R5-LoopBack1]ip address 192.168.1.177 28

(三)配置路由项:

(1)R1设备的路由项:

[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
[R1]ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
[R1]ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
[R1]ip route-static 192.168.1.16 255.255.255.252 192.168.1.2
[R1]ip route-static 192.168.1.16 255.255.255.252 192.168.1.10
[R1]ip route-static 192.168.1.64 255.255.255.224 192.168.1.10
[R1]ip route-static 192.168.1.96 255.255.255.224 192.168.1.2
[R1]ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
[R1]ip route-static 192.168.1.128 255.255.255.224 192.168.1.10

(2)R2设备的路由项:

[R2]ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
[R2]ip route-static 192.168.1.8 255.255.255.252 192.168.1.1
[R2]ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
[R2]ip route-static 192.168.1.16 255.255.255.252 192.168.1.6
[R2]ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
[R2]ip route-static 192.168.1.64 255.255.255.224 192.168.1.1
[R2]ip route-static 192.168.1.64 255.255.255.224 192.168.1.6
[R2]ip route-static 192.168.1.128 255.255.255.224 192.168.1.6

(3)R3设备的路由项:

[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
[R3]ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
[R3]ip route-static 192.168.1.4 255.255.255.252 192.168.1.14
[R3]ip route-static 192.168.1.16 255.255.255.252 192.168.1.14
[R3]ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
[R3]ip route-static 192.168.1.96 255.255.255.224 192.168.1.9
[R3]ip route-static 192.168.1.96 255.255.255.224 192.168.1.14
[R3]ip route-static 192.168.1.128 255.255.255.224 192.168.1.14

(4)R4设备的路由项:

[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
[R4]ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
[R4]ip route-static 192.168.1.8 255.255.255.252 192.168.1.13
[R4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
[R4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
[R4]ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
[R4]ip route-static 192.168.1.64 255.255.255.224 192.168.1.18
[R4]ip route-static 192.168.1.96 255.255.255.224 192.168.1.5

(5)R5设备的路由项:

[R5]ip route-static 192.168.1.4 30 192.168.1.17 
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.17

(6)配置浮动静态路由做备份:

[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61

[R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61

(四)空接口路由配置:

(1)R1的空接口路由:

[R1]ip route-static 192.168.1.32 27 NULL 0

(2)R2的空接口路由:

[R2]ip route-static 192.168.1.96 27 NULL 0

(3)R3的空接口路由:

[R3]ip route-static 192.168.1.64 27 NULL 0

(4)R4的空接口路由:

[R4]ip route-static 192.168.1.128 27 NULL 0

(五)测试连通性:

用PC1主机 ping R1设备上的环回接口:
在这里插入图片描述

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Murphy_Biao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值