实验要求:
1、根据实验要求,我们首先在Cisco packet tracer模拟器中搭建此网络拓扑图
2、然后我们就要开始做很重要的一步,就是地址规划。
R1-R4各需要4个环回,然后路由器的每一个接口需要一个网段,则一共需要14个网段。
常规思路:
将172.16.0.0/16借4位然后进行子网划分,从划分出来的16个子网中拿14进行使用。
但是这样会出现一种弊端,在实际的配置过程当中,进行手工汇总的时候就会出现好多掩码不同的子网,当路由器查表按照最长匹配原则查表的时候可能导致出环的现象发生。
正确的常用地址规划思路:
因为实际上在具体配置的时候,R1-R4这几个路由器上每两个环回路由都将被手工汇总为掩码相同的子网,才可以让每一个路由器都想通,所以我们可以先给每一个路由器配一个地址,然后再子网划分为两个子网掩码都相同的子网即可;同样,每一条干道(就是两路由器相连的)
地址规划完成:
3、然后就进入到了我们的配置阶段
(1)先从底层开始配起
(2)然后进入到我们的路由配置阶段
检验:
R1向R5ping
r1#ping 172.16.0.18
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.18, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r1#ping 172.16.0.18
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.18, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
r1#ping 172.16.0.22
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
r1#
R5ping内网:
r5#ping 172.16.32.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.32.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r5#ping 172.16.48.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.48.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r5#ping 172.16.64.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.64.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms
r5#ping 172.16.80.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.80.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r5#ping 172.16.96.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.96.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r5#ping 172.16.112.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.112.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
r5#ping 172.16.128.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.128.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
r5#ping 172.16.144.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.144.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
r5#ping 172.16.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/2 ms
r5#ping 172.16.0.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/2 ms
r5#ping 172.16.0.9
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.9, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
r5#ping 172.16.0.13
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.13, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r5#
要想上网,与运营商互通,必须配置缺省路由。
r1#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
r1#
经检验,全网可达。
(3)然后按照实验要求,我们给R5配置浮动静态路由
(4)最后,我们要考虑到出环现象,所以要配置空接口来防止出环。
给每一个路由器配置自己的空接口防环就OK!
r1(config)#ip route 172.16.32.0 255.255.224.0 null ?
<0-0> Null interface number
r1(config)#ip route 172.16.32.0 255.255.224.0 null 0
r1(config)#
r2>en
r2#conf t
r2(config)#ip route 172.16.64.0 255.255.224.0 null 0
r2(config)#
r3>en
r3#conf t
r3(config)#ip route 172.16.96.0 255.255.224.0 null 0
r3(config)#
r4(config)#ip route 172.16.128.0 255.255.224.0 null 0
r4(config)#
4、减少路由条目,优化
其实我们前面手工配置的静态路由都可以省略,直接配缺省路由就可以通。