目录
一、实验要求与拓扑搭建
二、实验过程
2.1子网划分
192.168.1.0/24
192.168.1.0/27 骨干 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 备用骨干网段
192.168.1.32/27 R1 192.168.1.32/28 192.168.1.48/28
192.168.1.64/27 R2 192.168.1.64/28 192.168.1.80/28
192.168.1.96/27 R3 只有一个网段无需继续划分
192.168.1.128/27 R4 192.168.1.128/28 192.168.1.144/28
192.168.1.160/27 R5 只有一个网段无需继续划分
192.168.1.192/27 备用网段
192.168.1.224/27
2.2配置环回及骨干IP地址
配置环回IP地址:
R3上建立DHCP池塘,使得两台PC自动获取IP地址:
配置骨干IP地址:
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.5 30
[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.9 30
[r3-GigabitEthernet0/0/1]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/1]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.13 30
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 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
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/2]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 56.1.1.1 24
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
2.3 配置静态路由与缺省路由实现全网可达
[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.6
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r4]ip route-static 0.0.0.0 0 192.168.1.18
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.12
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r2]ip route-static 192.168.1.32 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.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.10
[r3]ip route-static 192.168.1.32 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.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[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.13
[r5]ip route-static 192.168.1.128 27 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.32 27 192.168.1.17
[r5]ip route-static 192.168.1.0 27 192.168.1.17
验证:
2.4 使用NAT进行网络地址转换
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
2.5 设置空接口,避免环路导致黑洞
[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
2.6 实现故障链路通信——设置优先级
首先在R4上display ip routing-table 发现只有一条路由的下一跳为192.168.1.18,即将这条路由的下一跳修改为22,优先级修改为61:
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
之后在R5上display current-configuration 将下一跳为17的路由接口修改为21,并且将其优先级修改为61,操作如下:
修改完成后,在R4/R5上手动关闭接口G0/0/2进行验证
可以看到在关闭接口后,R4仍可访问R5的环回;
2.7 实现Telnet远程登录
因为最终实现的是R6通过访问R5登录到R1,所以需要在R5上做一个端口映射到R1
验证:
实验完成!(若有问题欢迎大家共同讨论)