如何设置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客户端》有44,998个想法

  1. sandfilteranlage|Poolfolie

    Comprehending the rules of football is just as critical as practicing drills or setting up your strength and endurance. Be certain that you know all of the policies of the sport inside of and out, and quiz yourself as soon as in a when to help cement the awareness in your intellect as you perform.<b

    回复
  2. Achtformbecken

    To poke out the bombardment living of your cellphone, pee indisputable that apps are not running game in the background knowledge at wholly multiplication. Or so apps bequeath keep to play unless you invalid them, and this rear end waste pipe your battery speedily. Curb your settings to control what

    回复
  3. Fogh Thomasen

    Look at reality. In case you’re going decide upon someone to literally offer the gift of success to, who is it going to be? Generally it will most likely be an end relative or friend; somebody who you chosen. You wouldn’t give someone else this gift, just as it is on your team. An individual do whic

    回复
  4. solicitor

    After I originally commented I appear to have clicked on the
    -Notify me when new comments are added- checkbox and from now on every time a comment
    is added I get 4 emails with the exact same comment.

    Perhaps there is a way you can remove me from that service?
    Thanks!

    回复
  5. mejaqq

    I simply could not go away your web site prior to suggesting that I actually loved the usual information a
    person supply in your visitors? Is going to be again ceaselessly in order to
    check out new posts

    回复
  6. Campbell Castro

    The Emperor Casino is an online poker room that offers players the chance to play games in a fun and safe environment. This has made it very popular with gamers and attracted new players who enjoy playing poker in a fun online setting. The atmosphere of the site is highly relaxing, and players are f

    回复
  7. "escort video"

    Hi! I just wanted to ask if you ever have any problems with
    hackers? My last blog (wordpress) was hacked and I ended up losing
    a few months of hard work due to no back up.

    Do you have any solutions to protect against hackers?

    回复
  8. Kehoe Gram

    The Emperor Casino is an online poker room that offers players the chance to play games in a fun and safe environment. This has made it very popular with gamers and attracted new players who enjoy playing poker in a fun online setting. The atmosphere of the site is highly relaxing, and players are f

    回复
  9. Achtformpool

    Conditioning and endurance are quite important if you want to be a great football participant. Being ready to physically make it to the stop of a sport in leading kind will make you a person of the finest gamers on the industry. So, just take your conditioning to the following amount and increase yo

    回复
  10. Rivas Crabtree

    Not only do you to enjoy more native applications and apps of the Android Market, you get to share the link of your favorite apps with friends. Since there are thousands upon many hundreds of apps this particular app offering, it is actually to stray in puzzlement. If ever you see an app interesting

    回复
  11. Ovalpools|Holzpool

    If you neediness to ease up your preadolescent a prison cell phone, pretend certain you make them a program that fits your budget and their needs. If they alike to schoolbook a lot, you should think plans that get outright texting. If you don’t, you Crataegus oxycantha cease up with a Brobdingnagian

    回复
  12. Pauljek

    [url=https://tunepharmacy.com/]secure medical online pharmacy[/url] [url=https://ktpills.com/]lexapro 60 mg[/url] [url=https://utcialis.com/]where can i buy cialis cheap[/url] [url=https://cialisitab.com/]canadian cialis pills[/url] [url=https://beipharmacy.com/]canadian pharmacy ltd[/url]

    回复
  13. bathing dog

    Heya i am for the primary time here. I came across this board
    and I find It really helpful & it helped me out a
    lot. I am hoping to provide one thing back and help others
    like you helped me.

    回复
  14. Langhoff Tuttle

    As I stated, downloadable products could be reports, ebooks, software, even music or videos. Should create a product, place it in searching for format, and then sell on it via websites, forums, eBay, Craigslist, etc. It is a lot of regarding this topic, probably an excessive amount of to list here s

    回复
  15. Kirkeby Dickey

    The first thing you must do is thank them and show genuine joy that you were place help those. Then ask them for their permission to use their testimonial on your internet. In our experience, about 50% of those will a little more than content with let you should this. 2 or 3 well-crafted testimonial

    回复
  16. Jasonjek

    [url=http://ffppharm.com/]where can i buy clomid pills online[/url] [url=http://extpharmacy.com/]northern pharmacy canada[/url] [url=http://viagrapmed.com/]where to purchase viagra[/url] [url=http://isafemeds.com/]order doxycycline online uk[/url] [url=http://alaviagra.com/]female viagra tablets price in india[/url] [url=http://mebendazolevermox.com/]buy vermox over the counter uk[/url] [url=http://nrxbuy.com/]clomid 250mg[/url] [url=http://cialiskey.com/]over the counter tadalafil[/url] [url=http://feviagra.com/]viagra .com[/url] [url=http://zoviraxmedication.com/]zovirax tablets online uk[/url]

    回复
  17. Poolfolie|Stahlwandpool|Swimmingpools

    If you own a wise phone, you in all probability employ it constantly. You postulate to closed them blue every straight off and then. Smartphones are jolly practically small computers. Hit the readjust push button clears the memory board and helps turn down rapscallion apps from hogging resources. Yo

    回复
  18. Aufstellbecken

    Buying a new computer can seem like an intimidating task. Don’t worry, everything can be made easier when you have good tips and advice to follow. Continue to read and learn how veteran computer buyers find what they need.While a desktop doesn’t afford the portability a laptop does, it pac

    回复
  19. Mills Bowers

    What did your insurance broker say when you told them you installed your own alarm system and wanted an insurance discount? They probably informed you to send them a coverage certificate belonging to the alarm little. These certificates are signed and verified by protection dealers guarantee that th

    回复
  20. Monaghan Ryberg

    The Orders table lists all current orders, with table headings order ID, customer ID, order date, number of items, cost etc. The database designer would are coming up with a link between the customer ID field in client table and also the customer ID field the actual world Orders workdesk. When the s

    回复
  21. Jokumsen Todd

    The Emperor Casino is an online poker room that offers players the chance to play games in a fun and safe environment. This has made it very popular with gamers and attracted new players who enjoy playing poker in a fun online setting. The atmosphere of the site is highly relaxing, and players are f

    回复
  22. Fermanagh Pest Control

    Unquestionably believe that which you stated. Your favorite reason seemed to be on the net
    the easiest thing to take into account of.
    I say to you, I certainly get annoyed at the same time as other folks consider issues that they just do not know about.
    You managed to hit the nail upon the top as smartly as defined out
    the entire thing with no need side effect , other people could take a signal.
    Will likely be again to get more. Thank you

    回复
  23. McClure William

    This yr, the location’s main novice observe sequence starts off its 30 1st temperature as youthful female athletes contend in the Colgate Women’s Match titles.A large amount more than 11,000 girls and females, from first high-quality to produce-up-higher education or college age, will cont

    回复
  24. daftar dewatogel

    I’m impressed, I have to admit. Rarely do I come across a blog that’s equally educative and engaging, and let me tell you,
    you have hit the nail on the head. The issue is an issue that
    too few people are speaking intelligently about. I am very happy that I stumbled across
    this during my search for something relating to this.

    回复
  25. Thorsen Glenn

    Avenger Casino is a new online casino that promises to deliver a safe and reliable play experience for all its members. The concept behind the Avenger Casino is to create a kind of home field advantage by allowing players who play at home to make their favorite gambling decisions in the comfort of t

    回复
  26. Simon Garcia

    And then, today, I checked Yahoo and there we were #1 or #2 on Yahoo several kinds quite a few search situations! It works!!! We were top ranked for especially three dozen different search words! Financial Planner Victoria – #1! Retirement Victoria BC – #1! Tax planner Victoria – #1! And the like. I

    回复
  27. Eyejek

    [url=http://viagrapmed.com/]viaga[/url] [url=http://femcialis.com/]cialis pills uk[/url] [url=http://asmpharmacy.com/]best online foreign pharmacy[/url] [url=http://tnspills.com/]modafinil in south africa[/url] [url=http://extracialis.com/]cialis canadian pharmacy[/url] [url=http://viagradpn.com/]price of viagra in mexico[/url] [url=http://cialisactive.com/]where to buy cialis online in canada[/url] [url=http://dbcialis.com/]generic cialis 10mg[/url] [url=http://pharmacymay.com/]pharmacy online shopping usa[/url] [url=http://stviagra.com/]cheap generic viagra online uk[/url]

    回复
  28. Carljek

    [url=http://otrpills.com/]seroquel bipolar ii[/url] [url=http://arfhealth.com/]provigil price in india[/url] [url=http://cialisotab.com/]online pharmacy cialis 20 mg[/url] [url=http://cialisatab.com/]price for cialis in canada[/url] [url=http://feviagra.com/]viagra 6[/url]

    回复
  29. funeral printer

    I like the helpful info you provide in your articles.
    I’ll bookmark your weblog and take a look at once more here frequently.
    I am moderately sure I’ll learn plenty of new stuff proper right here!
    Good luck for the next!

    回复
  30. 타오바오직구

    Greetings! This is my first visit to your blog! We are a team of volunteers and starting
    a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done
    a outstanding job!

    回复
  31. Wiberg Liu

    If believe you’d be working you’d work for an unseen employer the response is no. When possible work just by yourself and appreciate all need to as very. You are unengaged to choose your time, your wage, and the workplace and of course your residential.At all stages show your bank you’re o

    回复
  32. Potassium Cyanide KCN 100mg Capsules

    A sensible way to lose weight would be to eat only if you’re sensing feeling hungry. One of the biggest explanations why folks are heavy is that they try to eat when they really feel bored. By only having when you’re eager, you’re more likely to stay fit and you won’t think about food as much.<

    回复

发表评论

邮箱地址不会被公开。