题目如下:
第一步,划分网段
从图中我们可以看出,这个网络中有15个局域网,但是R5的环回地址固定了,所以我们只需要划分出14个网段。
划分的网段如下:
192.168.1.0/28
192.168.1.16/28
192.168.1.32/28
192.168.1.48/28
192.168.1.64/28
192.168.1.80/28
192.168.1.96/28
192.168.1.112/28
192.168.1.128/28
192.168.1.144/28
192.168.1.160/28
192.168.1.176/28
192.168.1.192/28
192.168.1.208/28
192.168.1.224/28
192.168.1.240/28,这里一共划分出了16个网段,但是我们只选用其中的14个
分配好的网段如下图所示,为了减少路由黑洞的出现并且加快传输的效率,我对其中的某些网段进行了汇总,由于这里每个路由都是两个环回接口,所以这里不会产生路由黑洞了:
第二步,对这些路由器进行配置
要达到全网可达的需求,需要各个网段之间都能建立双向的连接,所以我们要对每个路由器中路由表中没有的信息进行配置。
首先R1
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.240
interface GigabitEthernet0/0/1
ip address 192.168.1.17 255.255.255.240
interface LoopBack0
ip address 192.168.1.97 255.255.255.240
interface LoopBack1
ip address 192.168.1.113 255.255.255.240
ip route-static 192.168.1.32 255.255.255.240 192.168.1.2
ip route-static 192.168.1.48 255.255.255.240 192.168.1.18
ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
ip route-static 192.168.1.128 255.255.255.224 192.168.1.18
ip route-static 192.168.1.160 255.255.255.240 192.168.1.2
ip route-static 192.168.1.160 255.255.255.240 192.168.1.18
ip route-static 192.168.1.176 255.255.255.240 192.168.1.2
ip route-static 192.168.1.176 255.255.255.240 192.168.1.18
ip route-static 192.168.1.192 255.255.255.224 192.168.1.2
ip route-static 192.168.1.192 255.255.255.224 192.168.1.18
R2
interface GigabitEthernet0/0/0
ip address 192.168.1.2 255.255.255.240
interface GigabitEthernet0/0/1
ip address 192.168.1.33 255.255.255.240
interface LoopBack0
ip address 192.168.1.65 255.255.255.240
interface LoopBack1
ip address 192.168.1.81 255.255.255.240
ip route-static 192.168.1.16 255.255.255.240 192.168.1.1
ip route-static 192.168.1.48 255.255.255.240 192.168.1.34
ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
ip route-static 192.168.1.128 255.255.255.224 192.168.1.1
ip route-static 192.168.1.128 255.255.255.224 192.168.1.34
ip route-static 192.168.1.160 255.255.255.240 192.168.1.34
ip route-static 192.168.1.176 255.255.255.240 192.168.1.34
ip route-static 192.168.1.192 255.255.255.224 192.168.1.34
R3
interface GigabitEthernet0/0/0
ip address 192.168.1.18 255.255.255.240
interface GigabitEthernet0/0/1
ip address 192.168.1.49 255.255.255.240
interface LoopBack0
ip address 192.168.1.129 255.255.255.240
interface LoopBack1
ip address 192.168.1.145 255.255.255.240
ip route-static 192.168.1.0 255.255.255.240 192.168.1.17
ip route-static 192.168.1.32 255.255.255.240 192.168.1.50
ip route-static 192.168.1.64 255.255.255.224 192.168.1.17
ip route-static 192.168.1.64 255.255.255.224 192.168.1.50
ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
ip route-static 192.168.1.160 255.255.255.240 192.168.1.50
ip route-static 192.168.1.176 255.255.255.240 192.168.1.50
ip route-static 192.168.1.192 255.255.255.224 192.168.1.50
R4
interface GigabitEthernet0/0/0
ip address 192.168.1.50 255.255.255.240
interface GigabitEthernet0/0/1
ip address 192.168.1.34 255.255.255.240
interface GigabitEthernet0/0/2
ip address 192.168.1.177 255.255.255.240
interface GigabitEthernet4/0/0
ip address 192.168.1.161 255.255.255.240
interface LoopBack0
ip address 192.168.1.193 255.255.255.240
interface LoopBack1
ip address 192.168.1.209 255.255.255.240
ip route-static 192.168.1.0 255.255.255.240 192.168.1.33
ip route-static 192.168.1.16 255.255.255.240 192.168.1.49
ip route-static 192.168.1.64 255.255.255.224 192.168.1.33
ip route-static 192.168.1.96 255.255.255.224 192.168.1.33
ip route-static 192.168.1.96 255.255.255.224 192.168.1.49
ip route-static 192.168.1.128 255.255.255.224 192.168.1.49
R5
interface GigabitEthernet0/0/0
ip address 192.168.1.178 255.255.255.240
interface GigabitEthernet0/0/1
ip address 192.168.1.162 255.255.255.240
interface LoopBack0
ip address 5.5.5.1 255.255.255.0
ip route-static 192.168.1.0 255.255.255.240 192.168.1.161
ip route-static 192.168.1.0 255.255.255.240 192.168.1.177 preference 61
ip route-static 192.168.1.16 255.255.255.240 192.168.1.161
ip route-static 192.168.1.16 255.255.255.240 192.168.1.177 preference 61
ip route-static 192.168.1.32 255.255.255.240 192.168.1.161
ip route-static 192.168.1.32 255.255.255.240 192.168.1.177 preference 61
ip route-static 192.168.1.48 255.255.255.240 192.168.1.161
ip route-static 192.168.1.48 255.255.255.240 192.168.1.177 preference 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.161
ip route-static 192.168.1.64 255.255.255.224 192.168.1.177 preference 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.161
ip route-static 192.168.1.96 255.255.255.224 192.168.1.177 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.161
ip route-static 192.168.1.128 255.255.255.224 192.168.1.177 preference 61
ip route-static 192.168.1.192 255.255.255.224 192.168.1.161
ip route-static 192.168.1.192 255.255.255.224 192.168.1.177 preference 61
第三步,需求要求R1-R4上不能直接编写到达5.5.5.0/24网段的静态路由,但依然可以访问
所以,我们采用缺省路由的方法来实现,缺省路由是当查表时,若所有路由条目均无法匹配时将匹配 缺省路由。
在R1-R4上都配置一下缺省路由
R1
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
R2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.34
R3
ip route-static 0.0.0.0 0.0.0.0 192.168.1.50
R4
ip route-static 0.0.0.0 0.0.0.0 192.168.1.162
第四步,R4和R5之间有两条线路,由于两条线路的传输速度并不相同,所以不能作为负载均衡来使用。但是可以作为备用线路使用,静态路由的优先级都是60,我们可以将100M的线路作为备用,通过将他的优先级降低的方式来实现。在上述配置的时候,我们已经设置过了。类似这种:
第五步,测试
这是R5的静态路由表
这是可以进行正常工作的,其中静态路由的优先级为60 此时也只能看到60的,当我们删掉其中一条过后,我们原来设置的备用线路就会浮现出来,此时再进行测试,我们还是可以正常ping通的。