Packet Tracer – 验证 NAT 配置并进行故障排除
地址分配表
设备 | 接口 | IP 地址 | 子网掩码 | 默认网关 |
R1 | G0/0 | 10.4.10.254 | 255.255.255.0 | 不适用 |
G0/1 | 10.4.11.254 | 255.255.255.0 | 不适用 | |
S0/0/1 | 10.4.1.2 | 255.255.255.252 | 不适用 | |
R2 | S0/0/0 | 209.165.76.194 | 255.255.255.224 | 不适用 |
S0/0/1 | 10.4.1.1 | 255.255.255.252 | 不适用 | |
服务器 1 | NIC | 64.100.201.5 | 255.255.255.0 | 64.100.201.1 |
PC1 | NIC | 10.4.10.1 | 255.255.255.0 | 10.4.10.254 |
PC2 | NIC | 10.4.10.2 | 255.255.255.0 | 10.4.10.254 |
L1 | NIC | 10.4.11.1 | 255.255.255.0 | 10.4.11.254 |
L2 | NIC | 10.4.11.2 | 255.255.255.0 | 10.4.11.254 |
拓扑图
目标
第 1 部分:隔离问题
第 2 部分:对 NAT 配置进行故障排除
第 3 部分:验证连接
场景
承包商将较早的配置恢复至新运行 NAT 的路由器。 但是,备份原先配置后,网络发生了改变且添加了新子网。 您需要让网络再次工作。
第 1 部分: 隔离问题
从 PC1、PC2、L1、L2 和 R2 ping Server1。 记录各 ping 的成功情况。 根据需要,ping 任何其他设备。
第 2 部分: 对 NAT 配置进行故障排除
步骤 1: 查看 R2 上的 NAT 转换。
若 NAT 工作,则应存在表条目。
R2#show ip nat translations
R2#
步骤 2: 显示 R2 的运行配置。
NAT 内部端口应与专用地址保持一致,而 NAT 外部端口应与公共地址保持一致。
R2#show ip nat statistics
Total translations: 0 (0 static, 0 dynamic, 0 extended)
Outside Interfaces: Serial0/0/1
Inside Interfaces: Serial0/0/0
Hits: 0 Misses: 16
Expired translations: 0
Dynamic mappings:
-- Inside Source
access-list 101 pool R2POOL refCount 0
pool R2POOL: netmask 255.255.255.224
start 209.165.76.195 end 209.165.76.223
type generic, total addresses 29 , allocated 0 (0%), misses 0
R2#
步骤 3: 更正接口。
将 ip nat inside 和 ip nat outside 命令分配给正确端口。
R2(config)#interface Serial0/0/0
R2(config-if)#ip nat outside
R2(config-if)#interface Serial0/0/1
R2(config-if)#ip nat inside
步骤 4: 从 PC1、PC2、L1、L2 和 R2 ping Server1。
记录各 ping 的成功情况。 根据需要,ping 任何其他设备。
现在只有PC1,PC2可以ping成功。
步骤 5: 查看 R2 上的 NAT 转换。
若 NAT 工作,则应存在表条目。
R2#show ip nat translations
R2#
步骤 6: 显示 R2 上的访问列表 101。
通配符掩码应包括 10.4.10.0 网络和 10.4.11.0 网络。
R2#show ip access-lists
Extended IP access list 101
10 permit ip 10.4.10.0 0.0.0.255 any (16 match(es))
R2#
步骤 7: 更正访问列表。
删除访问列表 101 并将其更换为一个语句长度的类似列表。 唯一的差别应该是通配符。
R2(config)#no ip access-list extended 101
R2(config)#ip access-list extended 101
R2(config-ext-nacl)#permit ip 10.4.10.0 0.0.1.255 any
R2(config-ext-nacl)#
第 3 部分: 验证连接
步骤 1: 验证 Server1 连接。
记录各 ping 的成功情况。 所有主机应能够 ping Server1、R1 和 R2。 若 ping 不成功,则进行故障排除。
步骤 2: 查看 R2 上的 NAT 转换。
NAT 应显示许多表条目。
R2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
tcp 209.165.76.199:102510.4.11.1:1025 64.100.201.5:80 64.100.201.5:80
tcp 209.165.76.200:102510.4.11.2:1025 64.100.201.5:80 64.100.201.5:80
tcp 209.165.76.201:102510.4.10.1:1025 64.100.201.5:80 64.100.201.5:80
tcp 209.165.76.202:102510.4.10.2:1025 64.100.201.5:80 64.100.201.5:80
R2#
【实验脚本】
enable
conf t
interface Serial0/0/0
ip nat outside
interface Serial0/0/1
ip nat inside
exit
no ip access-list extended 101
ip access-list extended 101
permit ip 10.4.10.0 0.0.1.255 any
end
write
【实验链接】
链接:https://pan.baidu.com/s/1LjDH1F6UYNxE4G40HzNQnw?pwd=9314
提取码:9314
--来自百度网盘超级会员V3的分享