静态路由综合实验

实验需求:

1.除R5的环回地址固定5.5.5.0/24外,其他所有网段基于192.168.1.0/24进行合理的IP地址划分;
2.R1-R4每个路由器存在两个环回接口,用于模拟连接PC的网段,地址也在192.168.1.0/24这个网络范围内;
3.R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问;
4.全网可达,尽量减少每台路由器,路由表条目的数量,避免环路出现;
5.R4与R5间,正常1000M链路通信,故障时自动改为100M。

第一,规划IP地址

将192.168.1.0 24划分为5个大的网段(骨干链路、R1环回、R2环回、R3环回、R4环回),需借三位主机位,可分为8个网段。

骨干链路有6条,继续将192.168.1.0 27划分成6个小网段
(1)192.168.1.0 27——骨干链路
①192.168.1.0 30
②192.168.1.4 30
③192.168.1.8 30
④192.168.1.12 30
⑤192.168.1.16 30
⑥192.168.1.20 30

R1、R2、R3、R4的环回再划分出两个连续的小网段,分别给两个环回口,便于最后的汇总。
(2)192.168.1.32 27——R1环回
L0:192.168.1.32 28
L1:192.168.1.48 28
(3)192.168.1.64 27——
R2环回
L0:192.168.1.64 28
L1:192.168.1.80 28
(4)192.168.1.96 27——
R3环回
L0:192.168.1.96 28
L1:192.168.1.112 28
(5)192.168.1.128 27——
R4环回
L0:192.168.1.128 28
L1:192.168.1.144 28

剩下的网段为预留网段(地址规划的时候最好有预留,用于后续的升级)
(6)192.168.1.160 27
(7)192.168.1.192 27
(8)192.168.1.224 27

第二,配置IP地址

将所有节点和环回接口配置规划好的IP地址。

[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]int l1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1-LoopBack1]int g0/0/0  
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1  
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R1-GigabitEthernet0/0/1]q
[R1]display ip interface brief

 

[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]int l1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2-LoopBack1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]int g0/0/1 
[R2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[R2-GigabitEthernet0/0/1]q
[R2]display ip interface brief

[R3-LoopBack0]ip address 192.168.1.97 28
[R3-LoopBack0]int l1
[R3-LoopBack1]ip address 192.168.1.113 28
[R3-LoopBack1]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/0]int g0/0/1  
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[R3-GigabitEthernet0/0/1]q
[R3]display ip interface brief

[R4-LoopBack0]ip address 192.168.1.129 28
[R4-LoopBack0]int l1
[R4-LoopBack1]ip address 192.168.1.145 28
[R4-LoopBack1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]int e4/0/0  
[R4-Ethernet4/0/0]ip address 192.168.1.21 30
[R4-Ethernet4/0/0]q
[R4]display ip interface brief

[R5-LoopBack0]ip address 5.5.5.5 24
[R5-LoopBack0]int g0/0/0 
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30 
[R5-GigabitEthernet0/0/1]q
[R5]display ip interface brief

第三,配置路由,除5.5.5.0/24外,实现其他网段可达

[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.8 30 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.6
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.6
[R1]display ip routing-table protocol static
 

[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R2]ip route-static 192.168.1.4 30 192.168.1.1 
[R2]ip route-static 192.168.1.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.10
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.128 27 192.168.1.10   
[R2]ip route-static 192.168.1.16 30 192.168.1.10
[R2]display ip routing-table protocol static 
 

[R3]ip route-static 192.168.1.32 27 192.168.1.5
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 192.168.1.8 30 192.168.1.14  
[R3]ip route-static 192.168.1.128 27 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.14
[R3]display ip routing-table protocol static

[R4]ip route-static 192.168.1.64 27 192.168.1.9
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.32 27 192.168.1.9 
[R4]ip route-static 192.168.1.32 27 192.168.1.13 
[R4]ip route-static 192.168.1.4 30 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]display ip routing-table protocol static

[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.8 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.12 30 192.168.1.17 
[R5]display ip routing-table protocol static

第四,通过缺省访问R5后面的网段

在R1、R2、R3和R4上写上缺省,R1、R2、R3、R4便可以通过缺省连通5.5.5.5。

[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 192.168.1.18

第五,避免被动环路出现

这个网络拓扑没有主动环路,因为没有黑洞,但是可能会有被动环路。

若R1的某个环回接口断开,而R5正要连通这个环回接口,R1便会通过缺省路由回包,成死循环。
于是需要在汇总的网段上配空接口路由,当R5访问已断开的环回接口时,空接口路由可将其丢弃,避免环路出现。 

[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0

第六,正常时由1000M链路通讯,1000M链路故障时由100M链路通讯

将100M的链路的优先级改为61,而1000M的链路的优先级为60,使1000M的链路更优。

(一)正常情况下,R4的缺省路由加载了1000M的链路(下一跳为192.168.1.18);R5中,1000M的链路(下一跳为192.168.1.17)为最佳路径,100M的链路(下一跳为192.168.1.21)为备份路径。所以由1000M的链路通讯。 

在R4上添加下一跳为192.168.1.22的缺省,在R5上添加下一跳为192.168.1.21的路由,并将优先级修改为61。

[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R4]display ip routing-table

[R5]ip route-static 192.168.1.0 30 192.168.1.21 prepence 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61

(二)当1000M的链路故障时(例如:断开),便由100M的链路通讯。先关闭1000M的链路,再查看R4的路由表。

[R4-GigabitEthernet0/0/2]shutdown
[R4]display ip routing-table

此时R4的缺省路由加载了100M的链路(下一跳为192.168.1.22)。再进行检测,由R1及R1的环回pingR5的环回。

  • 7
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值