实验要求
1 R6为isp,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能对其进行其他任何配置;
2 R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配,
3 R1, R2, R4,各有两个环回地址; R5, R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;
4 R3下的两台PC通过DHCP自动获取IP地址;
5选路最佳,路由表尽量小,避免环路;
6 R1-R5均可以访问R6的环回;
7 R6telnetR5的公有IP地址时,实际登陆到R1上;
8 R4与R5正常通过1000M链路,故障时通过100M链路;
![](https://i-blog.csdnimg.cn/blog_migrate/2d0f73637ef11226c59a50318591098e.png)
网段划分
分网段
分配私有ip有6个骨干7环回
分配如图
![](https://i-blog.csdnimg.cn/blog_migrate/a56e819d94cbb1afedb74a65472f5809.png)
配置ip:
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r1-LoopBack0]ip add 192.168.1.65 30
[r1-LoopBack1]ip add 192.168.1.81 30
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2-LoopBack0]ip add 192.168.1.129 30
[r2-LoopBack1]ip add 192.168.1.145 30
[r3-GigabitEthernet0/0/0]ip add 192.168.1.13 30
[r3-GigabitEthernet0/0/1]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 29
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[r4-GigabitEthernet4/0/0]ip add 192.168.1.33 30
[r4-LoopBack0]ip add 192.168.1.161 30
[r4-LoopBack1]ip add 192.168.1.177 30
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/1]ip add 192.168.1.34 30
[r5-LoopBack0]ip add 192.168.1.193 30
[r5-GigabitEthernet0/0/2]ip add 12.0.0.1 24
[isp-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[isp-LoopBack0]ip add 1.1.1.1 24
静态路由和缺省路由
---R1
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
ip route-static 192.168.1.8 255.255.255.252 192.168.1.2
ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
ip route-static 192.168.1.96 255.255.255.248 192.168.1.6
ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
---R2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
ip route-static 192.168.1.4 255.255.255.252 192.168.1.1
ip route-static 192.168.1.64 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.248 192.168.1.1
ip route-static 192.168.1.96 255.255.255.248 192.168.1.10
---R3
ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
ip route-static 192.168.1.128 255.255.255.224 192.168.1.5
ip route-static 192.168.1.128 255.255.255.224 192.168.1.14
---R4
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 192.168.1.18
ip route-static 0.0.0.0 0.0.0.0 192.168.1.34 preference 70
ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
ip route-static 192.168.1.4 255.255.255.252 192.168.1.13
ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
ip route-static 192.168.1.96 255.255.255.248 192.168.1.13
ip route-static 192.168.1.128 255.255.255.224 192.168.1.9
---R5
ip route-static 192.168.1.0 255.255.255.0 192.168.1.17
ip route-static 192.168.1.0 255.255.255.0 192.168.1.33 preference 70
因为为了减少路由条目,我们写很多路由条目的时候都进行了汇总,所以要在每一个路由器上面配置空接口(因为r2使用的是动态路由分配ip,所以不用配置空接口)
[r1]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.128 27 NULL 0
[r4]ip route-static 192.168.1.0 24 NULL 0
[r5]ip route-static 192.168.1.0 24 NULL 0
然后尝试用r1ping一下r5的环回,如果能通基本上内网就全网可达
<r1>ping 192.168.1.193
PING 192.168.1.193: 56 data bytes, press CTRL_C to break
Request time out
Reply from 192.168.1.193: bytes=56 Sequence=2 ttl=253 time=50 ms
Reply from 192.168.1.193: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 192.168.1.193: bytes=56 Sequence=4 ttl=253 time=30 ms
Reply from 192.168.1.193: bytes=56 Sequence=5 ttl=253 time=30 ms
r3的dhcp
[r3]dhcp enable
[r3]ip pool aa
Info: It's successful to create an IP address pool.
[r3-ip-pool-aa]network 192.168.1.96 mask 29
[r3-ip-pool-aa]gateway-list 192.168.1.97
[r3-GigabitEthernet0/0/2]dhcp select global
r5的nat配置
[r5]access-user
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-GigabitEthernet0/0/2]nat outbound 2000
测试:
<r1>ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=30 ms