静态路由试验
试验要求:
1、内网IP基于172.16.0.0/16自行进行子网划分
2、除了Router2–Router3路由器各有两个环回接口
3、Router1下的PC自动获取IP地址
4、全网可达
5、尽量减少路由条目
6、Router4–Router5之间正常走100M线路,100M故障走10M,备份
一、拓扑结构图
二、试验总体配置思路:
总体配置思路:
(1)先规划IP地址;
(2)各个路由器基本配置;
(3)Router1配置两个DHCP地址池;
(4)配置各个路由器之间的路由(注意进行汇总,实现减少路由条目);
(5)Router3到Router5之间进行路径备份;
(6)缺省、Router1空口防环;
(7)测试是否全网可达;
(8)实验完成。
1、IP地址规划:
(1)、可将172.16.0.0/16的大网段划分为两个网段,一个骨干,一个分支
172.16.0.0/17 //骨干
172.16.128.0/1 //分支
(2)、给骨干路由器之间规划两个ip即可:
172.16.0.0/17划分为掩码为30的网段
172.16.0.0/30 172.16.0.4/30 172.16.0.8/30
172.16.0.12/30 172.16.0.16/30 172.16.0.20/30
……
从中取出6个网段分配给路由器即可。
(3)、开始划分支网段(将其划分为两个子网,以便后期汇总)
172.16.128.0/17划分为两个网段为:
172.16.128.0/18 172.16.192.0/18
2、IP地址划分完成后进行基本配置(基本的接口地址配置,DHCP服务器的配置)。
Route1配置思路:
基本配置:
Router1>enable
Router1#config
Router1(config)# interface f 0/0
Router1(config-if)#ip address 172.16.0.1 255.255.255.252
Router1(config-if)#no shutdown
Router1(config)#exit
Router1(config)# interface f 0/1
Router1(config-if)#ip address 172.16.0.13 255.255.255.252
Router1(config-if)#no shutdown
Router1(config)#exit
Router1(config)# interface f 1/0
Router1(config-if)#ip address 172.16.128.1 255.255.192.0
Router1(config-if)#no shutdown
Router1(config)#exit
Router1(config)# interface f 1/1
Router1(config-if)#ip address 172.16.192.1 255.255.192.0
Router1(config-if)#no shutdown
Router1(config)#exit
配置DHCP地址池:(需要两个DHCP服务器)
Router1(config)#ip dhcp pool haha
Router1(dhcp-config)#default-router 172.16.128.1
Router1(dhcp-config)#dns-server 114.114.114.114
Router1(dhcp-config)#network 172.16.128.0 255.255.192.0
Router1(dhcp-config)#exit
Router1(config)#ip dhcp pool hehe
Router1(dhcp-config)#default-router 172.16.192.1
Router1(dhcp-config)#dns-server 114.114.114.114
Router1(dhcp-config)#network 172.16.192.0 255.255.192.0
Router1(dhcp-config)#exit
让pc自行获取ip地址即可
Router2配置思路:
基本配置:
Router2>enable
Router2#config
Router2(config)#interface f 0/1
Router2(config-if)#ip address 172.16.0.2 255.255.255.252
Router2(config-if)#no shutdown
Router(config-if)#exit
Router2(config)#interface f 0/0
Router2(config-if)#ip address 172.16.0.5 255.255.255.252
Router2(config-if)#no shutdown
Router2(config-if)#exit
Router3配置思路:
基本配置:
Router3>enable
Router3#config
Router3(config)#interface f 0/1
Router3(config-if)#ip address 172.16.0.6 255.255.255.252
Router3 (config-if)#no shutdown
Router3(config-if)#exit
Router3(config)#interface f 0/0
Router3(config-if)#ip address 172.16.0.10 255.255.255.252
Router3(config-if)#no shutdown
Router3(config-if)#exit
Router3(config)#interface f 1/0
Router3(config-if)#ip address 172.16.0.17 255.255.255.252
Router3(config-if)#no shutdown
Router3(config-if)#exit
Router3(config)#interface f 1/1
Router3(config-if)#ip address 172.16.0.21 255.255.255.252
Router3(config-if)#no shutdown
Router3(config-if)#exit
Router4配置思路:
基本配置:
Router4>enable
Router4#config
Router4(config)#interface f 0/1
Router4(config-if)#ip address 172.16.0.9 255.255.255.252
Router4 (config-if)#no shutdown
Router4(config-if)#exit
Router4(config)#interface f 0/0
Router4(config-if)#ip address 172.16.0.14 255.255.255.252
Router4 (config-if)#no shutdown
Router4(config-if)#exit
Router5配置思路:
基本配置:
Router5>enable
Router5#config
Router5(config)#interface f 0/0
Router5(config-if)#ip address 172.16.0.18 255.255.255.252
Router5(config-if)#no shutdown
Router5(config-if)#exit
Router5(config)#interface f 0/1
Router5(config-if)#ip address 172.16.0.22 255.255.255.252
Router5(config-if)#no shutdown
Router5(config-if)#exit
Router5(config)#interface f 1/0
Router5(config-if)#ip address 10.1.1.1 255.255.255.0
Router5(config-if)#no shutdown
Router5(config-if)#exit
配置外网DHCP服务器:
Router5(config)#ip dhcp pool hehe
Router5(dhcp-config)#default-router 10.1.1.1
Router5(dhcp-config)#dns-server 8.8.8.8
Router5(dhcp-config)#network 10.1.1.0 255.255.255.0
Router5(dhcp-config)#exit
让其外网PC自动获取即可:
3、给每个路由器写静态路由(实现基本的全网可达)
Router1配置:
Router1(config)#ip route 172.16.0.4 255.255.255.252 172.16.0.2
Router1(config)#ip route 172.16.0.8 255.255.255.252 172.16.0.14
Router1(config)#ip route 172.16.0.16 255.255.255.252 172.16.0.2
Router1(config)#ip route 172.16.0.16 255.255.255.252 172.16.0.4
Router1(config)#ip route 172.16.0.20 255.255.255.252 172.16.0.2
Router1(config)#ip route 172.16.0.20 255.255.255.252 172.16.0.14
两条缺省,指向外网:
Router1(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.2
Router1(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.14
Router2配置:
Router2(config)#ip route 172.16.0.12 255.255.255.252 172.16.0.1
Router2(config)#ip route 172.16.0.8 255.255.255.252 172.16.0.6
Router2(config)#ip route 172.16.0.16 255.255.255.252 172.16.0.6
Router2(config)#ip route 172.16.0.20 255.255.255.252 172.16.0.6
配置去往Router1内网的路由:(进行手工汇总)
Router2(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.1
配置去往外网的缺省路由:
Router2(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.6
空接口防环:(因为在R1上存在环路问题)
Router2(config)#ip route 172.16.128.0 255.255.192.0 null 0
Router3配置:
Router3(config)#ip route 172.16.0.0 255.255.255.252 172.16.0.5
Router3(config)#ip route 172.16.0.12 255.255.255.252 172.16.0.9
配置去往R1内网的路由:(进行手工汇总)
Router3(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.9
配置去往外网的缺省路由:
Router3(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.18 100(通过加大优先级,将此路径变为备份路径)
Router3(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.22
空接口防环:(因为在R1上存在环路问题)
Router3(config)#ip route 172.16.128.0 255.255.192.0 null 0
Router3(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.9
Router4配置:
Router4(config)#ip route 172.16.0.0 255.255.255.252 172.16.0.13
Router4(config)#ip route 172.16.0.4 255.255.255.252 172.16.0.10
Router4(config)#ip route 172.16.0.16 255.255.255.252 172.16.0.10
Router4(config)#ip route 172.16.0.20 255.255.255.252 172.16.0.10
配置去往router1内网的路由:(进行手工汇总)
Router4(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.13
配置去往外网的缺省路由:
Router4(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.10
空接口防环:(因为在route1上存在环路问题)
Router4(config)#ip route 172.16.128.0 255.255.192.0 null 0
Router5配置:
(注意:因为Router5在外网,所以不能向内网做缺省路由,只能写明细路由)
Router5(config)#ip route 172.16.0.0 255.255.255.252 172.16.0.17 100
Router5(config)#ip route 172.16.0.0 255.255.255.252 172.16.0.21
Router5(config)#ip route 172.16.0.12 255.255.255.252 172.16.0.17 100
Router5(config)#ip route 172.16.0.12 255.255.255.252 172.16.0.21
Router5(config)#ip route 172.16.0.4 255.255.255.252 172.16.0.17 100
Router5(config)#ip route 172.16.0.4 255.255.255.252 172.16.0.21
Router5(config)#ip route 172.16.0.8 255.255.255.252 172.16.0.17 100
Router5(config)#ip route 172.16.0.8 255.255.255.252 172.16.0.21
配置去往router1内网的路由:(进行手工汇总)
Router5(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.17 100
Router5(config)#ip route 172.16.128.0 255.255.192.0 172.16.0.21
空接口防环:(因为在Router1上存在环路问题)
Router5(config)#ip route 172.16.128.0 255.255.192.0 null 0
查看Router4和Router5路由表:
Router4路由表:
Router# show ip route
Router5路由表:
测试:用互联网PC ping route1内网PC0:
测试成功,实验完成!