网络地址转换与配置命令

静态NAT:
int f0/0
ip nat inside
exit
int fa0/1
ip nat outside
exit
ip nat inside source static 192.168.10.10 8.8.8.8 //将192.168.10.10装换为8.8.8.8

debug ip nat (特权模式下)监控nat动作映射关系

show ip nat translations 查看nat

no ip nat inside source static 192.168.10.10 8.8.8.8 //取消

动态NAT:

多个公网地址
ip nat pool test1 10.0.0.5 10.0.0.10 prefix-length 24 //建立地址池
ip nat pool test1 10.0.0.5 10.0.0.10 netmask 255.255.255.0

access-list 1 permit 192.168.10.0 0.0.0.255 //建立ACL列表

ip nat inside source list 1 pool test1 //允许列表1里面的主机可以去地址池里面拿公网地址。只能拿一次。

ip nat inside source list 1 pool test1 overload
//加overload可以反复拿。即当地址用完后,地址会返回到地址池可被再次使用

no ip nat inside source list 1 pool test1 overload //取消,删除
no access-list 1 //取消,删除
no ip nat pool test1 //取消,删除

就一个公网地址:
ip nat pool test1 10.0.0.3 10.0.0.3 netmask 255.255.255.0

access-list 1 permit 192.168.10.0 0.0.0.255 //建立ACL列表

ip nat inside source list 1 pool test1

动态PAT:基于端口的地址转换

ip nat inside source list 1 interface f0/1 overload

静态PAT:静态端口映射
ip nat inside source static tcp 192.168.10.100 23 interface f0/1 23
//将192.168.10.100的tcp的23端口映射到f0/1接口的23端口,即有人访问f0/1的ip地址的时候,那么访问到的就是192.168.10.100的23 端口

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值