千家信息网

PIX配置手册三(nat)

发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,一、nat + glob1、内部地址转换外部地址池配置说明:nat (inside) 1 2.2.2.0 255.255.255.0 配置inside表glob (outside)1 1.1.1.10
千家信息网最后更新 2025年02月01日PIX配置手册三(nat)

一、nat + glob


1、内部地址转换外部地址池配置说明:


nat (inside) 1 2.2.2.0 255.255.255.0 配置inside表

glob (outside)1 1.1.1.10-1.1.1.20 配置outside表

sh nat 查看nat inside配置

sh glob 查看nat global配置

sh user 查看设备登陆用户

sh xlate 查看nat转换表

sh conn 查看目前连接的信息


clear xlate 清空xlate转换项

clear nat 清空nat inside配置

clear glob 清空nat global配置





2、外部地址不够,配置PAT,就是转换为out接口地址:


nat (inside)1 2.2.2.0 255.255.255.0

glob (outside)1 interface



3、nat+pat使用,对于有一段公网地址池,而又不够用的


nat (inside) 1 2.2.2.0 255.255.255.0

glob (outside) 1 1.1.1.10-1.1.1.20

glob (outside) 1 interface


4、acl控制nat

access-l nat per tcp any any eq telnet

nat (inside) 1 access-l nat

glob (outside)1 interface


sh access-l nat 查看acl nat列表




二、nonat(也称nat0)不改变原和目标

(内部地址访问外部地址不需要做转换)(静态配置,注意设备之间的路由)

1、identity nat跟nat具体地址(有xlate表项)

nat (inside) 0 2.2.2.0 255.255.255.0

2、bypass nat后跟acl (没有xlate表项)更节省资源


access-l nonat per ip 2.2.2.0 255.255.255.0 1.1.1.0 255.255.255.0

nat (inside) 0 access-l nonat


三、static + access

静态一对一映射(注意内部pix和路由器之间的路由)


1.static


static (inside,outside) 1.1.1.10 2.2.2.2

(outside:1.1.1.10 inside:2.2.2.2)

如果想让ping通测试:icmp对于pix来说不是一个有状态的协议,需要访问控制列表放行icmp


放行icmp:

access-l out per icmp any any echo

access-l out per icmp any any echo-

access-l out in interface outside



2.端口转换


static (inside,outside) tcp interface(也可以是外部地址) 2114 2.2.2.2 23(内部地址)

access-l out per tcp host 1.1.1.2 host 1.1.1.1 eq 2114

access-g out in interface outside(如果不支持直接应用,就需要进到借口模式去应用)



3.dos防御

static (inside,outside) 1.1.1.10 2.2.2.2 1000(最大的tcp连接数) 200(最大的tcp半开连接数)


sh static 查看static配置



4.access-list static(外部向内部发起一个telnet,通过acl坐静态映射)


access-l static per tcp host 2.2.2.2(内部地址) eq telnet host 1.1.1.2 里边出去的流量


static (inside.outside) tcp 1.1.1.10(外部地址) telnet access-list static(内部地址) 外边进来的转换


access-l out per tcp host 1.1.1.2 host 1.1.1.10 eq telnet (定义pix外部接口出去的流量)

access-group out in interface outside




注意:


穿越pix必须做nat 才能通过,然而会改变原和目标。nonat除外(也称nat0)不改变原和目标


icmp对于pix来说不是一个有状态的协议,需要访问控制列表放行icmp


放行icmp:

access-l out per icmp any any echo

access-l out per icmp any any echo-

access-l out in interface outside


0