静态路由实验
实验拓扑:
![](https://img-blog.csdnimg.cn/20210119172749332.png)
地址划分:
配用户接口IP地址:
【R1】
int lo 0
ip ad 192.168.1.33 28
int lo 1
ip ad 192.168.1.49 28
【R2】
int lo 0
ip ad 192.168.1.65 28
int lo 1
ip ad 192.168.1.81 28
【R3】
int g0/0/2
ip ad 192.168.1.97 27
【R4】
int lo 0
ip ad 192.168.1.129 28
int lo 1
ip ad 192.168.1.145 28
【R5】
int lo 0
ip ad 192.168.1.161 26
配骨干接口IP地址:
【R1】
int g0/0/0
ip ad 192.168.1.1 30
int g0/0/1
ip ad 192.168.1.14 30
【R2】
int g0/0/1
ip ad 192.168.1.2 30
int g0/0/0
ip ad 192.168.1.5 30
【R3】
int g0/0/1
ip ad 192.168.1.10 30
int g0/0/0
ip ad 192.168.1.13 30
【R4】
int g0/0/1
ip ad 192.168.1.6 30
int g0/0/0
ip ad 192.168.1.9 30
int g0/0/2
ip ad 192.168.1.17 30
int e4/0/0
ip ad 192.168.1.21 30
【R5】
int g0/0/1
ip ad 192.168.1.18 30
int e4/0/0
ip ad 192.168.1.22 30
int g0/0/0
ip ad 56.1.1.1 24
【R6】
int g0/0/1
ip ad 56.1.1.2 24
int lo 0
ip ad 6.6.6.6 24
配DHCP:
【R3】
dhcp enable
ip pool a
network 192.168.1.96 mask 27
gateway-list 192.168.1.97
dns-list 114.114.114.114 8.8.8.8
int g0/0/2
dhcp select global
【PC1】
【PC2】
写静态路由:
【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.13 //缺省走下
ip route-static 192.168.1.64 27 192.168.1.2 //到R2环回走上
ip route-static 192.168.1.4 30 192.168.1.2 //到R2-R4走上
ip route-static 192.168.1.96 27 192.168.1.13 //到R3接口走下
ip route-static 192.168.1.8 30 192.168.1.13 //到R4-R3走下
ip route-static 192.168.1.32 27 NULL 0 //环回空口闭环
【R2】
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6 //缺省走右
ip route-static 192.168.1.32 27 192.168.1.1 //到R1环回走左
ip route-static 192.168.1.12 30 192.168.1.1 //到R3-R1走左
ip route-static 192.168.1.96 27 192.168.1.1 //到R3接口负载均衡
ip route-static 192.168.1.96 27 192.168.1.6 //到R3接口负载均衡
ip route-static 192.168.1.64 27 NULL 0 //环回空口闭环
【R3】
ip route-static 0.0.0.0 0.0.0.0 192.168.1.9 //缺省走右
ip route-static 192.168.1.32 27 192.168.1.14 //到R1环回
ip route-static 192.168.1.0 20 192.168.1.14 //到R1-R2走左
ip route-static 192.168.1.64 27 192.168.1.14 //到R2环回负载均衡
ip route-static 192.168.1.64 27 192.168.1.9 //到R2环回负载均衡
【R4】
ip route-static 0.0.0.0 0.0.0.0 192.168.1.18 //缺省走右
ip routr-static 192.168.1.64 27 192.168.1.5 //到R2环回走上
ip route-static 192.168.1.0 30 192.168.1.5 //到R1-R2走上
ip route-static 192.168.1.32 27 192.168.1.5 //到R1环回负载均衡
ip route-static 192.168.1.32 27 192.168.1.10 //到R1环回负载均衡
ip route-static 192.168.1.96 27 192.168.1.10 //到R3接口走下
ip route-static 192.168.1.12 30 192.168.1.10 //到R3-R1走下
ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61 //缺省走右(备份)
ip route-static 192.168.1.192 26 NULL 0 //不存在的网段转发至空接口
ip route-static 192.168.1.128 27 NULL 0 //环回空口闭环
ip route-static 192.168.1.24 30 NULL 0 //预留地址空口闭环
ip route-static 192.168.1.80 30 NULL 0 //预留地址空口闭环
【R5】
ip route-static 0.0.0.0 0.0.0.0 56.1.1.2 //缺省走右
ip route-static 192.168.1.0 24 192.168.1.17 //到局域网走左
ip route-static 192.168.1.0 24 192.168.1.21 preference 61 //到局域网走左(备份)
配置NAT:
【R5】
acl 2000
rule permit source 192.168.1.0 0.0.0.255
int g0/0/0
nat outbound 2000
开启Telnet:
【R1】
aaa
local-user root privilege level 15 password cipher root
local-user root service-type telnet
q
user-interface vty 0 4
authentication-mode aaa
端口映射:
【R5】
int g0/0/0
nat server protocol tcp global current-interface 23 inside 192.168.1.33 23
Y
实验结果测试:
R1/2/4ping测试:
PCping测试:
R6telnetR5公有地址测试: