打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
在路由器上配置NAT的实验目的和方法

NAT是网络地址转换(Network Address Translation)的缩写,是属于广域网技术里把私网地址转换成公网地址的一种普遍应用的技术,通过在路由器上配置NAT可以解决IP地址不够用的麻烦,而且可以让私网内的设备免受外网的攻击。下面就是一个通过路由器配置NAT的实例实验,目的、环境和方法都一一列出。

实验目的:
通过配置静态源地址转换,使内网的R4可以访问外网的R5
配置动态源地址转换。使内网的R2可以访问外网的R3
设置R1的f0/0为inside端口,s2/0为outside端口。
实验环境:
拓扑图如上,R1的S2/0口与R3,R5通过FRAME-RELAY交换机连接形成外网。R1的F0/0口通过局域网交换机与R2,R4连接形成内网。
配置实例
R1
conf t
ip nat inside source static 1.1.2.4(local) 1.1.3.5(global)                             /*静态源地址转换
ip nat pool pool1 1.1.3.2 1.1.3.3(global ip)  prefix-length 24                /*创建地址池,动态源地址转换
ip nat inside source list 1 pool pool1                                   /*使ACL与地址池对应
access-list 1 permit 1.1.2.0 0.0.0.255
int f 0/0
ip ad 1.1.2.1 255.255.255.0
ip nat inside                                                                             /*配置f0/0为inside端口
no shut
exit
int s2/0
ip ad 1.1.3.1 255.255.255.0
encap frame
no arp f
no frame inver
frame map ip 1.1.3.3 103 b
frame map ip 1.1.3.5 105 b
ip nat outside                                                                             /*配置s2/0为outside端口
no shut
end
R2
conf t
int f 0/0
ip ad 1.1.2.2 255.255.255.0
no shut
end

R3
conf t
int s2/0
ip ad 1.1.3.3 255.255.255.0
encap frame
no arp f
no frame inver
frame map ip 1.1.3.1 301 b
no shut
end

R4
conf t
int f 0/0
ip ad 1.1.2.4 255.255.255.0
no shut
end

R5
conf t
int s2/0
ip ad 1.1.3.5 255.255.255.0
encap frame
no arp f
no frame inver
frame map ip 1.1.3.1 501 b
no shut
end
校验

R1#sh ip nat statistics
Total active translations: 1 (1 static, 0 dynamic; 0 extended)
Outside interfaces:
  Serial2/0
Inside interfaces:
  FastEthernet0/0
Hits: 0  Misses: 0
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 1 pool pool1 refcount 0
 pool pool1: netmask 255.255.255.0
        start 1.1.3.2 end 1.1.3.3
        type generic, total addresses 2, allocated 0 (0%), misses 0

R1#sh ip nat t
Pro Inside global      Inside local       Outside local      Outside global
--- 1.1.3.5                        1.1.2.4                   ---                           ---

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
NAT学习笔记--全国技能大赛 - 大赛人网站
浅析路由器NAT概念
如何在路由器上做NAT?
NAT的3种实现方式配置示范
ip nat inside / ip nat ouside
cisco路由器配置adsl拨号上网
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服