Chinaunix首页 | 论坛 | 博客
  • 博客访问: 260759
  • 博文数量: 30
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-03 12:55
文章分类

全部博文(30)

文章存档

2010年(9)

2009年(20)

2008年(1)

我的朋友

分类: 系统运维

2009-08-17 23:10:24

nat和global命令总是一起使用。nat命令定义可以转换地址以访问低安全级网络的本地主机;global命令定义了用于转换的全局地址池。nat命

令的nat_id标示符指定了nat命令使用的地址池。
语法:
Pix(config)#global (if_name) nat_id {global_ip[global_ip] [netmask global_mask]|interface}
Pix(config)#nat (if_name) nat_id local_ip [netmask]
例:
Pix(config)# global (outside) 1 215.1.2.0
Pix(config)# global (outside) 1 1.1.1.1-1.1.1.30 netmask 255.255.255.224
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0
***
改变或删除一个nat命令语句后,使用clear xlate命令。
最多可以定义256个全局地址池。
不要用全局地址池指定了的地址来做静态映射。
静态映射拥有比nat命令创建的映射有更高的优先级。
***

指定内部所有主机的选项
Pix(config)#nat (inside) 1 0 0
0 0是local_ip/netmask 0.0.0.0 0.0.0.0的组合。

更多的NAT选项
nat命令能够使能或禁止一个或更多的地址转换,还有很多其他的选项
Pix(config)# nat (if_name) nat_id ip_address [netmask] [outside] [dns] [norandomseq]
[timeout hh:mm:ss] [conn_limit] [em_limit]
Pix(config)# no nat (if_name) nat_id address [netmask] [outside]

NAT_ID选项
NAT 0
nat 0关闭特定地址的NAT转换,这个结果称为identity

translation,这种转换映射到它自身的地址。这个命令假定主机地址是一个可在Internet上使用的有效的全局地址。
与static命令不同的是,nat要求连接从内部发起。
Pix(config)# nat (dmz) 0 1.1.1.15 //该主机可访问外部网络
Pix(config)# static (dmz, outside) 1.1.1.15 1.1.1.15  //地址对外部可见

下面例子使用一个C类地址
Pix(config)# nat (dmz) 0 1.1.2.0 255.255.255.0
Pix(config)# static (dmz, outside) 1.1.2.0 1.1.2.0 netmask 255.255.255.0

NAT 0 Access-List ACL Name
使用访问控制列表设置旁路,使特定的传输跳过NAT转换进程。
这个命令假定主机地址是一个可在Internet上使用的有效的全局地址。
Pix(config)# access-list skip-nat permit ip host 1.1.1.15 host 1.1.2.19
Pix(config)# nat (inside) 0 access-list skip-nap

NAT_ID 大于0
正常的NAT地址转换。
Pix(config)# global (outside) 9 1.1.2.1 - 1.1.2.254
Pix(config)# global (outside) 9 1.1.3.0 netmask 255.255.255.0
Pix(config)# nat (inside) 9 192.168.1.0 255.255.255.0

不使用网络地址和广播地址
如下例:
Pix(config)# global (outside) 1 10.1.1.0 netmask 255.255.255.240
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0
网络地址10.1.1.0和广播地址10.1.1.15都被包括在地址池中,要想不包括他们
Pix(config)# global (outside) 1 10.1.1.1 - 10.1.1.14
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0

检查NAT/Global配置
show global
show nat
write terminal
show xlate

PAT
Pix(config)# global (if_name) nat_id {global_ip [-global_ip] [netmask global_mask] |interface}
指定一个地址做PAT
Pix(config)# global (outside) 5 1.1.1.25
Pix(config)# nat (inside) 5 0 0
使用外网接口地址做PAT
Pix(config)# global (outside) 7 interface
Pix(config)# nat (inside) 7 0 0
***
改变或删除nat命令语句后,应执行clear xlate命令。
作PAT的地址,不能用到另一个global或static地址池
PAT不支持H.323应用和名称服务的caching
当多媒体应用需要穿过防火墙时,不能使用PAT。多媒体应用会与PAT的端口映射冲突。
PAT不支持TCP ACL "established"选项。
PAT does work with DNS, HTTP, URL filtering, e-mail, FTP, passive FTP, Telnet,outbound traceroute, and the UNIX RPC and

rshell protocols.

结合使用NAT和PAT
Pix(config)# global (outside) 3 1.1.3.0 netmask 255.255.255.0
Pix(config)# global (outside) 3 interface
Pix(config)# nat (inside)3 0 0

阅读(1761) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~