一、实验要求
 
①R6为ISP,接口IP地址为公有地址;该设备只能配IP地址,之后不能在对其进行任何配置。
 ②R1-R5为局域网,私有IP地址192.168.1.0/24请合理分配。
 ③所有的路由器上均有换回,代表用户接口。
 ④R3下的两台PC通过DHCP自动获取IP地址。
 ⑤选路最佳,路由表尽量小,避免环路。
 ⑥R1-R5均可访问R6的环回。
 ⑦R6 telnet R5的公有IP地址时,实际登录到R1上。
 ⑧R4与R5正常通过1000兆链路,故障时,通过100兆链路。
二、设计拓扑

三、子网划分
为简化实验,将连线表示出来的网段放在一个网段的下面,将192.168.1.0/24分为8个网段,子网掩码向后借三个单位:
 192.168.1.0/27(主网段)
 192.168.1.32/27(R1环回)
 192.168.1.64/27(R1环回)
 192.168.1.96/27(R2环回)
 192.168.1.128/27(R2环回)
 192.168.1.160/27(R4环回)
 192.168.1.192/27(R4环回)
 192.168.1…224/27(用于R3dhcp使用)
 其中192.168.1.0/27作为连线网段的主网段,而子网段需要7个网段,对其进行子网划分:
 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.24/30(保留)
 192.168.1.28/30(保留)
四、实验配置
①先配置所有IP地址:
 【R1】:
 [R1]int g 0/0/0
 [R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
 [R1-GigabitEthernet0/0/0]int g0/0/1
 [R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
 [R1]int LoopBack 0
 [R1-LoopBack0]ip address 192.168.1.33 27
 [R1]int LoopBack 1
 [R1-LoopBack1]ip address 192.168.1.65 27
 【R2】:
 [R2]int g0/0/0
 [R2-GigabitEthernet0/0/0]ip address 192.168.1.9 30
 [R2-GigabitEthernet0/0/0]int g0/0/01
 [R2-GigabitEthernet0/0/1]ip address 192.168.1.2 30
 [R2]int LoopBack 0
 [R2-LoopBack0]ip address 192.168.1.97 27
 [R2]int LoopBack 1
 [R2-LoopBack1]ip address 192.168.1.129 27
 【R3】:
 [R3]int g0/0/0
 [R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
 [R3-GigabitEthernet0/0/0]int g0/0/1
 [R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
 [R3]int g0/0/2
 [R3-GigabitEthernet0/0/2]ip address 192.168.1.225 27
 R3的dhcp配置:
 [R3]ip pool 1
 [R3-ip-pool-1]network 192.168.1.224 mask 27
 [R3-ip-pool-1]gateway-list 192.168.1.225
 [R3-ip-pool-1]dns-list 8.8.8.8 8.8.4.4
 [R3-ip-pool-1]int g0/0/2
 [R3-GigabitEthernet0/0/2]dhcp select global
 PC1和PC2:
【R4】:
 [R4]int g0/0/1
 [R4-GigabitEthernet0/0/1]ip address 192.168.1.10 30
 [R4-GigabitEthernet0/0/1]int g0/0/2
 [R4-GigabitEthernet0/0/2]ip address 192.168.1.14 30
 [R4-GigabitEthernet0/0/2]int g0/0/0
 [R4-GigabitEthernet0/0/0]ip address 192.168.1.21 30
 [R4]int e4/0/0
 [R4-Ethernet4/0/0]ip address 192.168.1.17 30
 [R4]int LoopBack 0
 [R4-LoopBack0]ip address 192.168.1.161 27
 [R4-LoopBack0]int lo 1
 [R4-LoopBack1]ip address 192.168.1.193 27
 【R5】:
 [R5]int g0/0/0
 [R5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
 [R5-GigabitEthernet0/0/0]int g0/0/1
 [R5-GigabitEthernet0/0/1]ip address 56.1.1.1 24
 [R5]int e4/0/0
 [R5-Ethernet4/0/0]ip address 192.168.1.18 30
 [R5]int LoopBack 0
 [R5-LoopBack0]ip address 5.5.5.5 24
 【R6】:
 [R6]int g0/0/0
 [R6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
 [R6-GigabitEthernet0/0/0]int lo 0
 [R6-LoopBack0]ip address 6.6.6.6 24
 ②配置静态路由和缺省:
 【R1】:
 [R1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
 [R1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
 [R1]ip route-static 192.168.1.96 27 192.168.1.2
 [R1]ip route-static 192.168.1.128 27 192.168.1.2
 [R1]ip route-static 192.168.1.160 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.12 30 192.168.1.6
 [R1]ip route-static 192.168.1.192 27 192.168.1.6
 [R1]ip route-static 192.168.1.224 27 192.168.1.6
 [R1]ip route-static 192.168.1.32 27 NULL 0
 [R1]ip route-static 192.168.1.64 27 NULL 0
 【R2】:
 [R2]ip route-static 0.0.0.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.64 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.224 27 192.168.1.1
 [R2]ip route-static 192.168.1.224 27 192.168.1.10
 [R2]ip route-static 192.168.1.96 27 NULL 0
 [R2]ip route-static 192.168.1.128 27 NULL 0
 【R3】:
 [R3]ip route-static 0.0.0.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.64 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.96 27 192.168.1.5
 [R3]ip route-static 192.168.1.128 27 192.168.1.14
 【R4】:
 [R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22
 [R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.18 preference 61
 [R4]ip route-static 192.168.1.96 27 192.168.1.9
 [R4]ip route-static 192.168.1.128 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.64 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.224 27 192.168.1.13
 [R4]ip route-static 192.168.1.160 27 NULL 0
 [R4]ip route-static 192.168.1.192 27 NULL 0
 [R4]ip route-static 192.168.1.24 30 NULL 0
 [R4]ip route-static 192.168.1.28 30 NULL 0
 【R5】:
 [R5]ip route-static 0.0.0.0 0.0.0.0 56.1.1.2
 [R5]ip route-static 192.168.1.0 24 192.168.1.21
 [R5]ip route-static 192.168.1.0 24 192.168.1.17 preference 61
 R1开启telnet:
 [R1]aaa
 [R1-aaa]local-user root privilege level 15 password cipher root
 Info: Add a new user.
 [R1-aaa]local-user root service-type telnet
 [R1-aaa]q
 [R1]user-interface vty 0 4
 [R1-ui-vty0-4]authentication-mode aaa
 ③R5配置NAT以及端口映射:
 配置NAT:
 [R5]acl 2000
 [R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
 [R5-acl-basic-2000]int g0/0/1
 [R5-GigabitEthernet0/0/1]nat outbound 2000
 端口映射:
 [R5]int g0/0/1
 [R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23(协议号) ins
 ide 192.168.1.33 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
最后经测试实验完成。










