实验要求:
1-R6为isp,接口IP地址均为公有地址,该设备只能配置Ip地址,之后不能再对其进行任何配置;
2-R1—R5为局域网,私有IP地址192.168. 1.0/24,请合理分配,
3-所有路由器上环回,均代表连接用户的接口;
4-R3下的两台PC通过DHCP自动获取P地址
5-选路最佳,路由表尽量小,避免环路:
6-R1-R5均可访问R6的环回
7-R6telnetR5的公有IP地址时,实际登陆到R1上
8-R4与R5正常通过1000链路,故障时通过100兆链路;
实验拓扑:第一步:ip地址规划
192.168.1.0/24
路由器网段:192.168.1.32/27;192.168.1.64/27;192.168.1.96/27;192.168.1.128/27;192.168.1.160/27;192.168.1.192/27;192.168.1.224/27
骨干:192.168.1.0/30 ;192.168.1.4/30; 192.168.1.8/30; 192.168.1.12/30;192.168.1.16/30;192.168.1.20/30
第二部:端口以及环回接口的配置
R1:
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r1-LoopBack1]ip address 192.168.1.33 28
[r1-LoopBack2]ip address 192.168.1.49 28
R2:
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2-LoopBack1]ip add 192.168.1.65 28
[r2-LoopBack2]ip add 192.168.1.81 28
R3:
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 28
R4:
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[r4-LoopBack1]ip add 192.168.1.129 28
[r4-LoopBack2]ip add 192.168.1.145 28
R5:
[r5-GigabitEthernet0/0/2]ip add 192.168.1.22 30
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/1]ip add 56.1.1.5 24
R6
[r6-GigabitEthernet0/0/0]ip add 56.1.1.6 24
[r6-LoopBack0]ip add 6.6.6.6 24
第三步:r3配置dhcp
[r3]dhcp enable
[r3-ip-pool-r3]network 192.168.1.96 mask 27
[r3-ip-pool-r3]gateway-list 192.168.1.97
[r3-ip-pool-r3]dns-list 8.8.8.8 114.114.114.114
[r3-GigabitEthernet0/0/2]dhcp select global
pc1和pc2上有了dhcp分配的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
[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 0.0.0.0 0 192.168.1.10
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[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:[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.0 30 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 0.0.0.0 0 192.168.1.18
[r4]ip route-static 0.0.0.0 0 192.168.1.22
[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.96 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.32 27 192.168.1.13
R5:[r5]ip route-static 0.0.0.0 0 56.1.1.6
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.32 27 192.168.1.17
第五步:备用路由,设置通过22端口的优先级为61(数值越小越优先)
[r4]ip route-static 0.0.0.0 0 192.168.1.22 pr 61
[r5]ip route-static 192.168.1.128 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.8 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.64 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.0 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.12 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.96 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.4 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.32 27 192.168.1.21 pr 61
当下面线路断开时,上路可以继续工作
目前内部局域网已经实现全网互通
第五步:配置一对多的acl,再在R5的0/0/1口nat调用acl2000
[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
这时这个网络拓扑的所有网段实现全网互通
第六步:防止环路,要在r1 r3 r4 上配置空接口路由避免环路
[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
第七步:使得R6telnetR5的公有IP地址时,实际登陆到R1上 要使用端口映射
首先在R1上启用telnet服务,添加用户并配置用户名密码
[r1]aaa
[r1-aaa]local-user lch privilege level 15 password cipher 655942
Info: Add a new user.
[r1-aaa]local-user lch service-type telnet
[r1]user-interface vty 0
[r1-ui-vty0]authentication-mode aaa
这时网段内其他用户都能登陆r1 使用R4 登陆R1:
然后再R5的0/0/1接口上配置端口映射:
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 in
side 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
配置完成后在R6上telnet 56.1.1.5端口登陆到R1的192.168.1.1上:
输入账号密码后成功登陆到R1上
最后实验要求所有条件均达到,save保存配置,保存拓扑