网络地址转换(NAT)之静态NAT
网络地址转换(Network Address Translation,NAT)广泛于应用于各种类型的因特网接入方式和各种各类型的网络中,原因很简单,NAT可以解决IP地址不足的问题,而且还能够有效的避免来自网络外部的***,隐藏并保护网络内部的计算机。
NAT作用:
1、节省IP地址;
2、内部网络可以使用私用IP和外部网络通信;
3、增强了内部网络与公用网络连接时的灵活性;
4、可以通过多地址集、备份地址集和负载分担/均衡地址集,来确保可
靠的公用网络连接。
NAT实现方式:
1、静态转换
2、动态转换
3、端口多路复用(PAT)
NAT常见应用:
1、使用NAT静态转换内部地址;
2、使用NAT动态转换内部地址;
3、使用PAT转换内部内部地址;
4、使用NAT实现TCP负载均衡;
5、使用NAT处理地址交叉。
实验环境:Packet Tracer 5.0
实验拓扑:
实验配置:
一、路由基本配置
1、配置主机名
R(config)#hostname ×××
R(config)#hostname ×××
2、配置使能加密密码(本实验未配置)
R(config)#enable secret ×××
R(config)#enable secret ×××
3、禁用DNS
R(config)#no ip domain-lookup
R(config)#no ip domain-lookup
4、配置超时和显示同步
R(config)#line console 0
R(config-line)#exec-timeout 0 0
R(config-line)#logging synchronous
R(config)#line console 0
R(config-line)#exec-timeout 0 0
R(config-line)#logging synchronous
二、实验要求配置
R1
1、外部端口S1/0的IP配置
R1(config)#interface s1/0
R1(config-if)#ip address 61.159.62.129 255.255.255.248
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config)#interface s1/0
R1(config-if)#ip address 61.159.62.129 255.255.255.248
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
2、内部端口F0/0的IP配置
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.100.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.100.1 255.255.255.0
R1(config-if)#no shutdown
3、建立静态NAT转换
R1(config)#ip nat inside source static 192.168.100.2 61.159.62.130
R1(config)#ip nat inside source static 192.168.100.3 61.159.62.131
R1(config)#ip nat inside source static 192.168.100.4 61.159.62.132
R1(config)#ip nat inside source static 192.168.100.5 61.159.62.133
R1(config)#ip nat inside source static 192.168.100.6 61.159.62.134
R1(config)#ip nat inside source static 192.168.100.2 61.159.62.130
R1(config)#ip nat inside source static 192.168.100.3 61.159.62.131
R1(config)#ip nat inside source static 192.168.100.4 61.159.62.132
R1(config)#ip nat inside source static 192.168.100.5 61.159.62.133
R1(config)#ip nat inside source static 192.168.100.6 61.159.62.134
4、外部和内部端口上启用NAT
R1(config)#interface s1/0
R1(config-if)#ip nat outside
R1(config)#interface s1/0
R1(config-if)#ip nat outside
R1(config)#interface f0/0
R1(config-if)#ip nat inside
R1(config-if)#ip nat inside
实验用到的拓扑图、配置文档和Packet Tracer 5.0实验原文件都已上传,需要的网友,可以随时下载!
转载于:https://blog.51cto.com/xgcto/166886