



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
IPSec 穿越 NAT 实验 实验目的 掌握 IPSec 基本配置 熟悉 IPSec 穿越 NAT 特性原理 并且验证 拓扑说明 R1 NAT R2 设备通过 e0 0 和 e0 1 口之间相互连接 如图 具体试验连接接口 按照自己的配置 中间 NAT 设备提供地址转换功能 保证了 R1 到 R2 设备的连通性 这里 需要回顾 NAT 的配置 R1 R2 设备上面各自有 loopback0 口 接口地址配置如下 R1 E0 0 192 168 1 2 24 R1 Loopback0 10 1 1 1 24 NAT E0 0 192 168 1 1 24 NAT E0 1 202 106 0 20 24 R2 E0 0 202 106 0 21 24 R2 Loopack0 10 1 2 1 24 最终目标实现 10 1 1 1 到 10 1 2 1 地址的通信 保证使用了 IPSEC 加密 同时穿越了 NAT 设备并且注意这里的 NAT 是穿越运营商的 NAT 配置过程 1 首先配置各个设备的 ip 地址 保证设备的直连通信 同时保证了 nat 设备能够正常工 作 保证了从 R1 的 192 168 1 2 地址可以 ping 通 R2 设备的 202 106 0 21 地址 但 是反过来 ping 却不通 这是属于正常 因为中间有 nat 设备 做到这个效果 也就是 nat 的配置 2 进行 IPSEC 的具体配置 感兴趣的数据流使用访问控制列表配置 IKE 阶段一的配置 IKE 阶段二配置 还有 IPSEC 策略配置 以及最后把策略运行在接口上面 第一部分 配置所有接口的 ip 地址保证直连接通信 然后配置 NAT 特性 R1 配置 Router config hostname R1 设置 R1 设备主机名字 2 R1 config interface Loopback0 建立 loopback 口 并且给接口配置地址 R1 config if ip address 10 1 1 1 255 255 255 0 R1 config if exit R1 config interface Ethernet0 0 给 e0 0 接口配置 ip 地址保证设备之间连通性 R1 config if ip address 192 168 1 2 255 255 255 0 R1 config if no shutdown NAT 设备配置 Router config hostname NAT 设置 NAT 设备主机名字 NAT config interface Ethernet0 1 给 e0 1 接口配置 ip 地址保证与 R2 设备之间连通 性 NAT config if ip address 202 106 0 20 255 255 255 0 NAT config if no shutdown NAT config if ip nat outside 设置 nat 外网接口 NAT config if exit NAT config interface Ethernet0 0 给 e0 0 接口配置 ip 地址保证与 R1 设备之间连 通性 NAT config if ip address 192 168 1 1 255 255 255 0 NAT config if no shutdown NAT config if ip nat inside 设置 nat 内网接口 NAT config access list 10 permit 192 168 1 0 0 0 0 255 配置 nat 使用的访问控 制列表 NAT config ip nat inside source list 10 interface Ethernet0 1 overload 配置 nat 保证网连通 R2 配置 Router config hostname R2 设置 R2 设备主机名字 R2 config interface Loopback0 建立 loopback 口 并且给接口配置地址 R2 config if ip address 10 1 2 1 255 255 255 0 R2 config interface Ethernet0 0 给 E0 0 接口配置地址保证与 NAT 设备之间的连通 性 R2 config if ip address 202 106 0 21 255 255 255 0 3 R2 config if no shutdown 第二部分 1 首先在 R1 和 R2 上面配置访问控制列表定义感兴趣的数据流 也就是 ipsec 需要保护的 数据流 镜像配置 R1 config access list 101 permit ip 10 1 1 0 0 0 0 255 10 1 2 0 0 0 0 255 R2 与 R1 的互相为镜像 R2 config access list 101 permit ip 10 1 2 0 0 0 0 255 10 1 1 0 0 0 0 255 2 配置 R1 与 R2 的 IKE 的第一个阶段所需要的参数 R1 的配置 R1 config crypto isakmp policy 10 R1 config isakmp authentication pre share R1 config isakmp hash sha R1 config isakmp group 5 R1 config isakmp encryption 3des R1 config isakmp exit R1 config crypto isakmp key 0 cisco address 202 106 0 21 R2 配置 R2 config crypto isakmp policy 10 R2 config isakmp authentication pre share R2 config isakmp hash sha R2 config isakmp group 5 R2 config isakmp encryption 3des R2 config isakmp exit R2 config crypto isakmp key 0 cisco address 0 0 0 0 0 0 0 0 这里意思是允许任何 人给我建立 ike 的 peer 关系 3 配置 IPSec 阶段 2 里面需要的传输集 R1 config crypto ipsec transform set r1 esp 3des esp md5 hmac R2 配置和 R1 的配置是一样里面的参数必须一致 R2 config crypto ipsec transform set r1 esp 3des esp md5 hmac 4 建立 IPSEC 策略 捆绑访问控制列表 IKE PEER 以及传输集 R1 的配置 R1 config crypto map r1 map 10 ipsec isakmp NOTE This new crypto map will remain disabled until a peer R1 config crypto map match address 101 4 R1 config crypto map set peer 202 106 0 21 R1 config crypto map set transform set r1 R1 config crypto map exit R2 配置 R2 config crypto dynamic map r2 dymap 10 R2 config crypto map match address 101 R2 config crypto map set transform set r2 R2 config crypto map exit R2 config crypto map r2 map 10 ipsec isakmp dynamic r2 dymap discover 这里需要用动态的 map 表 因为是一端 ip 地址是动态的 需要自动发现功能 5 应用策略到接口上面 R1 配置 R1 config interface Ethernet0 0 R1 config if crypto map r1 map R2 配置 R2 config interface Ethernet0 0 R2 config if crypto map r2 map 最后验证 在 R1 设备上面扩展 PING R1 ping 10 1 2 1 source 10 1 1 1 Type escape sequence to abort Sending 5 100 byte ICMP Echos to 10 1 2 1 timeout is 2 seconds Packet sent with a source address of 10 1 1 1 Success rate is 100 percent 5 5 round trip min avg max 20 43 96 ms 这种 IPSEC 的建立过程必须有 R1 触发 可以使用命令 clear crypto sa 和 clear crypto isakmp 清空所有设备的 sa 然后从 R2 扩展 PING 发现不可以建立 IPSEC 可以在 中间的 NAT 设备上面使用命令看 NAT 的会话表 NAT sh ip nat translations Pro Inside glob
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026届山东省临沂市平邑县九年级化学第一学期期末检测试题含解析
- 就业协会工作总结
- 公司工作总结亮点
- 阿里市重点中学2026届九年级化学第一学期期中综合测试试题含解析
- 2026届湖北省宜昌市夷陵区化学九年级第一学期期中学业水平测试模拟试题含解析
- 2026届江苏省靖江市靖城中学九年级英语第一学期期末达标测试试题含解析
- 云南省红河州建水县2026届英语九上期末学业质量监测试题含解析
- 2025年中级风力发电场运维员技能考试题库及答案
- 2026届云南省昆明市实验中学化学九年级第一学期期中考试试题含解析
- 江苏省扬州市部分学校2026届九年级化学第一学期期中联考模拟试题含解析
- 理解当代中国 大学英语综合教程1(拓展版) B1U1课件 Unit1 Youth on the rise
- 永辉超市培训课件
- 河北计算机单招数学试卷
- 2025年辅警面试考试试题库目(答案+解析)
- 航运大数据分析与决策支持
- 2025至2030全球及中国两轮组合仪表行业产业运行态势及投资规划深度研究报告
- 2024公路运营领域重大事故隐患判定标准解读学习课件
- 耕地保护培训课件
- MES追溯管理制度
- 质量专项改善管理制度
- 人工智能智慧体育课件教学
评论
0/150
提交评论