VPN服务器的配置与管理
一、实验名称
VPN服务器的配置与管理
二、实验目的
1、掌握VPN技术
2、培养学生解决公司出差在外的员工安全访问公司内部网络问题的能力
3、培养学生采用安全的方法将分公司和总公司连接起来
4、加强网络管理的技能
三、实验环境
Microsoft Virtual PC 2004
四、实验过程:
任务一 实现远程办公方案
某公司每年的业务基本围绕着5、6个项目部进行,各个项目部基本是在与总部不同的地点作业,而且地点周期性地变化。总公司与各个项目部之间信息的传达、汇总和审查监督很重要。使用专线将各个项目部连接起来是一个方案,但成本高,而且随着地点的变化还需要重新架设。请你给出一个合适的方案实现各个项目部和总公司之间数据的安全传输。
1、方案描述
实验要使得公网上的Client用户可以通过VPN服务器访问内网的主机。
Client主机的网卡用物理网卡ip为10.0.0.1,RRAS主机的网卡用物理网卡的ip为10.0.0.254,另一网卡用local only网卡ip为192.168.0.254,DC主机用local only网卡ip为192.168.0.1。
2、实验模拟
客户端和服务器在同一个网络,拓扑图如下图所示:
1)设置各台计算机的TCPI/IP属性:
2)测试物理网络的连通性
采用的方法:
在Client主机上ping RRAS的任一网卡的ip地址
在DC主机上ping RRAS的任一网卡的ip地址
3)在RRAS上配置VPN服务器
开始---管理工具---路由和远程访问---配置并启用路由和远程访问---远程访问(拨号或VPN)---选择服务器连接外网的网卡(iP:10.0.0.254 )---远程客户端的地址分配范围(13.0.0.1-13.0.0.30)。
4)在VPN服务器上创建远程访问帐号,并赋予用户允许拨入的权限
计算机管理---新建用户帐号---允许拨入
5)在项目部的客户端上创建虚拟专用网络的拨号连接
新建连接向导---连接到我工作场所的网络---虚拟专用网络连接---VPN服务器的地址(10.0.0.254)。
6)VPN访问
输入具有访问权限的用户名和密码访问。
2、观察实验结果
1) VPN连接建立以后,各个项目部的计算机可以顺利的访问公司内部的计算机,用Tracert命令进行路由追踪,查看项目部的计算机发出的数据包通往公司内网的路径是什么?TTL值是多少?
13.0.0.1 》192.168.0.1 TTL=127
2) VPN连接建立以后,各个项目部的计算机能否ping通VPN服务器连接外网的地址?为什么?
不可以,因为此时的ip已经转换为vpn服务器的ip地址
任务二:分公司与总公司联网任务
某工程公司在全国各地都有分公司,随着公司规模的快速扩展,在公司总部应用上了各类应用系统。作为工程公司,设备、材料、计划、财务、工程、质量等分别建立了计算机设计和管理系统,分别设置有工程部、设计室、财务部、质检部、物资部、总经办等部门进行归口管理,在总部实现了信息系统的集中化处理。公司希望将总公司和各个分公司通过网络连接起来,使得数据操作人员可以随时连接和操作公司数据库,实现各种应用系统数据传递和整合。请你给出一个合适的方案解决上面的问题。
1、方案描述
实验要使得公网上的Client用户可以通过VPN服务器访问内网的主机。
Client主机的网卡用物理网卡ip为10.0.0.1,Server知己的网卡用物理网卡ip分别为10.0.0.254,11.0.0.254;RRAS主机的网卡用物理网卡的ip为10.0.0.1,另一网卡用local only网卡ip为192.168.0.1,DC主机用local only网卡ip为192.168.0.2。
2、客户端通过一个路由器到达服务器,拓扑图如下图所示:
1)设置各台计算机的TCPI/IP属性:
2)测试物理网络的连通性
采用的方法:
在Client主机上ping 去RRAS的任一网卡的ip地址
在DC主机上ping RRAS的任一网卡的ip地址
3) 按照前面的方法完成VPN服务器的配置,创建远程访问帐号,创建虚拟专用网络的连接。
4)VPN访问
2、思考并解决
1) 怎样使得客户端既能与公司内网进行安全连接,同时也能顺利连接Internet.
可以在客户端上安上两张网卡。
三、思考题
1、在以上两种不同的拓扑结构中,当VPN连接建立以后,从代表外网计算机去ping总公司内部的计算机的时候,TTL值为什么会相同?
因为建立VPN服务就相当于建立了一根连接客户端与VPN服务器之间的专线,所以无论客户端到服务器要经过到少路由器都是相同的TTL值。
2、当VPN连接建立以后,VPN客户端与原来Internet的连接受到影响,解决这个问题的方法有哪些?
可以在客户端上安上两张网卡.
四、学生小结
VPN可以提供的功能: 防火墙功能、认证、加密、隧道化。第一次登入还要更改密码。适合在外工作的员工访问公司内部的电脑。
第二篇:GRE VPN实验报告1
GRE VPN实验报告
实验拓扑图
实验要求:总公司和分公司相互通信,私网通过OSPF发布路由动态学习。
实验目的:熟悉掌握GRE配置,OSPF配置,静态路由发布等。
实验步骤
1.路由器接口IP基本配置。
AR0
[zong]int s0/0/2
[zong-Serial0/0/2]ip add 202.1.1.1 30
[zong-Serial0/0/2]undo shutdown
[zong-Serial0/0/2]int loo0
[zong-LoopBack0]ip add 192.168.1.1 24
AR1
[internet-Serial0/0/2]int s0/0/2
[internet-Serial0/0/2]ip add 202.1.1.2 30
[internet-Serial0/0/2]undo shutdown
[internet-Serial0/0/2]ping 202.1.1.1(直连测试)
PING 202.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 202.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 202.1.1.1: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 202.1.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 202.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 202.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 202.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/50 ms
[internet]int s0/0/1
[internet-Serial0/0/1]ip add 202.1.3.1 30
[internet-Serial0/0/1]undo shutdown
[internet-Serial0/0/1]int s0/0/0
[internet-Serial0/0/0]ip add 202.1.2.1 30
[internet-Serial0/0/0]undo shutdown
AR2
[fen1]int loo0
[fen1-LoopBack0]ip add 192.168.2.1 24
[[fen1-LoopBack0]int s0/0/0
[fen1-Serial0/0/0]ip add 202.1.2.2 30
[fen1-Serial0/0/0]undo shutdown
[fen1-Serial0/0/0]ping 202.1.2.1(直连测试)
PING 202.1.2.1: 56 data bytes, press CTRL_C to break
Reply from 202.1.2.1: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 202.1.2.1: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 202.1.2.1: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 202.1.2.1: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 202.1.2.1: bytes=56 Sequence=5 ttl=255 time=10 ms
--- 202.1.2.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/38/50 ms
AR3
[fen2]int loo0
[fen2-LoopBack0]ip add 192.168.3.1 24
[fen2-LoopBack0]int s0/0/1
[fen2-Serial0/0/1]ip add 202.1.3.2 30
[fen2-Serial0/0/1]undo sh
[fen2-Serial0/0/1]ping 202.1.3.1(直连测试)
PING 202.1.3.1: 56 data bytes, press CTRL_C to break
Reply from 202.1.3.1: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 202.1.3.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 202.1.3.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 202.1.3.1: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 202.1.3.1: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 202.1.3.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/32/50 ms
静态路由。
AR0,AR2,AR3与公网连接,配置缺省路由使其能访问外网。
[zong]ip route-static 0.0.0.0 0 202.1.1.2
[fen1]ip route-static 0.0.0.0 0 202.1.2.1
[fen2]ip route-static 0.0.0.0 0 202.1.3.1
测试:
AR0
[zong]ping 202.1.2.2
PING 202.1.2.2: 56 data bytes, press CTRL_C to break
Reply from 202.1.2.2: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 202.1.2.2: bytes=56 Sequence=2 ttl=254 time=70 ms
Reply from 202.1.2.2: bytes=56 Sequence=3 ttl=254 time=80 ms
Reply from 202.1.2.2: bytes=56 Sequence=4 ttl=254 time=70 ms
Reply from 202.1.2.2: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 202.1.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/60/80 ms
[zong]ping 202.1.3.2
PING 202.1.3.2: 56 data bytes, press CTRL_C to break
Reply from 202.1.3.2: bytes=56 Sequence=1 ttl=254 time=70 ms
Reply from 202.1.3.2: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 202.1.3.2: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 202.1.3.2: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 202.1.3.2: bytes=56 Sequence=5 ttl=254 time=60 ms
--- 202.1.3.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/62/70 ms
建立隧道Tunnel(GRE VPN)
AR0
与分一连接Tunnel0
[zong]int Tunnel 0/0/0
[zong-Tunnel0/0/0]tunnel
[zong-Tunnel0/0/0]tunnel-protocol gre
[zong-Tunnel0/0/0]source 202.1.1.1
[zong-Tunnel0/0/0]destination 202.1.2.2
[zong-Tunnel0/0/0]ip add 10.1.1.1 30
[zong-Tunnel0/0/0]dis th
#
interface Tunnel0/0/0
ip address 10.1.1.1 255.255.255.252
tunnel-protocol gre
source 202.1.1.1
destination 202.1.2.2
#
[zong-Tunnel0/0/0]q
分二连接Tunnel1
[zong]int Tunnel 0/0/1
[zong-Tunnel0/0/1]tunnel-protocol gre
[zong-Tunnel0/0/1]source 202.1.1.1
[zong-Tunnel0/0/1]destination 202.1.3.2
[zong-Tunnel0/0/1]ip
Oct 31 20## 17:48:57-08:00 zong DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 36, the change loop count is 0, and the maximum number of records is 4095.
add 10.1.1.5 30
[zong-Tunnel0/0/1]dis th
#
interface Tunnel0/0/1
ip address 10.1.1.5 255.255.255.252
tunnel-protocol gre
source 202.1.1.1
destination 202.1.3.2
AR2分一
连总tunnel0
[fen1]int Tunnel 0/0/0
[fen1-Tunnel0/0/0]tunnel-protocol gre
[fen1-Tunnel0/0/0]source 202.1.2.2
[fen1-Tunnel0/0/0]description 202.1.1.1
[fen1-Tunnel0/0/0]ip add 10.1.1.2 30
[fen1-Tunnel0/0/0]dis th
#
interface Tunnel0/0/0
description 202.1.1.1
ip address 10.1.1.2 255.255.255.252
tunnel-protocol gre
source 202.1.2.2
destination 202.1.1.1
#
return
AR3分二
连总Tunnel1
[fen2]int Tunnel 0/0/1
[fen2-Tunnel0/0/1]source 202.1.3.2
[fen2-Tunnel0/0/1]destination 202.1.1.1
[fen2-Tunnel0/0/1]ip add 10.1.1.6 30
[fen2-Tunnel0/0/1]dis th
#
interface Tunnel0/0/1
ip address 10.1.1.6 255.255.255.252
tunnel-protocol gre
source 202.1.3.2
destination 202.1.1.1
#
return
[fen2-Tunnel0/0/1]
发布OSPF动态学习路由(隧道类似OSPF虚链接)
AR0总
[zong]ospf
[zong-ospf-1]area 0 ^
[zong-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[zong-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3
[zong-ospf-1-area-0.0.0.0]network 10.1.1.4 0.0.0.3
[zong-ospf-1-area-0.0.0.0]dis this
#
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 10.1.1.0 0.0.0.3
network 10.1.1.4 0.0.0.3
#
return
[zong-ospf-1-area-0.0.0.0]
AR2分一
[fen1]ospf
[fen1-ospf-1]area 0
[fen1-ospf-1-area-0.0.0.0]network 192.168
Oct 31 20## 18:04:10-08:00 fen1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 20, the change loop count is 0, and the maximum number of records is 4095.
.2.0 0.0.0.255
[fen1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3
[fen1-ospf-1-area-0.0.0.0]dis th
#
area 0.0.0.0
network 10.1.1.0 0.0.0.3
network 192.168.2.0 0.0.0.255
#
return
[fen1-ospf-1-area-0.0.0.0]
AR3分二
[fen2]ospf
[fen2-ospf-1]area 0
[fen2-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[fen2-ospf-1-area-0.0.0.0]network 10.1.1.4 0.0.0.3
[fen2-ospf-1-area-0.0.0.0]dis th
#
area 0.0.0.0
network 192.168.3.0 0.0.0.255
network 10.1.1.4 0.0.0.3
#
return
[fen2-ospf-1-area-0.0.0.0]
测试总分公司的连通。
AR0
ping 192.168.2.1
PING 192.168.2.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=255 time=430 ms
Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=255 time=90 ms
Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=255 time=90 ms
Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=255 time=100 ms
Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=255 time=70 ms
--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 70/156/430 ms
ping 192.168.3.1
PING 192.168.3.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.3.1: bytes=56 Sequence=1 ttl=255 time=100 ms
Reply from 192.168.3.1: bytes=56 Sequence=2 ttl=255 time=60 ms
Reply from 192.168.3.1: bytes=56 Sequence=3 ttl=255 time=90 ms
Reply from 192.168.3.1: bytes=56 Sequence=4 ttl=255 time=60 ms
Reply from 192.168.3.1: bytes=56 Sequence=5 ttl=255 time=90 ms
--- 192.168.3.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/80/100 ms
AR2分一
ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=60 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=60 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/52/70 ms
ping 192.168.2.1
PING 192.168.2.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=255 time=1 ms
--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/14/30 ms
AR3分二
ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=60 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=60 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=60 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=60 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/64/80 ms
ping 192.168.2.1
PING 192.168.2.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=254 time=90 ms
Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=254 time=110 ms
Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=254 time=90 ms
Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=254 time=90 ms
Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=254 time=90 ms
--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 90/94/110 ms
路由分析:
AR0
tracert -a 192.168.1.1 192.168.2.1(到分一)
traceroute to 192.168.2.1(192.168.2.1), max hops: 30 ,packet length: 40,press CTRL_C to break
110.1.1.2 130 ms 60 ms 60 ms
tracert -a 192.168.1.1 192.168.3.1(到分二)
traceroute to 192.168.3.1(192.168.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break
110.1.1.6 40 ms 70 ms 60 ms
AR2
tracert -a 192.168.2.1 192.168.1.1
traceroute to 192.168.1.1(192.168.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.1.1.1 60 ms 70 ms 60 ms
tracert -a 192.168.2.1 192.168.3.1
traceroute to 192.168.3.1(192.168.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.1.1.1 60 ms 60 ms 60 ms
2 10.1.1.6 110 ms 130 ms 90 ms
AR3
tracert -a 192.168.3.1 192.168.1.1
traceroute to 192.168.1.1(192.168.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.1.1.5 50 ms 60 ms 60 ms
tracert -a 192.168.3.1 192.168.2.1
traceroute to 192.168.2.1(192.168.2.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.1.1.5 60 ms 60 ms 70 ms
2 10.1.1.2 110 ms 100 ms 100 ms
可看出路由通过隧道。
总结分析:GRE VPN通过封装在数据包加上GRE头部,建立隧道连接。
例子:192.168.1.1到192.168.2.1.
数据经过普通封装成私网IP包到达AR0
AR0解封装看到目标地址,查路由,找到出接口。
出接口是GRE VPN的Tunnel0,对数据包加上GRE封装成公网数据包。查路由经过物理链路发送
到达AR2,查路由在自己直连网段,解封装看到GRE协议号交给Tunnel0处理。
Tunnel0解封装看到私网IP,转发。