如何设置IPSec VPN客户端

简介


使用VPN,可以让你随时随地,通过加密的隧道,安全访问公司内网资源。

我们使用基于IPSec最新的协议IKEv2来实现VPN。这个协议提供了更可靠快速的认证,以及漫游不同网络的能力。更方便的是,很多常用操作系统,如Window 7以上,macOS,iOS都内置了官方的客户端,使用起来也非常顺畅便捷。

本文介绍了如何在Windows, macOS, Ubuntu, iOS和安卓上设置VPN客户端的方法。

预先准备

  • 下载CA证书
  • 从你的网管那里获取连接参数
    • VPN服务器的域名,类似‘vpn.creekside.network’形式;
    • 你的VPN账户名和密码;
  • 使用安卓手机的客户请下载客户端

Windows10


安装证书

Windows10安装证书的手续略为复杂,请参考以下胶片(点击左右侧箭头可翻页)。

1. 搜索应用程序mmc.exe并以管理员身份运行

2. 从文件菜单,选择添加/删除管理单元

3. 从左侧选择“证书”,然后点击中间的“添加”按钮

4. 选择计算机账户,然后点击下一步

5. 选择本地计算机,然后点击完成

6. 返回证书管理页面

7. 浏览到受信任的根证书颁发机构,鼠标右键,在所有任务菜单下,选择导入

8. 进入证书导入向导

9. 在文件名输入框右侧,点击浏览

10. 找到你之前下载的证书文件,点击打开

11. 浏览择证书保存选择选项,并选择受信任的根证书

12. 恭喜你,完成了证书导入流程

previous arrowprevious arrow
next arrownext arrow
Slider

设置连接

Windows已经内置了IKEv2 VPN客户端。你需要在第4步里填写你收到的VPN服务器设置信息:

  • VPN服务商:选”Windows内置”
  • 连接名称:你可以自定义便于记忆的名称
  • 服务器名称或地址:填写服务器域名
  • VPN类型:选择“IKEv2”
  • 登录类型:账户名和密码
  • 账户名:你的账户名

1. 从任务条右下角,点击网络连接图标。

2. 点击左侧的VPN选项。

3. 右边VPN页面下,选择添加VPN

4. 根据前面说明,填写相应的内容。不要使用图片中的信息

5. 你已完成设置,使用连接启动VPN。

previous arrow
next arrow
Slider

通过VPN访问互联网

IKEv2自动支持split tunnel功能,也就是只有远程网络才走VPN隧道,互联网流量还是走本地网关。在某些应用场景下,如果你希望使用公司的网络来访问互联网,就可以根据以下步骤完成进一步的配置。

1. 在 VPN 页面下, 点击相关设置下的 更改适配器选项

2. 鼠标右键点击VPN连接, 然后从下拉菜单中选择 属性

3.在对话框中,选择网络分页,然后选择TCP/IPv4一行,点击属性

4. 点击右下方的 高级...

5. 勾选在远程网络上使用默认网关,取消勾选自动跃点,并在下方的输入框内填入数字1

previous arrow
next arrow
Slider

Android


Android没有原生客户端,需要下载,并按以下步骤安装。

在应用商店里搜索 “Strongswan VPN Client” 并安装。你也可以从这里下载APK文件并手动安装。

1. 下载Strongswan VPN客户端

通过邮件,或者点击这个链接,下载证书文件到手机,并点击打开。

2. 保存证书文件到手机

选择右侧的证书安装工具,安装证书。

3. 安装证书

你可以用任何字符串命名你的证书,在证书用途上选择VPN应用。然后点击“OK”完成证书安装。

4. 配置证书

打开“Strongswan”应用程序。因为是第一次使用,页面会显示“无活跃VPN”。点击右上角的“添加VPN配置”。

5. 添加VPN配置

输入合适的配置参数(图例只是参考)
- 服务器地址: 输入发送给你的域名.
- VPN 类型: “IKEv2 EAP(用户名/密码)”
- 用户名: 你收到的用户名
- 密码: 你收到的密码
- CA证书: 确认“自动选择”已勾选.(缺省)

完成后保存。

6. 配置VPN连接

回到主页面,点击相应 的VPN配置,即可连接到VPN服务器。

7. 连接到VPN服务器
previous arrow
next arrow
Slider

macOS


首先按以下步骤安装证书:

  • 双击下载的证书文件。钥匙串访问应用会自动弹出一个对话框,并提示“钥匙串访问正在尝试修改系统钥匙串。输入密码以允许此次操作“
  • 输入你的计算机密码,然后点击修改钥匙串
  • 双击刚才新引入的VPN证书Creekside Networks Authority。一个参数设置窗口会弹出来,点击信任左侧的箭头,然后在IP安全 (IPSec)一栏中,把缺省的用不信任改成始终信任
  • 系统会再次要求你输入密码确认。确认完成后,刚才的改变会自动被保存下来。证书导入完毕。

