Network Address Translations
网络地址转换
IP地址分为公网IP和私网IP
公网IP只能在公网上使用
私网IP只能在内网中使用
在公网上不允许出现私有IP地址!!!
私网IP可以重复在内网使用
私有IP地址范围:
1.10.0.0.0/8(10开头的)
2.172.16.0.0/16——172.31.0.0/16(172.16开头的一直到172.31开头的)
3.192.168.0.0/16(192.168开头的)
NAT主要实现公私有IP的转换,一般是路由器或防火墙上来完成
不建议在三层交换机上配置!
NAT有类:
1.静态NAT 1对1映射,(静态PAT,端口映射技术)
2.动态NAT
3.PAT(端口地址转换,Port Address Translations)
PAT也称为端口复用技术
NAT命令
定义内网端口:
int f0/0
ip nat inside
exit
定义外网端口:
int f0/1
ip nat outside
exit
配置PAT
定义内部地址池:
acc 1 permit 192.168.0.0 0.0.255.255
做PAT动态映射:
conf t
ip nat inside source list 1 int f0/1 overload
配置静态端口转换:
conf t
ip nat inside source static tcp 192.168.1.3 80 100.1.1.2 80