HCIP第一天练习
根据题意配置如图,划分合理网段
配置IP地址和环回地址
R1:IP信息
R2:IP信息
R3:IP信息
R4:IP信息
R5:IP信息
R6:IP信息
通过DHCP自动获取IP地址
[R3]ip pool HCIP
[R3-ip-pool-HCIP]network 192.168.1.144 mask 28
[R3-ip-pool-HCIP]gateway-list 192.168.1.145
[R3-ip-pool-HCIP]dns-list 114.114.114.114 8.8.8.8
[R3-GigabitEthernet0/0/2]dhcp select global
PC1
PC2
添加静态路由
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.22
[R1]ip route-static 192.168.1.32 27 192.168.1.2
[R1]ip route-static 192.168.1.144 28 192.168.1.22
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.22
R2:
[R2]ip route-static 0.0.0.0 0 192.168.1.6
[R2]ip route-static 192.168.1.144 28 192.168.1.8
[R2]ip route-static 192.168.1.144 28 192.168.1.1
[R2]ip route-static 192.168.1.20 30 192.168.1.1
[R2]ip route-static 192.168.1.64 27 192.168.1.1
R3:
[R3]ip route-static 0.0.0.0 0 192.168.1.18
[R3]ip route-static 192.168.1.32 27 192.168.1.21
[R3]ip route-static 192.168.1.32 27 192.168.1.18
[R3]ip route-static 192.168.1.0 30 192.168.1.21
[R3]ip route-static 192.168.1.64 27 192.168.1.21
R4:
[R4]ip route-static 0.0.0.0 0 192.168.1.10
[R4]ip route-static 0.0.0.0 0 192.168.1.14 preference 70
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.64 27 192.168.1.17
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.144 28 192.168.1.17
[R4]ip route-static 192.168.1.0 30 192.168.1.5
[R4]ip route-static 192.168.1.20 30 192.168.1.17
[R4]ip route-static 192.168.1.128 27 192.168.1.10
R5:
[R5]ip route-static 0.0.0.0 0 12.0.0.2
[R5]ip route-static 192.168.1.0 24 192.168.1.9
[R5]ip route-static 192.168.1.0 24 192.168.1.13 preference 70
添加空接口,避免路由黑洞
R1:
[R1]ip route-static 192.168.1.64 27 NULL0
R2:
[R2]ip route-static 192.168.1.32 27 NULL0
R4:
[R4]ip route-static 192.168.1.96 27 NULL0
解决浮动静态路由问题
R4:
[R4]undo ip route-static 0.0.0.0 0 192.168.1.10
[R4]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/2 192.168.1.10
[R4-GigabitEthernet0/0/2]shutdown
[R4]display ip routing-table
[R4-GigabitEthernet0/0/2]restart
[R4]display ip routing-table
建立一对多的NAT关系,让R1-R5均可以R6的环回
R5:
[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
R6 telnet R1
R1:
[R1]aaa
[R1-aaa]local-user admin privilege level 15 password cipher 123
[R1-aaa]local-user admin service-type telnet
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
做映射
R5:
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]nat server 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 fa
ilure.
Are you sure to continue?[Y/N]:y