一、实验要求
二、解题思路
1、r6为ISP,接口IP地址为公有地址,该设备只能配置IP地址,之后不能再对其进行其他配置;
为R6配置接口IP(56.1.1.2/24)和环回IP(6.6.6.6/24)即可。
2、r1-r5位局域网,私有IP地址192.168.1.0/24,请合理分配;
(1)环回加DHCP占5个网段,骨干占1个网段,所以192.168.1.0/24 划分8个网段(24-->27),还剩2个27网段;
(2)环回192.168.1.32/27----192.168.1.60/27,每个环回在划分2个网段(27-->28),DHCP192.168.1.96/27;
(3)骨干192.168.1.0/27,划分8个网段(27-->30),还剩2个30网段。
3、所有路由器上环回,均代表用户的接口;
一次配置路由的环回。
4、r3下的两台PC通过DHCP自动获取IP地址;
(1)开启DHCP服务,创建pool池,添加pool池的网段、网关和DNS;
(2)开启接口;
(3)在PC端上开启DHCP服务,自动获取IP地址。
5、选路最佳,路由表尽量小,避免环路;
选路最佳,路由表尽量小:先在各个路由起上均写上缺省(指向边界路由器方向),然后分析各个路由器到各个网段的最佳选路,如果缺省不是则手动添加该路由器到该网段的最佳路由即可。
避免环路:分析各个路由器的回环是否汇总,如果汇总了,就在该路由器上配置一条该汇总环回的空接口路由。
6、r1-r5均可访问r6的环回;
因为前面在边界路由器上配置了一条缺省指向公网,所以现在只需要在边界路由器上配置一条一对多的NAT,让出去的流量可以回来,就可以实现各个环回相互访问。
7、r6 telnet r5的公有地址时,实际登陆到r1上;
(1)在路由器r1上配置telnet账号、密码等;
(2)由于前面在边界路由器上配置了NAT,所以公网中的R6环回可以远程登陆R1,现在只需要在边界路由器上配置端口映射,将边界路由器的公有IP的23号端口与路由器R1的任意一个端口的私有IP地址的23号端口相互绑定即可。
8、r4与r5正常通过1000M链路,故障时通过100M链路。
在路由器R4、R5之间连接两条物理线路,将接口G0/0/2的那条线路的路由优先级别改成61,使他成为一个备份路由,当G4/0/0口的线路出现故障时,将自动启用优先级为61的G0/0/2的那条线路的备份路由,通讯将得以正常进行。
三、配置命令
实验拓扑图
1、各个路由器接口IP地址配置
R1:
[r1]interface GigabitEthernet0/0/0
[r1]ip address 192.168.1.1 30
[r1]interface GigabitEthernet0/0/1
[r1]ip address 192.168.1.5 30
R2:
[r2]interface GigabitEthernet0/0/0
[r2]ip address 192.168.1.2 30
[r2]interface GigabitEthernet0/0/1
[r2]ip address 192.168.1.9 30
R3:
[r3]interface GigabitEthernet0/0/0
[r3]ip address 192.168.1.13 30
[r3]interface GigabitEthernet0/0/1
[r3]ip address 192.168.1.6 30
R4:
[r4]interface GigabitEthernet0/0/0
[r4]ip address 192.168.1.10 30
[r4]interface GigabitEthernet0/0/1
[r4]ip address 192.168.1.14 30
[r4]interface GigabitEthernet0/0/2
[r4]ip address 192.168.1.21 30
[r4]interface GigabitEthernet4/0/0
[r4]ip address 192.168.1.17 30
R5:
[r5]interface GigabitEthernet0/0/0
[r5]ip address 192.168.1.22 30
[r5]interface GigabitEthernet0/0/1
[r5]ip address 56.1.1.1 24
[r5]interface GigabitEthernet0/0/2
[r5]ip address 192.168.1.18 30
R6:
[r6]interface GigabitEthernet0/0/0
[r6]ip address 56.1.1.2 24
2、各路由器环回IP地址配置
R1:
[r1]interface lo0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1]interface lo1
[r1-LoopBack0]ip address 192.168.1.49 28
R2:
[r2]interface lo0
[r2-LoopBack0]ip address 192.168.1.65 28
[r2]interface lo1
[r2-LoopBack0]ip address 192.168.1.81 28
R4:
[r4]interface lo0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4]interface lo1
[r4-LoopBack0]ip address 192.168.1.145 28
R5:
[r5]interface lo0
[r5-LoopBack0]ip address 192.168.1.161 28
R6:
[r6]interface lo0
[r6-LoopBack0]ip address 6.6.6.6 24
3、全网可达----缺省路由+静态路由+NAT
(1)配置缺省路由
R5:
ip route-static 0.0.0.0 0 56.1.1.1
R4:
ip route-static 0.0.0.0 0 192.168.1.18
R3:
ip route-static 0.0.0.0 0 192.168.1.14
R2:
ip route-static 0.0.0.0 0 192.168.1.10
R1:
ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.6
(2)手配静态路由(找到除缺省外的最佳选路)
R1-->192.168.1.64/27
[r1]ip route-static 192.168.1.64 27 192.168.1.2R1-->192.168.18/30
[r1]ip route-static 192.168.1.8 30 192.168.1.2R1-->192.168.1.96/27
[r1]ip route-static 192.168.1.96 27 192.168.1.6R1-->192.168.1.12/30
[r1]ip route-static 192.168.1.12 30 192.168.1.6R2-->192.168.1.32/27
[r2]ip route-static 192.168.1.32 27 192.168.1.1R2-->192.168.1.4/30
[r2]ip route-static 192.168.1.4 30 192.168.1.1R2-->192.168.1.96/27
[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
R3-->192.168.1.32/27
[r3]ip route-static 192.168.1.32 27 192.168.1.5R3-->192.168.1.0/30
[r3]ip route-static 192.168.1.0 30 192.168.1.5R3-->192.168.1.64/27
[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
R4-->192.168.1.64/27
[r4]ip route-static 192.168.1.64 27 192.168.1.9R4-->192.168.1.0/30
[r4]ip route-static 192.168.1.0 30 192.168.1.9R4-->192.168.1.96/27
[r4]ip route-static 192.168.1.96 27 192.168.1.13R4-->192.168.1.4/30
[r4]ip route-static 192.168.1.4 30 192.168.1.13R4-->192.168.1.32/27
[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
R5-->192.168.1.128/27
[r5]ip route-static 192.168.1.128 27 192.168.1.17R5-->192.168.1.64/27
[r5]ip route-static 192.168.1.64 27 192.168.1.17R5-->192.168.1.32/27
[r5]ip route-static 192.168.1.32 27 192.168.1.17R5-->192.168.1.96/27
[r5]ip route-static 192.168.1.96 27 192.168.1.17R5-->192.168.1.8/30
[r5]ip route-static 192.168.1.8 30 192.168.1.17R5-->192.168.1.0/30
[r5]ip route-static 192.168.1.0 30 192.168.1.17R5-->192.168.1.4/30
[r5]ip route-static 192.168.1.4 30 192.168.1.17R5-->192.168.1.12/30
[r5]ip route-static 192.168.1.12 30 192.168.1.17R5的备份路由(100M)
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 p 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 p 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 p 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 p 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 p 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 p 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 p 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 p 61
(3)NAT(一对多,让出去的流量可以回来,也是公网访问私网的转换接口)
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-GigabitEthernet0/0/1]nat outbound 2000
4、DHCP配置(r3、PC3、PC4)
启动DHCP服务:
[r3]dhcp enable
[r3]ip pool v2
[r3-ip-pool-v2]network 192.168.1.96 mask 27
[r3-ip-pool-v2]gateway-list 192.168.1.97
[r3-ip-pool-v2]dns-list 114.114.114.114 8.8.8.8
开启接口:
[r3-GigabitEthernet0/0/2]dhcp select global
5、Telnet远程登陆+端口映射
Telnet:
[r1]aaa
[r1-aaa]local-user zyk privilege level 15 password cipher 666666
[r1-aaa]local-user zyk service-type telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
端口映射:
[r5]interface g0/0/1
[r5-G0/0/1]nat server protocol tcp global current-intercafe 23 inside192.168.1.33 23
Are you sure to continue?[Y/N]:y
四、运行截图
1、R3下的PC1、PC2通过DHCP服务自动获取IP地址
2、R1-R5均可访问R6的环回
3、R6 telet R5的公有地址时,实登陆到R1上
4、R4与R5通讯,正常走1000M(G4/0/0),故障走100M(G0/0/2)。