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