静态路由综合性实验,首先我们了解一下这次实验的知识点
静态的扩展配置:
同时,可用于实验环境中,模拟连接PC终端的用户接口,来减少实际设备成本需求;
若路由器需要访问多个连续子网,且具有相同的下一跳;可以将这些网段进行汇总计算;之后仅编写到达汇总网段路由即可;---节省路由表条目数量
汇总地址中包含了,网络内实际不存在的网段时;让将导致流量有去无回;浪费链路资源;
建议合理的ip地址规划(便于无黑洞汇总),尽量精确汇总;
当路由黑洞与缺省路由相遇时,将必然出现环路;
在黑洞路由器上,配置一条到达汇总网段的空接口路由;空接口及丢弃流量;来避免环路的产生;
不同方式产生到路由表中条目,其优先级不同;直连=0 静态=60
优先级取值范围 0-255 越小越好;
根据题目条件和拓扑设计先对192.168.1.0/24进行子网划分
这个实验拓扑设计以及路由器接口IP环回接口汇总如下图
在开启设备前记得一定要先个R4增加一个接口
首先对个路由器接口配置IP地址以及下一跳端口
R1
[R1]int g0/0/0
[R1]ip add 192.168.1.1 30
[R1]int g0/0/1
[R1]ip add 192.168.1.5 30
[R1]int loo0
[R1]ip add 192.168.1.33 28
[R1]int loo1
[R1]ip add 192.168.1.49 28
[R1]ip route-static 192.168.1.64 27 192.168.1.6
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.12 30 192.168.1.2
[R1]ip route-static 192.168.1.8 30 192.168.1.6
[R1]ip route-static 192.168.1.128 27 192.168.1.10
[R1]ip route-static 192.168.1.128 27 192.168.1.14
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.10
[R1]ip route-static 192.168.1.16 30 192.168.1.14
R2
[R2]int g0/0/0
[R2]ip add 192.168.1.6 30
[R2]int g0/0/1
[R2]ip add 192.168.1.9 30
[R2]int loo0
[R2]ip add 192.168.1.65 28
[R2]int loo1
[R2]ip add 192.168.1.81 28
[R2]ip route-static 192.168.1.0 30 192.168.1.5
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.16 30 192.168.1.10
[R2]ip route-static 192.168.1.16 30 192.168.1.14
[R2]ip route-static 192.168.1.32 27 192.168.1.5
[R2]ip route-static 192.168.1.128 27 192.168.1.10
[R2]ip route-static 192.168.1.96 27 192.168.1.13
[R2]ip route-static 192.168.1.96 27 192.168.1.2
R3
[R3]int g0/0/0
[R3]ip add 192.168.1.2 30
[R3]int g0/0/1
[R3]ip add 192.168.1.13 30
[R3]int g0/0/0
[R3]ip add 192.168.1.2 30
[R3]int g0/0/1
[R3]ip add 192.168.1.13 30
[R3]ip route-static 192.168.1.4 30 192.168.1.1
[R3]ip route-static 192.168.1.8 30 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.10
[R3]ip route-static 192.168.1.32 27 192.168.1.1
ip route-static 192.168.1.128 27 192.168.1.14
[R3]ip route-static 192.168.1.64 27 192.168.1.6
[R3]ip route-static 192.168.1.64 27 192.168.1.9
R4
[R4]int g0/0/0
[R4]ip add 192.168.1.10 30
[R4]int g0/0/1
[R4]ip add 192.168.1.14 30
[R4]int g0/0/2
[R4]ip add 192.168.1.17 30
[R4]int g4/0/0
[R4]ip add 192.168.1.21 30
[R4]int loo0
[R4]ip add 192.168.1.115 28
[R4]int loo1
[R4]ip add 192.168.1.129 28
[R4]ip route-static 192.168.1.0 30 192.168.1.13
[R4]ip route-static 192.168.1.4 30 192.168.1.9
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.1
[R4]ip route-static 192.168.1.32 27 192.168.1.5
R5
[R5]int g0/0/1
[R5]ip add 192.168.1.18 30
[R5]int g0/0/0
[R5]ip add 192.168.1.22 30
[R5]int loop0
[R5]ip add 5.5.5.2 24
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 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.4 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
要达到全网可通,下来我们要给每个路由器配置省缺路由
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 192.168.1.6
[R2]ip route-static 0.0.0.0 0 192.168.1.10
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 p 61 (选择优先级)
此时我们已经达到全网可通
用R1去pingR5的环回接口
最后完成正常1000m故障100m
对R5选择优先级
[R5]ip route-static 192.168.1.32 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.128 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 p 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 p 61
[R5][R5]ip route-static 192.168.1.8 30 192.168.1.21 p 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 p 61
接下来我们查询R5的路由表
并没有显示我们刚设置的优先级
通过模拟故障,关闭 g0/0/1 192.168.1.18这个接口
[R5]int g0/0/1
[R5]shutdown
再次查看路由表
OK成功
最后一步为环路和黑洞的出现增加一个空接口
[R1]ip route-static 192.168.1.32 27 NULL0
[R2]ip route-static 192.168.1.64 27 NULL0
[R3]ip route-static 192.168.1.96 27 NULL0
[R4]ip route-static 192.168.1.128 27 NULL0
此刻我们的实验就完成了