Chinaunix首页 | 论坛 | 博客
  • 博客访问: 276866
  • 博文数量: 54
  • 博客积分: 992
  • 博客等级: 大尉
  • 技术积分: 609
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-12 20:40
文章分类

全部博文(54)

文章存档

2013年(1)

2012年(16)

2011年(37)

分类:

2012-02-16 03:16:24

cisco路由器内网接口 s1/0:192.168.1.1 255.255.255.0
外网接口 s1/1:10.0.0.1 255.255.255.0
服务器IP:192.168.1.100
route#conf t
route(config)#access-list 1 permit 192.168.1.0 255.255.255.0 #建立访问控制列表准备做net转换
route(config)#ip nat inside source list 1 interface s1/1 #建立net转换,将192.168.1.0 的地址转换为接口s1/1的地址
route(config)#int s1/0 #进入接口模式
route(config-if)#ip nat inside #设定接口模式
route(config-if)#ip nat inside #设定s1/0为nat内部接口
route(config-if)#int s1/1 #进入s1/1的接口模式
route(config-if)#ip nat outside #设定s1/1为nat外部接口
route(config-if)#exit
现在开始端口映射,让外网访问内网服务器
route(config)#ip nat inside source static tcp 192.168.1.100 3389 10.0.0.1 3389 extendable
route(config)#ip nat inside source static tcp 192.168.1.100 3389 10.0.0.1 3389 entendable #因为10.0.0.1这个地址已经应用在s1/1接口上并做了nat转换的地址,这里必须加上extendable这个关键字,负责报错。如果用另外的外网IP比如10.0.0.2 在这里就可以不加extendable

route#show ip nat transations #可以查看到端口映射的对应表
阅读(6484) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~