接下来我们设置VPN连接。

  • 打开系统偏好设置,选择网络
  • 点击左侧网络列表框下面的“+“号;
  • 在弹出的对话框里
    • 选择接口为VPN
    • VPN类型缺省是IKEv2,这个不要改;
    • 服务名称项目里,你可以输入任何你喜欢的名字;
    • 完成后点击创建;
  • 在新的连接页面里,
    • 服务器地址:输入管理员发给你的域名;
    • 远程ID:和上述服务器地址一样的域名;
    • 本地ID:保持空白;
    • 点击认证设置…,在对话框里输入:
      • 用户名:你的VPN用户名;
      • 密码:你的VPN密码;
      • 完成后,点击“
    • 回到连接页面后,点击应用以保存刚才的设置;
    • 点击连接,你就会连接到VPN服务器了。

iOS


按照以下步骤配置VPN:

  • 使用隔空投送把证书文件发送到你的手机;
  • 一个对话框会自动弹出来,如果你有Apple Watch, 会首先提示你选择选择要安装的设备,选择iPhone,系统会提示描述文件已下载。
  • 打开设置应用,找到通用并打开
    • 向下滑动到描述文件一行出现,点击打开;
    • 在已下载的配置描述文件下方的列表里,点击Creekside Networks Authority一项;
    • 在随后出现的安装描述文件页面中,点击右上角的安装按钮;
    • 输入你的锁屏密码
    • 再次点击安装,证书安装就完成了。
  • 回到通用页面,我们开始配置VPN连接:
    • 向下滑动到VPN一行,点击打开;
    • 在页面的最后一行,点击添加VPN配置…,进入添加配置页面
      • 类型:使用缺省的IKEv2
      • 描述:VPN连接的名称,填写你公司的名称或者任意名字;
      • 服务器地址:输入管理员发给你的域名
      • 远程ID:和上述服务器地址一样的域名
      • 本地ID:保持空白
      • 用户鉴定:保持用户名不变
      • 用户名:你的VPN用户名;
      • 密码:你的VPN密码;
      • 最后点击左上角的完成
    • 回到VPN页面
      • 点选刚才设置的VPN连接;
      • 状态一栏,点击未连接右侧的开关;
      • 你就会连接到VPN服务器了。

Ubuntu


Ubuntu 16.04

首先,我们要下载Strongswan源码,编译并安装:

cd ~
sudo apt-get install -y libssl-dev libglib2.0-dev libnm-dev
wget http://download.strongswan.org/strongswan-5.6.3.tar.bz2
tar xjf strongswan-5.6.3.tar.bz2
cd ~/strongswan-5.6.3
./configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib \
   --disable-aes --disable-des --disable-md5 --disable-sha1 
   --disable-sha2 --disable-fips-prf --disable-gmp --enable-openssl \
   --enable-nm --enable-agent --enable-eap-gtc --enable-eap-md5 \
   --enable-eap-mschapv2 --enable-eap-identity
make
sudo make install

然后是NetworkManager的Strongswan插件。

cd ~
sudo apt-get install -y intltool libgtk-3-dev libsecret-1-dev \
  libnma-dev network-manager-dev libnm-util-dev libnm-glib-dev \
  libnm-glib-vpn-dev libnm-gtk-dev

wget http://download.strongswan.org/NetworkManager/NetworkManager-strongswan-1.4.4.tar.bz2

tar xjf NetworkManager-strongswan-1.4.4.tar.bz2
cd ~/NetworkManager-strongswan-1.4.4
./configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib

make
sudo make install

Ubuntu 18.04

我们先下载官方的Strongswan以及相应的NeworkManager插件。

sudo apt install -y strongswan libcharon-extra-plugins network-manager-strongswan

Setup VPN connections

VPN客户端安装好了,接下来是配置VPN连接。

  • Open System Settings, then select Network;
    • Ubuntu 16.04:
      • Click the + sign at the left-bottom corner, choice Interface type to VPN, then click Create;
    • Ubuntu 18.04
      • Click the + sign at the right side of VPN list.
  • A VPN connection type dialog box will pop out, choose IPSec/IKEv2 (Strongswan), click Create;
    • Now a configuration dialog box will pop out. fill in information as directed below;
      • Name: Any text you like to name the VPN connection
      • Gateway
        • Address: The VPN server’s domain name IT sent to you.
        • Certificate: Browse to choose the certificate file you received. 
      • Client
        • Authentication: Select “EAP
        • Username: Use the userid that is given to you.
        • Password:
          • Click the icon at the end of input box.
          • Select the 2nd option: Store the password for all users.
          • Input your password
      • Options:
        • Make sure you check the “Request an inner IP address”.
        • Optionally you may also check Enforce UDP encapsulation
        • Leave use IP compression unchecked.
      • Cipher Proposals
        • Leave this section blank.
    • Finally click the “Add” button to save the configuration.

