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

  1. turning aluminum parts

    Howdy this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or if
    you have to manually code with HTML. I’m starting a blog
    soon but have no coding experience so I wanted to get
    advice from someone with experience. Any help would be
    greatly appreciated!

    回复
  2. Lorraine Langford

    It is appropriate time to make some plans for the future and it is time
    to be happy. I’ve learn this submit and if I could I desire to suggest you few
    interesting issues or tips. Maybe you could write next articles referring to this article.
    I wish to read even more things about it!

    回复
  3. Song Fry

    Find the bookies internet business. There are two ways you is able to go about accessing a bookies website. Firstly you could simply type you’ll need company into Google and this will bring its website up in the search results. The best way though is to click through a promotional link on another we

    回复
  4. Maynard Kerr

    The master control panel is usually going to be a locked box. It consists with regards to a motherboard just like your computer. Your alarm technician will have to have to the unit to program it on day one, and in order to connect it to every one of the other devices. Of course that, once it is inst

    回复
  5. dầu gội tigi đỏ 750ml

    Tigi Bed Head có nhiều loại sản phẩm chất lượng được rộng 400 salon danh giờ, các nhà tạo mẫu tóc chuyên nghiệp nghiệp mặt hàng đầu và người mặc dùng cao cung cấp ưa chuộng bên trên mọi trái đất. Đối với bao bì của gội Tigi đỏ thì chủ yếu toàn bộ sản phẩm đều mang một màu sắc đỏ tươi bắt đôi mắt,

    回复
  6. ketamine hcl for sale

    I do not know if it’s just me or if everybody else encountering issues with your website.
    It looks like some of the written text within your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them
    too? This may be a issue with my internet browser because
    I’ve had this happen previously. Kudos

    回复
  7. Lloyd Sherrill

    C. Point Spread – A technique used by bettors in equalizing different teams after factoring their strengths and weakness within a wagering potential. It is useful in basketball and football adventure titles.This profit can then be in the old days finance more sports arbitrage bets after wh

    回复
  8. Welch Moran

    There is a problem with online horse racing betting, on the flip side. Some States, in order to protect their tax revenues produced by their State-run satellite betting and Off target Betting parlors, have blocked legal horse betting sites from access their own State.If someone does not re

    回复
  9. Toft Hanna

    Defensively those are the best each morning East. Little has changed for Detroit who allow 91.4 a game. Even under Saunders, who the big-time user of the zone defense in Minnesota, the Pistons starters only defend man-to-man, and using a 14-2 record who can complain? The Pistons can adapt both offen

    回复
  10. dầu cặp bed head tigi

    Tigi hoặc còn gọi là Tony & Guy, là tên thương hiệu sale những dòng sản phẩm về siêng sóc tóc và thành phầm trang điểm. Được thành lập vào năm 1989 bởi hai bằng hữu Giuseppe và Gaetano Mascolo đặt trụ sở tại Mỹ. Các loại thành phầm đến từ Tigi là sản phẩm mặt hàng đầu hiện tại nay, đã xuất hiện t

    回复
  11. Pearl Donohue

    It is perfect time to make some plans for the future and it is time to be happy.

    I’ve read this post and if I could I desire to suggest
    you some interesting things or advice. Perhaps you can write next articles referring to this article.
    I want to read even more things about it!

    回复
  12. Roman Keegan

    Most totally the site claim november 23 much more than they suffer a loss. Some win up to 90% percent of period. Can this really be opportunity? Yes, it is. Nobody is likely to advertise astounding to lose. Winning at a high rate needn’t be hard to get. Anyone can pick a winner within a one horse ra

    回复
  13. Bachmann Mahoney

    The Internet has been largely given the task of spurring objective of sports betting. It is only so simple to connect a few website as well as begin placing gamble. These websites are known as Sportsbooks. Then, there are other websites that supply sports information special enthusiasts who have a s

    回复
  14. arc globe

    Hi there! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of
    hard work due to no data backup. Do you have any solutions to stop hackers?

    回复
  15. Konradsen Childers

    Are we so gullible that we’re willing to break our future looks, health, and longevity for several chips, 2 beers, a dish of ice cream, and some pie?Do you might have an associated with the probability of both players in a Heads Up tournament getting pocket pairs in your hand? Chances are

    回复
  16. Marshall Evans

    Investing in the real estate market can be an intimidating prospect. However, with the right information, it can also be profitable. This article contains some ideas to help direct you. Use this information as a platform. The more you know, the more likely you are to succeed in this type of investme

    回复
  17. Discord Page

    Hi! I know this is kinda off topic but I was wondering which blog platform are you using for this website?
    I’m getting tired of WordPress because I’ve had problems with hackers and I’m looking at
    alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

    回复
  18. Fowler Conway

    I love watching sports on TV, and I couldn’t stand missing the best events while I seemed to be either at work or on a vacation. I would try to record my games, but most of the time something would happen and it wouldn’t record right. Which usually is just my luck. So, now I watch all of the live fo

    回复
  19. Collins Patel

    There is little debate about investing in real estate creating many millionaires in recent decades. However, there are those whose aspirations are a bit more modest and merely want some sound advice for starting small-scale investing. If that sounds like you, this article can help.Be sure

    回复
  20. Odom Duffy

    There is little debate about investing in real estate creating many millionaires in recent decades. However, there are those whose aspirations are a bit more modest and merely want some sound advice for starting small-scale investing. If that sounds like you, this article can help.Be sure

    回复
  21. Norup Andreassen

    Often, people don’t know where to find answers in how to invest in real estate. If this is something you’d like to learn a little bit more about, then this is a good place for you to be. Read on for more helpful information.Marketing will be crucial to your success. Marketing is what gener

    回复
  22. Winters Wong

    Emails would be the main placed into which betting scams can be found, but there furthermore many which claim in succeeding as able to own these great betting secrets, but are certainly just scamming you. It’s also wise to check that whatever an individual might be buying is known for its money back

    回复
  23. Carey Cline

    On the planet of fonts you will find only two really good issues: cost-free fonts and funky fonts. You will discover a 3rd category, but it is not quite as amazing as typefaces. I enjoy fonts i down load from Google, or from the website with free fonts. That’s why you’re in this article now.<br

    回复
  24. free internet dating

    Do you have a spam problem on this blog; I also am a blogger, and I was curious about your situation; many of us have created some nice practices and we are looking
    to trade solutions with other folks, why not shoot me an e-mail if interested.

    回复
  25. Frandsen Zacho

    Powerball prizes are not based on true probabilities, but rather are based on a mathematical formula. The Powerball winners are allotted a specific percentage of a jackpot prize if you can find at the very least eligible numbers on the draw table. For example, if you can find twenty eligible numbers

    回复
  26. Mays Reece

    First a four channel USB DVR surveillance system complete with USB DVR and four indoor outdoor cameras have night vision capability all of the wiring and all the nuts and bolts for the brackets to hook it up for below $500.No one wants to throw funds away produced. So it is important that

    回复
  27. Heritage residence puri 11

    You actually make it seem really easy along with your presentation but I
    find this matter to be actually one thing that I believe I’d by no means understand.
    It seems too complex and extremely huge for me.
    I am taking a look ahead in your next put up, I’ll attempt to get the dangle of it!

    回复
  28. Shah Hill

    If happen to be guilty about this mistake should you have fell for the idea that you don’t want to approach women proper. As much as most likely want this to be true, aren’t getting your hopes up given that is not very true. Women may indeed be very likely to approach a man today, however, you still

    回复
  29. Lillelund Rouse

    Important features involved always be updates and tips given by stock broking firms. Every hour the market news is updated and new tips are for the day traders. Each investment manufactured in day trading is as planned like for example long-term investment decisions. The tips and predictions that ar

    回复
  30. Berry Wong

    Get a dog to guard your residential. These pets can effectively warn you of possible burglary and intrusion of one’s private possessions. A guard dog may require care and attention but could greatly help in increasing your home security.Second, conscious that the best security system has a

    回复
  31. Judyjek

    [url=https://xkeypills.com/]buy fluoxetine india[/url] [url=https://viagradist.com/]discount online viagra[/url] [url=https://cialisdx.com/]how much is 20 mg cialis[/url] [url=https://srxstore.com/]levitra professional[/url] [url=https://viagradx.com/]where to buy viagra in usa[/url] [url=https://yestablets.com/]where can i buy lexapro online[/url] [url=https://fnnpharm.com/]tadalafil tablets 20 mg online[/url] [url=https://hfspills.com/]modafinil australia prescription[/url] [url=https://ordcialis.com/]cialis 20g[/url] [url=https://cialisget.com/]rx tadalafil tablets[/url]

    回复
  32. GOODVIBE

    Does your website have a contact page? I’m having trouble locating it but, I’d like to shoot you
    an e-mail. I’ve got some ideas for your blog you might be interested in hearing.
    Either way, great site and I look forward to seeing it grow over time.

    回复
  33. Nicholson Kilic

    If you utilize the world wide web on a regular basis you possess surely right now read about fonts changers. These are free of charge programs offering a huge range of convenience and helpful functionality to the Home windows. For instance, should you use Microsoft Word it really is probably probabl

    回复
  34. Rush Roberson

    Regretting your loss will not get cash back. Therefore, be wise and bet only what you can afford to lose – setting and sticking for you to some budget is a good in order to start. You shouldn’t be tempted to secure your curiosity by continuing to bet until shipped to you as hybrid cars exceed your a

    回复
  35. Ibrahim Ziegler

    There are several people who use cost-free fonts but they are unaware of what the typefaces changers are. We could find various typefaces on-line however are they well worth to obtain and investing in? This really is one thing you need to understand while using these typefaces.You will fin

    回复
  36. Hubbard Ballard

    Some physicians do not recommend hair waxing for persons battling with diabetes or who have varicose veins or poor circulation as is also more foreclosures infection.Goods shipped to Canada are be more responsive to G.S.T. on importation. Such tax is actually usually assessed in the border

    回复
  37. Johnston Shaffer

    Research Chemicals Dopalacze to sklep oferujący szeroki wybór substancji typu dopalacze, proszki, zioła czy kryształy, przeznaczonych do celów kolekcjonerskich. Oferta stanowi specyfiki takie jak mefedron, klefedron, 3-mmc, 4-mmc, xanax i nie tylko. Ogromna paleta produktów powoduje, że każdy zaciek

    回复
  38. Serrano Farrell

    The world economy has actually been going through lots of modifications; some are minor changes, while others have been can be found in the kind of radical waves of economic deterioration for companies, countries and individuals. Actions indicate that a bulk of trainees really feel that on-line disc

    回复
  39. Thomson Halsey

    Powerball is an American lotto game offered generally in most 45 states, in addition to the U.S. Virgin Islands and Puerto Rico. It is operated by the Multi-State Lottery Association, a non-profit organization formed by a contract with states and US corporations. Powerball offers players the chance

    回复
  40. Sigmon Friedrichsen

    Being good at real estate investing takes a lot of patience and knowledge of how the market works, but in order to do that you need to understand a few basic tips. Thankfully, the article gives you all the basics of how to succeed in real estate. If you want to learn more, then proceed to article be

    回复

发表评论

邮箱地址不会被公开。