1 R6为isp,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能再对其进行任何配置;
2 R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3 所有路由器上环回,均代表连接用户的接口;
4 R3下的两台PC通过DHCP自动获取IP地址
5 选路最佳,路由表尽量小,避免环路;
6 R1-R5均可访问R6的环回
7 R6 telnet R5的公有IP地址时,实际登陆到R1上
8 R4与R5正常通过1000链路,故障时通过100兆链路;
第一步:
划分网段
根据题目要求,除R6以外,有6条骨干链路,9个环回接口,所以一共有15个广播域,
为了方便汇总,我们将R1-R5两两环回各一个网段,6条骨干看成一条网段
所以我们需要6个网段,则需要划分3个网络位,多余2个网段则不用,可留作备用
(6条骨干链路,每条骨干链路只需2个IP,所以用30位掩码)
192.168.1.0/24
192.168.1.00000000/24
192.168.1.000 00000/27(骨干需要6个)
192.168.1.000 000 00/30 => 192.168.1.0/30
192.168.1.000 001 00/30 => 192.168.1.4/30
192.168.1.000 010 00/30 => 192.168.1.8/30
192.168.1.000 011 00/30 => 192.168.1.12/30
192.168.1.000 100 00/30 => 192.168.1.16/30
192.168.1.000 101 00/30 => 192.168.1.20/30
192.168.1.000 110 00/30(备用)
192.168.1.000 111 00/30(备用)
192.168.1.001 00000/27(环回1)
192.168.1.001 0 0000/28 => 192.168.1.32/28
192.168.1.001 1 0000/28 => 192.168.1.48/28
192.168.1.010 00000/27(环回2)
192.168.1.010 0 0000/28 => 192.168.1.64/28
192.168.1.010 1 0000/28 => 192.168.1.80/28
192.168.1.011 00000/27(环回3) ---R3的网段地址
192.168.1.011 0 0000/28 => 192.168.1.96/28
192.168.1.011 1 0000/28 => 192.168.1.112/28
192.168.1.100 00000/27(环回4)
192.168.1.100 0 0000/28 => 192.168.1.128/28
192.168.1.100 1 0000/28 => 192.168.1.144/28
192.168.1.101 00000/27(环回5) ---R5只需一个环回地址
192.168.1.101 0 0000/28 => 192.168.1.160/28
192.168.1.101 1 0000/28 => 192.168.1.176/28
192.168.1.110 00000/27(备用)
192.168.1.111 00000/27(备用)
如图所示:
第二步:
配置接口IP和环回路由IP:
R1:
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack1]ip address 192.168.1.49 28
R2:
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r2-LoopBack0]ip address 192.168.1.65 28
[r2-LoopBack1]ip address 192.168.1.81 28
R3:
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27 ------配置网关IP
R4:
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack1]ip address 192.168.1.145 28
R5:
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/2]ip address 56.1.1.1 24
[r5-LoopBack0]ip address 192.168.1.161 28
R6:
[r6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
[r6-LoopBack0]ip address 6.6.6.6 24
第三步:
R3下DHCP配置:
[r3]dhcp enable
[r3]ip pool 1
[r3-ip-pool-1]network 192.168.1.96 mask 27
[r3-ip-pool-1]gateway-list 192.168.1.97
[r3-ip-pool-1]dns-list 8.8.8.8
[r3]int g 0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global ##开启接口采用全局地址池的DHCP Server功能
查看PC1的 IP:
查看PC2的 IP:
第四步:
配置缺省路由:
R1:
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6
R2:
[r2]ip route-static 0.0.0.0 0 192.168.1.10
R3:
[r3]ip route-static 0.0.0.0 0 192.168.1.14
R4:
[r4]ip route-static 0.0.0.0 0 192.168.1.18
R5:
[r5]ip route-static 0.0.0.0 0 56.1.1.2
现在需要做的是,到某一条线路缺省可能不是最佳的路由,我们需要填上它的静态路由
R1:
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6
R2:
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.1
R3:
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[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:
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[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
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.96 27 192.168.1.13
R5:
ip route-static 192.168.1.32 27 192.168.1.17
ip route-static 192.168.1.64 27 192.168.1.17
ip route-static 192.168.1.96 27 192.168.1.17
ip route-static 192.168.1.128 27 192.168.1.17
ip route-static 192.168.1.0 30 192.168.1.17
ip route-static 192.168.1.4 30 192.168.1.17
ip route-static 192.168.1.8 30 192.168.1.17
ip route-static 192.168.1.12 30 192.168.1.17
R4配置备用线路:
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
R5配置
ip route-static 192.168.1.32 27 192.168.1.21 pr 61
ip route-static 192.168.1.64 27 192.168.1.21 pr 61
ip route-static 192.168.1.96 27 192.168.1.21 pr 61
ip route-static 192.168.1.128 27 192.168.1.21 pr 61
ip route-static 192.168.1.0 30 192.168.1.21 pr 61
ip route-static 192.168.1.4 30 192.168.1.21 pr 61
ip route-static 192.168.1.8 30 192.168.1.21 pr 61
ip route-static 192.168.1.12 30 192.168.1.21 pr 61
现在内网都做通了,现在需要做的是访问外网
所以在R5g0/0/2接口做个acl
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-GigabitEthernet0/0/2]nat outbound 2000
避免环路,需要配置空接口
空接口配置:
[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0
首先打开R1的telnet服务:
[r1]aaa
[r1-aaa]local-user haha privilege level 15 password cipher 123123
Info: Add a new user.
定义一下这个账号的作用
[r1-aaa]local-user haha service-type telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
现在来做一下映射
在R5的0/0/2接口上
[r5-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
R6 telnet 56.1.1.1,登录到R1的192.168.1.1
实验完成!