如何设置IPSec VPN客户端》有107,573个想法

  1. Agger Hudson

    These days most vehicles will a few form of security system in lay down. The most simple connected with security often causes loads of errors. If your electronic ignition switch uses a security feature on it, it can fail and cause the vehicle not start. Basically what happens, is automobile thinks a

    回复
  2. Gravesen McCann

    Folks are wanting for suggests to obtain full size movies from household, it seems to be. From the sum of on the internet lookup counts for the words like “down load motion images on line for no cost”, “how to receive DVD movies cheaply” and so on, it suggests that plenty of persons want to enhance

    回复
  3. Wilkinson Voss

    Top Tips and Advice For Playing Slots at Joker Gaming โจ๊กเกอร์Joker Gaming is a leading online casino review website where you can get information on online slot machines from their slot machine reviews. This is one of the best sites for beginners and expert gamblers alike in finding ou

    回复
  4. Vinding Bernard

    In that location are mountain of hoi polloi now who interchange to the tv when it arrives to entertainment. Switch on your tv fit is an bang-up technique to arrest extinct the news program, find out your coveted television rig software package, or possibly project a celluloid. When several individua

    回复
  5. Malmberg Wall

    With more than ten years expertise and about seven hundred,000 shoppers served. PersonalMoneyStore.com is your dependable associate for easy payday loans online. Most of us facial area cash shortages every so often, and payday or installment loans is usually a wonderful useful resource that can assi

    回复
  6. Bean Fulton

    On the contrary, most RTA cabinets come in a wide associated with wood types and bothersome stains. No matter what an appealing kitchen might with selling of a property. Find below several steps in updating your kitchen.When you are considering making a change to your home, the kitchen is the a

    回复
  7. Bekker Christie

    Are you a devoted on the network shopper? If so, in that respect is a heavy hypothesis that you take in identified a excerpt of many matters and bargains on air. Only the likes of whole those factors and bring down damage premiums is the capacitance to set out something on-furrow without having remu

    回复
  8. fake rolex watches

    I have been browsing on-line greater than three hours today, but I by no means discovered any interesting article like yours.
    It’s beautiful price enough for me. Personally, if all webmasters and bloggers made just right
    content as you did, the internet might be a lot more helpful than ever before.

    回复
  9. live draw sydney

    This is really interesting, You’re a very professional blogger.
    I have joined your feed and stay up for looking for more of your great post.
    Additionally, I’ve shared your site in my social networks

    回复
  10. Grace Davies

    Get motivated to save lots of and finances with new Concepts from SavingSpot, the CashNetUSA web site. We’re normally including new posts to assist you Get the funds on track!By clicking ‘Get going NOW’, I affirm that I have examine, have an understanding of, and conform to the Disclaimer,

    回复
  11. Lauesen Gustavsen

    There are a full ton of amazing gadgets made available on line. More products and other gizmos allow you get satisfaction from your recent 1 unique now just like getting the Apple Tv set that enables you to stream Substantial definition movies and available television demonstrates on iTunes. You can

    回复
  12. Richard MacLean

    If you are searching to get a property theater projector, the most effective place to commit in a man or woman is from a retail retail outlet that specializes in promoting them. If there usually are not any of this form of retailer in which you reside, you can get on line and glance at numerous on-l

    回复
  13. Parker Skafte

    1) Shaker Kitchen Cabinets- The shaker kitchen cabinets are very much like a country style cabinet but it has a more modern twist to barefoot. So, if you want the country style we want it a little funkier, choose this form of cabinet.Ginger Maple shaker cabinets – this cabinet is made from

    回复
  14. Mccullough Berger

    French Own country. This kitchen style is known due to the country look but using a unique touch of French living. Provides a warm and elegant style of your kitchen. Over soft colors such as soft gold, sunny yellow, ocean tones, and other snack food. The pieces of furniture are made of wood with nic

    回复
  15. Decker Emery

    In reality, the involving “attraction” is something that stems from who an individual. Have you found that you may be only enthusiastic about a certain type of woman although every woman is unlike a personality perspective? Let us go in order to our topic – how to get a young lady. There are several

    回复
  16. ketamine hcl for sale

    We’re a bunch of volunteers and starting a brand new
    scheme in our community. Your web site offered us with useful information to work on. You’ve performed a formidable activity and our entire community
    will be thankful to you.

    回复
  17. Fields Mygind

    Schmerzen im unteren Rückenbereich sind nicht nur belastend, sondern schwächen zweifellos. Der einfachste Weg, um mit Ihren Rückenbeschwerden umzugehen, besteht darin, sich mit dem Thema vertraut zu machen, um Rückenschmerzen zu verstehen und nacheinander die idealen Strategien für Sie zu finden. Di

    回复
  18. Bradshaw Gaines

    Now, the particular design to formulate your custom cabinets can be tricky. An individual have no background on designing, sometimes as well check online for good quality cabinet designs and following that pick through to your idea. It will certainly be unique a person pick the size, the frame, the

    回复
  19. Skov Monrad

    Faucets: The most common types of finishes you’ll find on faucets are stainless steel, satin nickel, and brushed impeccable. More and more people are opt for a pull-out faucet. Much more cooking soup or pasta dishes a lot quicker. You can have the pot filler faucet installed right above the stove to

    回复
  20. Mohamad Levine

    Arts and Crafts. It features wooden cabinets with rich dark colors and classy glass cage doors. It showcases distinctive and artistic design, which makes your kitchen simply look stunning.Wooden Bakers racks can be fashioned after their antique predecessor. Commonly come from a shaker type

    回复
  21. Hodges Bjerre

    It doesn’t really matter how technically skilled the manager is. Genuinely offended he or she was a student in managing the performance of employees may be the real supply. That’s the reality.By possessing a plan you are allowing the winds of fortune to blow you every which way and you can

    回复
  22. Herndon Tychsen

    Dealing with films can be amongst the the most comfortable activities on the world. Image sitting quickly in your sofa future to a individual you genuinely really like, both of those equally of you basically just obtaining enjoyment in an in fact fantastic, Oscar variety movement picture. You know .

    回复
  23. Shoemaker Ehlers

    Right now, the globe is stuffed with online dating guidance. It’s a very important thing because there are several folks who suffer from difficulties with their romantic relationships. The rise of online dating sites and apps also has paved how for more courting guidance to become offered on the web

    回复
  24. Thyssen Monaghan

    We just provide the appropriate info that can help the corporation encourage its companies and Enable The shoppers come across and get the mandatory assistance a lot quicker.Annual Share Charge (APR) is really a evaluate of the price of credit, expressed to be a nominal yearly level. It pe

    回复
  25. Santos Riber

    3) Can you CONVENIENTLY ACCESS THE Seasoning? For instance, if you hang a vertical double-shelf spice rack on a wall underneath a kitchen cabinet, you have to enough room between the spice containers on very best shelf and the underside of your kitchen cabinet to be able to easily remove and replace

    回复
  26. Coughlin Hamann

    The primary benefit of tanning plants is that they are much less absorbent as well as are less prone to microorganisms and mold strikes. Using formaldehyde is a basic sun tanning technique. 60. 2 4.6 SKIN NATURAL LEATHER PROCEDURE Principle da Tanning is a technological procedure defined by chemical

    回复
  27. Katz McNamara

    If it is going to go with their stuff IT To be able to BE NEUTRAL IN Shade of! It’s also good if wall surfaces can remain are a warm neutral somewhere in the cream, pale yellow, tan or khaki range with white fit. Your own treasures can bring in accent color and your own personality, but exercise res

    回复
  28. Alexander Currie

    The reason that a good mood helps when gambling is how the mood itself helps to overcome bad beats or short runs of bad luck. If the mood is negative, it is harder to overcome these moments of misfortune.If I will take the losses and quit the overall game when luck is not at my side, I wil

    回复
  29. slotxo

    Hey! This is kind of off topic but I need some help from an established
    blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure
    where to start. Do you have any points or suggestions?
    Thank you

    回复
  30. Brask Klit

    For our online system you merely finish the mandatory facts and you should have access to your customized online dashboard. This includes:Irrespective of whether you receive extended repayment strategy will depend on your point out legislation plus your payday lender’s coverage. Usually, t

    回复
  31. Soccer Scarves

    Wow that was odd. I just wrote an very long comment but
    after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say excellent blog!

    回复
  32. Bengtsen Chapman

    Most folks are great for long-term vision and sweat. In much of our lives we plan and deal with the present while ready to look out for that future consequences of today’s choices and actions.It often does not matter how technically skilled the manager is. Beneficial he or she reaches mana

    回复

发表评论

邮箱地址不会被公开。