首先,搭建实验拓扑图,做基础配置
R3到R6都做好配置
写路由,先写缺省路由
[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
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.10
[r1]ip route-static 192.168.1.96 27 192.168.1.10
以此类推
R4
[r4]ip route-static 192.168.1.160 27 192.168.1.18,
[r4]ip route-static 192.168.1.160 27 192.168.1.22 preference 70
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.17
[r5]ip route-static 192.168.1.0 24 192.168.1.21 preference 70
R3上DHCP自动获取
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool aa
Info: It's successful to create an IP address pool.
[r3-ip-pool-aa]network 192.168.1.96 mask 27
[r3-ip-pool-aa]gateway-list 192.168.1.97
[r3-ip-pool-aa]dns-list 8.8.8.8
[r3-ip-pool-aa]q
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
写空接口防环
R3只有一个接口,不用写,R1R2R4都需要写
[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
因为R5写了一条汇总给R4,所以R4也要写一条
[r4]ip route-static 192.168.1.0 24 NULL 0
访问公网,做动态nat
开启telnet服务
R5端口映射
R6登陆到R1
<isp>telnet 12.0.0.1
Press CTRL_] to quit telnet mode
Trying 12.0.0.1 ...
Connected to 12.0.0.1 ...
Login authentication
Username:lovehcf
Password:
<r1>