如何设置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,682个想法

  1. Real Estate Investing - Fear Factors Conquered|How To Have A Real Estate Marketing Plan|Trading Time For Money|Top 5 Reasons Get The Livewire Gps Tracker|11 Cup Food Processor - A Total Time And Money Saver Ultimately Kitchen

    I desired to take time to reveal to you some actual time forex trading tips to assist put you in profitable positions of trade. This is the tough business and it needs a associated with persistence and evolution of thinking if you hope to get great at it. There’s over <a href="https://vimeo.com/boo

    回复
  2. Pingback引用通告: 7zc8f人氣連載小說 大奉打更人 ptt- 第两百一十九章 本官许七安 熱推-p2g9ll – 夢定書局

  3. pastillas cytotec quito

    Cytotec Ecuador explica ¿Qué es exactamente la píldora abortiva?Aunque “píldora abortiva” es el nombre popular que se le da a este procedimiento en una clínica de aborto, no es sólo una píldora y no es tan simple como muchas personas creen. Elegir tener cualquier tipo de aborto es una decisión

    回复
  4. www

    This is really interesting, You’re a very skilled blogger.

    I have joined your rss feed and look forward to seeking
    more of your wonderful post. Also, I’ve shared
    your web site in my social networks!

    回复
  5. air 73 Pendant black/clear glass

    You really make it seem so easy with your presentation but I find this matter to be really
    something that I think I would never understand.
    It seems too complex and extremely broad for me. I am looking forward for your next post, I’ll try to get the hang of it!

    回复
  6. Mistakes - A New Real Estate Investor Should Avoid|Real Estate Letters - Here's How And Why To Give Each Series Continuity|Trick Or Treat - Is This Make-Believe Bugs Real Business?|The Real Role Of Sales Managers

    Mistakes – A New Real Estate Investor Should Avoid or, if you wish, contemporaneous documentation, boost the effectiveness and efficiency of a person can use period and. Assume some activity you just finished, absolutely no matter how small, eventuall

    回复
  7. Pingback引用通告: qygvf超棒的小說 大奉打更人討論- 第一百九十二章 许七安:二郎,大哥教你养鱼套路 -p3b7ta – 青芝書簽

  8. Pingback引用通告: syto2火熱仙俠小說 大奉打更人- 第一百二十二章 临安公主召见 分享-p36PmX – 年希站讀

  9. Pingback引用通告: iuv18精彩絕倫的小說 大奉打更人討論- 第三章 仙侠世界一样能推理 讀書-p3bs6c – 聖迪閣樓

  10. St Heliers' Real Estate|Blogging Instantly - Is It Possible To Predict Upcoming?|Identifying Your Real Identity|Mistakes - A New Real Estate Investor Should Avoid|Real Time Tracking Device - Can Be Live Gps Tracking?

    Have you ever wondered how it’s like to sit down in a really time Foreign exchange trading room? In order to over the shoulder of something like a professional Forex investor while might educating, instructing, and guiding a room full of hungry, in order to learn and make money traders so they too c

    回复
  11. Pingback引用通告: e1efm超棒的修仙小說 大奉打更人 線上看- 第七十八章 你来啦 讀書-p1inLu – 凌珍資料

  12. How Get Hold Of Real Estate For Back Due Tax - One Frequently Overlooked Technique|How To Think About For Good Real Estate Agents|Self Sabotage - Never A Choice In True To Life|Real Estate: Good Good Buy A Small

    Leaders transform vision into reality by rallying their team around more than merely a well articulated idea – by truly engaging them your market strategy to get there. Execution of the manner is where most leaders and businesses fail for the reason that variables which affect strategy aren’t static

    回复
  13. theatre lights|theatre lights

    LED stage lighting has moved from strength to strength over recent years and has become the go-to option for some. For a presentation to be perfect, it needs to have perfect lighting. Maybe you have been to a show where in fact the lighting was too dim or too bright and just a standard distraction?

    回复
  14. Nokia E5 - A Smartphone As Part Of Your Everyday Life|How To Handle Working Inside The Second Job|What Appear For For In A Second Hand Windsurfing Board - 4 Top Tips|Free Mobile Apps Are Changing The Way You Send Free Messages

    Ever obtain the feeling that even although you may be putting within your best efforts, you don’t seem to get too very much? Maybe all you decide to do might be to stay updated with the ever changing technological land. Get yourself the Blackberry 8820 smartphone. With its stylish and clean exterior

    回复
  15. Pingback引用通告: whgch超棒的修仙小說 大奉打更人 小說大奉打更人笔趣- 第一百四十九章 首辅大人,楚州出事了 -p32kv6 – 為其閲讀

  16. このサイトに行く|タオバオ 出店 代行|個人輸入代行

    では販売!となった場合は、その商品が偽物でないかしっかり確認しましょう! しかし、その物量が多くなり販売目的の場合は注意が必要となります。 ヤフオク!などが有名です。目ぼしい商品を仕入れて、一円出品すればかなりの高確率で利益が出ます。事前に利益計算を行う際にはこの計算式に当てはめて計算をするだけですので、複雑な計算をしなくても手数料が把握出来る点が良いですね。算出方法はやや複雑で、個人輸入or商用によっても大きな違いがあります。代行手数料の計算がわかりやすいだけでなく、検品や国際送料に関しても料金形態がシンプルにまとまっているので、コストの計算がしやすいです。商品の仕入れだけでなく、商

    回复
  17. Pingback引用通告: qz0ju精彩修仙小說 大奉打更人討論- 第一百三十八章 遇袭 相伴-p14TyB – 林亨書局

  18. buy proxies ipv6

    Whatever its form taxation is taxation and remains the forcible expropriation of someone’s property without their consent. No free society can exist where such a taxation system exists. The two are incompatible. A free society are only able come into being when all transactions are based on mutual a

    回复
  19. The 60 Second Resume Job Interview Strategy!|Htc S620 Mobile Phone Overview!|How To Earn Lindens And-Or Get A Job In Second Life|The Basics Of Second Mortgage Loans|The Best Tips The Way To Get Another Method Date

    Blackberry curve 8520 is an intelligent smartphone with a features for its users. Along with 35key back lit QWERTY keyboard, you are able to carry out all operations at advantage. Blackberry Curve8520 is a smartphone, so all functions are completed by getting smart directions from the mobile phone i

    回复
  20. Ciphone C9 3Gs Smartphone Brings More Exciting Features You'd Want|The Htc Sensation - Revolutionizing Htc's Outlook On Mobile Technology|How Smartphone Apps Enable In Living A Healthy Lifestyle?|125% Second Mortgage - A Few Things Realize

    As you know, your bad credit score can make it more tough qualify to borrow. However, since a second mortgage is really a secured loan, it indicates that your lender does a few security on the inside deal – namely the equity within your home being used as fairness. Therefore, the fact a person need

    回复
  21. Pingback引用通告: weqh5扣人心弦的修仙小說 大奉打更人 小說大奉打更人笔趣- 第九十九章 战书 鑒賞-p23KC5 – 禾禎閲讀

  22. Pingback引用通告: 9amc8妙趣橫生仙俠小說 大奉打更人- 第两百一十八章 人与人之间的信任 讀書-p3MLCz – 屏亞資料

  23. 中国輸入代行|中国仕入れ|タオバオ代行

    簡易的な商品画像の撮影、サプライヤーからの画像提供、中国語タグ外し、不用品の取り出し作業、新しいOPP袋に入れ替え、包装作業など、定率の検品手数料の範囲内でおこなう作業の範囲が広いのが魅力でしょう。梱包! エンドユーザーへ直送!購入、開梱検査プラン…商品を一つ一つ開梱して丁寧に検品しているので不良品が日本に届く可能性も少なく、無駄な費用を発生させずに済みます。調査費用(インボイス等書類作成費含む)… さまざまな代行業者がさまざまな料金設定をおこなっていますが、月会費を支払ってお得になるのは、取扱う商品量が比較的多くかつ頻繁に仕入れをおこなう場合が多いです。輸入貿易代行とは、海外企業から原

    回复
  24. 中国 輸入代行|https://m.baidu.com/|https://olsenhoffmann.livejournal.com/profile|https://penzu.com/p/8433834c

    ゴールド会員→入会金32,400円・ ただ、前述のイーウーパスポートと同じく有料会員制のため、発注数量が大きくない初心者・ また、外箱の梱包方法は、デフォルトのOPP袋(写真.1)をはじめ、オプションとして専用ダンボールを4種(写真.2)ご用意してございますため、商品量に応じたジャストフィットな国際発送を可能にしております。 またサービスや検品などの質も上がっていますが、代行会社によって特徴や得意なことが違っていたりするので、しっかりと理解をしていないと間違った代行会社を選んでしまい後悔してしまう可能性があります。 あなたは今、中国輸入にとりかかろうとしていて代行会社を探している途中で

    回复
  25. Jasonjek

    [url=http://ccdmeds.com/]zoloft 25mg[/url] [url=http://cialiskey.com/]cialis 60 mg price[/url] [url=http://rdppharm.com/]buy doxycycline over the counter[/url] [url=http://nrxbuy.com/]clomid price in india online[/url] [url=http://smarttadalafil.com/]tadalafil tablets 20mg[/url] [url=http://tamoxifennolvadex.com/]nolvadex 50mg[/url] [url=http://laviagra.com/]female viagra pill canada[/url] [url=http://extracialis.com/]buy generic cialis 10mg[/url] [url=http://viagrabmed.com/]viagra sildenafil citrate[/url] [url=http://cialiskb.com/]generic tadalafil 5mg[/url]

    回复
  26. Küche planen|Küche kaufen

    Einen Zauberer aus Köln zu buchen ist etwas, das viele Menschen gerne tun würden. Es ist eine aufregende Art, den Tag mit jemandem zu verbringen, von dem man weiß, dass er den Geburtstag zu etwas Besonderem macht. Wenn es um Geburtstagsfeiern geht, ist der Zauberer fast immer einer der wichtigsten H

    回复
  27. 美女

    continuously i used to read smaller articles which as well clear their motive, and that is also happening with this post which
    I am reading at this place.

    Feel free to visit my web page :: 美女

    回复
  28. Perez Kaplan

    Give us a call in your airport transportation, luxurious journey, birthday limousine, town automotive service, limo rental, company limousine, prom limo, or any other occasion. If, nonetheless, i t i s d e s i g -ned to sel e c t the very best of different p r o j e c t s , a relentless p r i c e l

    回复
  29. The Most Effective Way To Find Second Hand Cars Online|The Htc Titan - A Read The New Windows Smartphone From Htc|Browsing World-Wide-Web On The Blackberry Bold Touch|Things To Keep In Mind While Buying Second Hand Hot Tubs

    I first stumbled upon the idea of second hand baby stores when my son was born. With the cost of the birth itself and also immediate infant necessities like diapers, a pacifier and some little tiny gloves for his newborn hands, the appropriate purchases perceived to loom over me.For <a hr

    回复
  30. A Second Job Online - 3 Tips For Earning More Money On Internet|A Second Job Online - 3 Tips For Earning Extra Cash On The World|My Start Samsung I900 Galaxy Sii Smartphone|First Date Mistakes That Guys Make That Cost Them 2Nd Date

    In previous 3 years, the volume of choices from the smartphone arena in the U.S. have increased dramatically. Deciding which phone to pick can be overwhelming. 1st thing you should decide is which smartphone OS you’re going to go with. Each an individual has their own strengths and weaknesses.<

    回复
  31. www

    I was recommended this website by my cousin. I’m not sure whether this post is written by him as nobody else
    know such detailed about my problem. You’re incredible!

    Thanks!

    回复
  32. Denjek

    [url=http://colchicinepill.com/]average cost of colchicine[/url] [url=http://cialiskb.com/]buy generic cialis online uk[/url] [url=http://suprpharm.com/]bupropion 200 mg[/url] [url=http://cialiscentre.com/]cialis 20 mg price in india[/url] [url=http://ernviagra.com/]viagra 5343[/url]

    回复
  33. Tải Fun88

    An outstanding share! I’ve just forwarded this onto a co-worker who has been conducting a little research on this.
    And he actually ordered me breakfast simply because I
    found it for him… lol. So allow me to reword this….
    Thanks for the meal!! But yeah, thanks for spending time to discuss
    this topic here on your internet site.

    回复
  34. Learning Easy Magic Tricks|How Generate A Digital Product Rrn Your New Store In 3 Easy Steps|No Easy Ways To Burn Fat|Easy Chords For Guitar|3 Easy Casseroles For Out Of Town Guests

    As far for the cell phone market goes the more apps and features the better. However there is still a market for finding a simple, functional mobile. The cell phones for seniors market has been growing steadily over recent years. There is a developing concern with many of us that our nearest and dea

    回复
  35. บาคาร่า

    Hi there would you mind letting me know which webhost you’re working with?

    I’ve loaded your blog in 3 different browsers and I must say this blog loads
    a lot quicker then most. Can you suggest a good
    web hosting provider at a reasonable price? Thanks a lot, I appreciate it!

    回复
  36. 中国 輸入代行|https://causeshelf57.tumblr.com/post/647928422711115778/-|中国 輸入代行

    中国輸入代行会社を選ぶには相性もあると思います。参考 中国輸入代行業者タオタロウhttps://www.yiwutaro.com/ 料金は三菱東京UFJ銀行発表の中国人民元TTSレートを参考に+0.5円を弊社独自レートとしています。人によって、この会社がいい 中国 輸入代行 悪い というように好みが分かれますので、まずはあなたに合った代行業者を探してください!中国輸入代行業者を探すときのポイントとは・中国仕入れのアパレルをそのまま出すとダメなのですが、撮影し直しして出品する方法があります。例えばこの商品を仕入れた

    回复
  37. see here now

    Netsuite is a web hosting company that’s built a solid reputation and existence all over the world. They offer you a wide range of options for all hosting requirements. But, it’s very important to note that not a lot of their clients are able to experience a fantastic quality of support from them. I

    回复
  38. sites.google.com

    Thank you a lot for sharing this with all folks you actually know
    what you are speaking approximately! Bookmarked. Please also consult with my site =).
    We may have a link change contract among us

    回复

发表评论

邮箱地址不会被公开。