第一步:划分地址
由实验要求可知R1、R2、R4各有两个用户网段,且R5需要一个用户网段,所以在此处我们可以将R1、R2、R4的用户网段看成一个,然后再进行二次划分,然后加上骨干网段,我们一共需要8个网段: 192.168.1.0/24 借3位划分: 192.168.1.000 00000/27 ----------骨干链路 192.168.1.0/27 向192.168.1.0/27再借三位划分: 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 ----------R1 192.168.1.32/27 ? 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 -----------R2 192.168.1.64/27 ? 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 -------------R4 192.168.1.96/27 ? 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 ----------- --R5 192.168.1.128/27 ? 192.168.1.100 0 0000/28 192.168.1.128/28 R3(用作DHCP) 192.168.1.101 00000/27 ----------192.168.1.160/27 用作保留 192.168.1.110 00000/27 192.168.1.111 00000/27
第二步:配置IP地址
R1 [r1]int g0/0/0 [r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30 [r1-GigabitEthernet0/0/0]int g0/0/1 [r1-GigabitEthernet0/0/1]ip add 192.168.1.13 30 [r1-GigabitEthernet0/0/1]int l0 [r1-LoopBack0]ip add 192.168.1.33 28 [r1-LoopBack0]int l1 [r1-LoopBack1]ip add 192.168.1.49 28 [r1-LoopBack1] R2 [r2]int g0/0/0 [r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30 [r2-GigabitEthernet0/0/0]int g0/0/1 [r2-GigabitEthernet0/0/1]ip add 192.168.1.5 30 [r2-GigabitEthernet0/0/1]int l0 [r2-LoopBack0]ip add 192.168.1.65 28 [r2-LoopBack0]int l1 [r2-LoopBack1]ip add 192.168.1.81 28 [r2-LoopBack1] R3 [r3]int g0/0/1 [r3-GigabitEthernet0/0/1]ip add 192.168.1.14 30 [r3-GigabitEthernet0/0/1]int g0/0/0 [r3-GigabitEthernet0/0/0]ip add 192.168.1.9 30 [r3-GigabitEthernet0/0/0]int g0/0/2 [r3-GigabitEthernet0/0/2]ip add 192.168.1.161 27 [r3-GigabitEthernet0/0/2] R4 [r4]int g0/0/0 [r4-GigabitEthernet0/0/0]ip add 192.168.1.6 30 [r4-GigabitEthernet0/0/0]int g0/0/1 [r4-GigabitEthernet0/0/1]ip add 192.168.1.10 30 [r4-GigabitEthernet0/0/1]int g0/0/2 [r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30 [r4-GigabitEthernet0/0/2]int g4/0/0 [r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30 [r4-GigabitEthernet4/0/0]int l0 [r4-LoopBack0]ip add 192.168.1.97 28 [r4-LoopBack0]int l1 [r4-LoopBack1]ip add 192.168.1.113 28 [r4-LoopBack1] R5 [r5]int g0/0/0 [r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30 [r5-GigabitEthernet0/0/0]int g0/0/1 [r5-GigabitEthernet0/0/1]ip add 12.0.0.1 24 [r5-GigabitEthernet0/0/1]int g0/0/2 [r5-GigabitEthernet0/0/2]ip add 192.168.1.22 30 [r5-GigabitEthernet0/0/2]int l0 [r5-LoopBack0]ip add 192.168.1.129 28 R6 sy sy r6 [r6]int g0/0/0 [r6-GigabitEthernet0/0/0]ip add 12.0.0.2 24 [r6-GigabitEthernet0/0/0]int l0 [r6-LoopBack0]ip add 1.1.1.1 24 [r6-LoopBack0]
第三步:R3下两台pc通过DHCP获取IP地址
[r3]dhcp enable [r3]ip pool dhcp [r3-ip-pool-dhcp]network 192.168.1.160 mask 27 [r3-ip-pool-dhcp]gateway-list 192.168.1.161 [r3-ip-pool-dhcp]dns-list 114.114.114.114 [r3-ip-pool-dhcp]int g0/0/2 [r3-GigabitEthernet0/0/2]dhcp select global [r3-GigabitEthernet0/0/2]
PC1: PC2:
第四步配置静态路由和缺省
R1: [r1]ip route-static 192.168.1.4 30 192.168.1.2 [r1]ip route-static 192.168.1.8 30 192.168.1.14 [r1]ip route-static 192.168.1.160 27 192.168.1.14 [r1]ip route-static 192.168.1.16 30 192.168.1.2 [r1]ip route-static 192.168.1.16 30 192.168.1.14 [r1]ip route-static 192.168.1.64 27 192.168.1.2 [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 R2: [r2]ip route-static 192.168.1.12 30 192.168.1.1 [r2]ip route-static 192.168.1.8 30 192.168.1.6 [r2]ip route-static 192.168.1.16 30 192.168.1.6 [r2]ip route-static 192.168.1.160 27 192.168.1.1 [r2]ip route-static 192.168.1.160 27 192.168.1.6 [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.6 [r2]ip route-static 192.168.1.128 27 192.168.1.6 R3: [r3]ip route-static 192.168.1.0 30 192.168.1.13 [r3]ip route-static 192.168.1.4 30 192.168.1.10 [r3]ip route-static 192.168.1.16 30 192.168.1.10 [r3]ip route-static 192.168.1.32 27 192.168.1.13 [r3]ip route-static 192.168.1.64 27 192.168.1.13 [r3]ip route-static 192.168.1.64 27 192.168.1.10 [r3]ip route-static 192.168.1.96 27 192.168.1.10 [r3]ip route-static 192.168.1.128 27 192.168.1.10 R4: [r4]ip route-static 192.168.1.0 30 192.168.1.5 [r4]ip route-static 192.168.1.12 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.5 [r4]ip route-static 192.168.1.64 27 192.168.1.5 [r4]ip route-static 192.168.1.160 27 192.168.1.9 [r4]ip route-static 192.168.1.128 27 192.168.1.18 R5: [r5]ip route-static 192.168.1.0 30 192.168.1.17 [r5]ip route-static 192.168.1.32 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.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.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.160 30 192.168.1.17 [r5]ip route-static 0.0.0.0 0 12.0.0.2
第五步进行nat配置和端口映射:
nat配置: [r5]acl 2000 [r5-acl-basic-2000]ru [r5-acl-basic-2000]rule pe [r5-acl-basic-2000]rule permit s [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-acl-basic-2000]int g0/0/1 [r5-GigabitEthernet0/0/1]nat s [r5-GigabitEthernet0/0/1]nat server p [r5-GigabitEthernet0/0/1]nat server protocol t [r5-GigabitEthernet0/0/1]nat server protocol tcp g [r5-GigabitEthernet0/0/1]nat server protocol tcp global cu [r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 i [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 在R1上配置远程登陆: [r1]aaa [r1-aaa]local-user admin privilege level 15 password cipher 123 [r1-aaa]local-user admin service-type telnet [r1]user-interface vty 0 4 [r1-ui-vty0-4]authentication-mode aaa
|