Nat网络地址转换

 

Nat中的术语

----------------------------------------------------------------------------------------------------------------------------

静态NAT(一对一)

1.定义转换规则
Gateway(config)# ip nat inside source static [Inside local IP address] [Inside global IP address]

*1.1 具体端口映射
Gateway(config)# ip nat inside source static tcp\udp [Inside local IP address] [local tcp\udp port] [Inside global IP address] [global tcp\udp port]
for example:
Gateway(config)# ip nat inside source static tcp 192.168.1.1 80 12.1.1.1 8080
将本地内网192.168.1.1的80端口映射到本地公网12.1.1.1的8080端口

2.定义接口的内外方向
int f0/0 ----f0/0口为内
Router(config-if)# ip nat inside
int f0/1 ----f0/1口为外
Router(config-if)# ip nat outside

--------------------------------------------------------------------------------------------------------


动态NAT(多对多) ---- 轮询

1.定义公网的NAT池
Gateway(config)# ip nat pool [池名] [起始IP] [终止IP] netmask [掩码]

2.用ACL抓取要进行转换的ip
Gateway(config)# access-list [列表编号] permit [内网ip] [通配符](反掩码)

3.定义转换规则
Gateway(config)# ip nat inside source list [列表编号](参考2) pool [池名](参考1)

4.定义接口的内外方向(参考静态NAT)

--------------------------------------------------------------------------------------------------------------

 

端口映射PAT(一对多)

1.用ACL抓取要进行转换的ip
Gateway(config)# access-list [列表编号] permit [内网ip] [通配符](反掩码)

2.定义转换规则
Gateway(config)# ip nat inside source list [列表编号](参考1) interface [出接口] overload

3.定义接口的内外方向(参考静态NAT)

 

NAT练习题

 

 

 

看到这里您辛苦了,谢谢 : )

 

—————————————————————————————————————————————————————————————————————————————

声明:

  本文为 大Yi巴狼 对自己所学的知识整理和实现。

  本文档欢迎自由转载,但请务必保持本文档完整或注明来之本文档。本文档未经 大Yi巴狼 同意,不得用于商业用途。最后,如果您能从这个简单文档里获得些许帮助,大Yi巴狼 将对自己的一点努力感到非常高兴;由于作者本人水平有限,如果本文档中包含的错误给您造成了不便,在此提前说声抱歉。

  祝身体健康,工作顺利。

posted @ 2014-07-14 14:35  大Yi巴狼  阅读(433)  评论(0编辑  收藏  举报