实验要求:
1、R6为ISP,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能再对其进行任何配置;
2、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3、所有路由器上环回(R1、R2、R4分别有2两个环回,R5、R6有一个环回),均代表连接用户的接口;
4、R3下的两台PC通过DHCP自动获取IP地址;
5、选路最佳,路由表尽量小,避免环路;
6、R1-R5均可访问R6的环回
7、R6telnetR5的公有IP地址时,实际登录到R1上
8、R4与R5正常通过1000m链路,故障时通过100m链路。
第一步、规划IP地址并配置。
192.168.1.0/24借三位化为8个网段,用前六个网段。
①192.168.1.0/27(骨干链路)
再借到30位,分给链路
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
②192.168.1.32/27(R1)
再借一位
192.168.1.32/28
192.168.1.48/28
③192.168.1.64/27(R2)
再借一位
192.168.1.64/28
192.168.1.80/28
④192.168.1.96/27(R3)
⑤192.168.1.128/27(R4)
再借一位
192.168.1.128/28
192.168.1.144/28
⑥192.168.1.160/27(R5)
第二步、给R3配置DHCP。
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool a
Info: It's successful to create an IP address pool.
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]gateway-list 192.168.1.97
[R3-ip-pool-a]q
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
第三步、写静态路由。因为路由表尽量小,所以R1\R2\R3上直接写缺省路由。R4\R5上补充一些到不了的路由。修改路由优先级,同时也完成要求8。
[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.10
[R2]ip route-static 0.0.0.0 0 192.168.1.6
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[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 preference 61
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.0 30 192.168.1.5
[R4]ip route-static 192.168.1.8 30 192.168.1.13
[R5]ip route-static 0.0.0.0 0 56.0.0.2
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 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.4 30 192.168.1.17
[R5]ip route-static 192.168.1.8 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.32 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
第四步、避免环路产生,在路由汇总的路由器上写空接口防环。
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R3]ip route-static 192.168.1.96 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
[R5]ip route-static 192.168.1.160 27 NULL 0
第五步、在边界路由器做nat策略,使全网可达。
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]q
[R5-GigabitEthernet0/0/1]nat outbound 2000
第六步、在R1上开启telnet远程登陆。
[R1]aaa
[R1-aaa]local-user user1 password cipher 123
Info: Add a new user.
[R1-aaa]local-user user1 service-type telnet
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
第七步、在R5的公网接口做端口映射
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat static protocol tcp global current-interface 23 inside 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y