网络拓扑图

要求:
PC1和PC2是外网用户,它们通过VPN接入局域网。
R0是局域网边界路由器,同时也作为VPN网关设备。
R1是外网路由器。
实验步骤:
配置R0,R1各端口
R0端口配置:

R1端口配置:

配置PC0,PC1,PC2,服务器
Pc0:

Pc1:

Pc2:

服务器IP配置:


尝试ping内网pc

不通
在R0上配置默认路由
注意:R0是边界路由器,不能在R0和R1间配置路由协议,只能配置默认路由。
R0(config)#ip route 0.0.0.0 0.0.0.0 200.110.24.2

配置AAA服务,为用户提供访问账户
R0(config)#aaa new-model!开启AAA认证
R0(config)#aaa authentication login vpn local!指定服务对象名
R0(config)#aaa authorization network vpnuser local!指定授权网络名
R0(config)#username zhang password zhangfei!创建VPN账户及密码
R0(config)#username guan password guanyu
标蓝的文字是参数,配置时可自行设置。黄底蓝字为之前定义过的参数。服务对象名和授权的网络名在配置IPSec时要使用,用户名和密码则提供给VPN用户。
配置VPN地址池
R0(config)#ip local pool vpool 192.168.1.100 192.168.1.253!地址池
“vpool”是地址池名,可自定义。

地址池中的地址必须和R1路由器连接的局域网一侧在同一网络内。地址数量需能容纳外网用户数。
配置IPSec第1阶段参数:isakmp协商
R0(config)#crypto isakmp policy 10 !定义isakmp协商参数
R0(config-isakmp)#hash md5 !指定验证算法
R0(config-isakmp)#encryption 3des!指定加密算法
R0(config-isakmp)#authentication pre-share!指定验证方式为共享密钥
R0(config-isakmp)#exit
R0(config)#crypto isakmp client configuration group msy!创建组,组名为msy
R0(config-isakmp-group)#key myvpn!组密钥
R0(config-isakmp-group)#pool vpool!地址池名
组名和组密钥需提供给用户,在建立VPN连接时使用。

配置IPSec第2阶段参数:ipsec配置
R0(config)#crypto ipsec transform-set TF1 esp-3des esp-sha-hmac!指定策略名、加密算法、验证算法
R0(config)#crypto dynamic-map dmap 10!动态加密图
R0(config-crypto-map)#set transform-set TF1!绑定策略
R0(config-crypto-map)#reverse-route!反向路由注入
R0(config-crypto-map)#exit

建立地图
R0(config)#crypto map vmap client authentication list vpn!绑定AAA服务
R0(config)#crypto map vmap isakmp authorization list vpnuser!绑定用户表
R0(config)#crypto map vmap client configuration address respond
R0(config)#crypto map vmap 10 ipsec-isakmp dynamic dmap!绑定动态加密图

把IPSec地图应用在设备接口上
R0(config)#interface s0/0/0
R0(config-if)#crypto map vmap

一.测试,使用PC1的浏览器访问192.168.1.1服务器/或者ping。看能否访问。
无法ping通,因为没有认证

浏览器也无法访问服务器

使用账号登录
二.使用PC1的桌面的VPN功能,输入组名,组密钥,主机(服务器)IP,账号,密码连接。观察是否连接成功及系统分配的内网IP是多少。PC2用另外一个账号连接。

连接成功

分配的内网IP是:

三.VPN登录后再访问服务器。
登录后能够访问服务器

抓包分析
四.观察访问服务器时每一步的数据包,观测是从哪一步开始进行ipsec保护的,以及ip报头的来源和目的ip。
公网pc ping 服务器数据包传输过程:
公网pc发出带ipsec封装的包

2、公网路由器router1 把包转发给router0

3、router0 把收到的包解开ipsec封装后,转发给交换机

4、交换机把解封后的包分别发给内网pc0和服务器

Pc0收到包发现不是访问自己的就不回应
服务器收到包开始回应,此时数据包未被加密

5、服务器发给交换机

6、交换机发给router0

7、router0收到包后进行加封装,然后发给公网(router1)

8、router1 收到加密的包发给目的pc2

9、pc2收到包进行解封


完成一次ping过程

五.桌面-命令提示符 查看PC1的IP设置(Ipconfig)

最后一行虚拟接口ip:192.168.1.103
六.PC0可否ping 通PC1,PC2?怎样ping?
用内网pc 能够ping通公网pc2的分配的地址:192.168.1.101

内网pc无法ping通公网pc2的公网地址200.130.24.1

推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/5986.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
打赏

微信支付宝扫一扫,打赏作者吧~
休息一下~~