首页 > 其他 > 详细

思科 GNS3 配置 NAT 端口映射

时间:2014-11-22 23:20:30      阅读:2573      评论:0      收藏:0      [点我收藏+]

              NAT 端口映射

1. 实验拓扑

       使用GNS3模拟器版本 0.8.5

bubuko.com,布布扣


2.实验需求

1实现R2路由器上的C2 能够通过NAT端口映射上公网

2实现R1路由器上的C1能够通过NAT端口映射上公网

 

3.实验配置

  IP规划

C1

bubuko.com,布布扣

C2

bubuko.com,布布扣

R1(config)#int f0/0

R1(config-if)#ip add 12.0.0.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#int f

R1(config-if)#int f0/1

R1(config-if)#ip add 192.168.10.1 255.255.255.0

R1(config-if)#no sh


R2#conf t  

R2(config)#int f0/0

R2(config-if)#ip add 12.0.0.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#

R2(config)#int f0/1

R2(config-if)#ip add 192.168.20.1 255.255.255.0

R2(config-if)#no sh


 配置脚本

R1(config)#int f0/0

R1(config-if)#ip nat outside

R1(config-if)#int f0/1

R1(config-if)#ip nat inside 

R1(config-if)#exit

R1(config)#ip nat inside source static tcp 192.168.10.100 80 12.0.0.1 8080 extendable  80 端口映射到8080端口

R2(config)#int f0/0

R2(config-if)#ip nat outside           配置外网口 

R2(config-if)#int f0/1

R2(config-if)#ip nat inside             配置内网口

R2(config-if)#exit

R2(config)#ip nat inside source static tcp 192.168.20.100 80 12.0.0.2 80 extendable  80端口映射到80端口

R2(config)#ip nat inside source static tcp 192.168.20.100 25 12.0.0.2 25 extendable  25端口映射到25端口

 

 

R1(config)#router ospf 1                  做OSPF动态路由

R1(config-router)#network 12.0.0.0 0.0.0.255 area 0

R1(config-router)#network 192.168.10.0 0.0.0.255 area 0

R1(config-router)#end

R2(config)#router ospf 1

R2(config-router)#network 12.0.0.0 0.0.0.255 area 0

R2(config-router)#network 192.168.20.0 0.0.0.255 area 0

R2(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.1

4.结果验证:


bubuko.com,布布扣

bubuko.com,布布扣

映射成功 实验结束






思科 GNS3 配置 NAT 端口映射

原文:http://funinghua.blog.51cto.com/9125449/1581265

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!