设为首页收藏本站language 语言切换
查看: 2712|回复: 3
收起左侧

[原创] IPsec VPN基础实验,希望能够帮助大家学好IPsec VPN

[复制链接]
发表于 2015-7-11 08:57:51 | 显示全部楼层 |阅读模式
一、拓扑图
Image.png

二、实验需求
     PC1和PC2能够通过VPN互联。
三、实验配置
1.基本IP配置
     R1的f0/1口IP为12.0.0.1,f0/0口为192.168.1.254做网关;R3的f0/0口IP为23.0.0.3;其余IP的配置均按照以上规律配置。
2.NAT配置,保证私网地址正常ping通公网地址。
R1:
conf t
in f0/1
ip nat outside
in f0/0
ip nat inside
exit
access-list 111 permit ip host 192.168.1.1 host 2.2.2.2
ip nat inside source list 111 int f0/1 overload
ip route 0.0.0.0 0.0.0.0 12.0.0.2

R3:
conf t
in f0/1
ip nat inside
in f0/0
ip nat outside
exit
access-list 111 permit ip host 192.168.2.1 host 2.2.2.2
ip nat inside source list 111 int f0/0 overload
ip route 0.0.0.0 0.0.0.0 23.0.0.2

测试:在R2(模拟运营商)上开启debug(debup ip icmp),并在PC1ping2.2.2.2,在R2上会看到如下图的回显。
1.png

上图证明:NAT已经生效,把原来从PC1发送的数据,转发到nat转换的f0/1的地址。
3.IPsec VPN配置。
R1:
conf t
crypto isakmp policy 10
encryption aes
hash md5
authentication pre-share group 2
exit
crypto isakmp key 6 123 address 23.0.0.3
crypto ipsec transform-set cy esp-md5-hmac esp-aes
crypto map yc 10 ipsec-isakmp
set transform-set cy
set peer 23.0.0.3
match address 122
access-list 122 permit ip host 192.168.1.1 host 192.168.2.1
in f0/1
crypto map yc

R3:
conf t
crypto isakmp policy 10
encryption aes
hash md5
authentication pre-share  group 2
exit
crypto isakmp key 6 123 address 12.0.0.1
crypto ipsec transform-set cy esp-md5-hmac esp-aes
crypto map yc 10 ipsec-isakmp
set transform-set cy
set peer 12.0.0.1
match address 122
access-list 122 permit ip host 192.168.2.1 host 192.168.1.1
in f0/0
crypto map yc
测试:在总公司(PC1)ping 分公司(PC2)的私网地址,如下图。
Image.png

各位有什么疑虑。可以随时联系我,我会尽我所能为大家解答。
本实验中有什么不对的地方欢迎指正。谢谢大家。




发表于 2015-10-20 13:11:40 | 显示全部楼层
最基础的配置
地板 2015-10-20 13:11:40 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-5-18 16:25 , Processed in 0.083066 second(s), 26 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表