设为首页收藏本站language 语言切换
查看: 1872|回复: 5
收起左侧

[原创] 实验 32:配置思科NAT静态端口映射 实验 33:配置思科PAT动态超载转换

[复制链接]
发表于 2019-1-2 08:06:27 | 显示全部楼层 |阅读模式
实验 32:配置思科NAT静态端口映射
实验 33:配置思科PAT动态超载转换
实验目标:
1.理解NAT的工作原理。
2.实现NAT静态端口映射,外网访问内网资源。
实验步骤:
1.配置R1静态默认路由,模拟内网。
2.配置NAT,使得内网可以用端口S0/3/0访问外部网络。
3.配置静态NAT,PC1可访问S0的web和FTP(默认用户名和密码)
1.配置R1静态默认路由,模拟内网。
2.配置NAT,使得内网可以用端口S0/3/0访问外部网络。
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/3/0
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)#ip nat inside source list 1 interface s0/3/0 overload
R1(config)#inter f0/0
R1(config-if)#ip nat inside
R1(config-if)#inter s0/3/0
R1(config-if)#ip nat outside
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Request timed out.
Reply from 192.168.2.1: bytes=32 time=5ms TTL=126
Reply from 192.168.2.1: bytes=32 time=1ms TTL=126
Reply from 192.168.2.1: bytes=32 time=1ms TTL=126
R1#show ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
icmp 12.1.1.1:1024     192.168.1.2:1      192.168.2.1:1      192.168.2.1:1024
icmp 12.1.1.1:1025     192.168.1.2:2      192.168.2.1:2      192.168.2.1:1025
icmp 12.1.1.1:1026     192.168.1.2:3      192.168.2.1:3      192.168.2.1:1026
icmp 12.1.1.1:1027     192.168.1.2:4      192.168.2.1:4      192.168.2.1:1027
icmp 12.1.1.1:1        192.168.1.1:1      192.168.2.1:1      192.168.2.1:1
icmp 12.1.1.1:2        192.168.1.1:2      192.168.2.1:2      192.168.2.1:2
icmp 12.1.1.1:3        192.168.1.1:3      192.168.2.1:3      192.168.2.1:3
icmp 12.1.1.1:4        192.168.1.1:4      192.168.2.1:4      192.168.2.1:4

R1#debug ip nat
IP NAT debugging is on
R1#
NAT: s=192.168.1.1->12.1.1.1, d=192.168.2.1 [5]

NAT*: s=192.168.2.1, d=12.1.1.1->192.168.1.1 [8]

R1#
NAT: s=192.168.1.1->12.1.1.1, d=192.168.2.1 [6]

NAT*: s=192.168.2.1, d=12.1.1.1->192.168.1.1 [9]

R1#
NAT: s=192.168.1.1->12.1.1.1, d=192.168.2.1 [7]

NAT*: s=192.168.2.1, d=12.1.1.1->192.168.1.1 [10]

R1#
NAT: s=192.168.1.1->12.1.1.1, d=192.168.2.1 [8]

NAT*: s=192.168.2.1, d=12.1.1.1->192.168.1.1 [11]
3.配置静态NAT,PC1可访问S0的web和FTP(默认用户名和密码)
PC1在外网,将S0的内部地址映射到外网地址后,就可以被外网访问了。
R1(config)#ip nat inside source static tcp 192.168.1.2 80 12.1.1.1 80
R1(config)#ip nat inside source static tcp 192.168.1.2 20 12.1.1.1 20
R1(config)#ip nat inside source static tcp 192.168.1.2 21 12.1.1.1 21

实验32 33.JPG
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-27 15:14 , Processed in 0.058110 second(s), 25 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表