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

  1. Hines Mcintosh

    Be thrifty in prise to the online stores that you bet at purchasing from. If the network investment trust is bad designed, wide-rationalise of misspellings, and tally fishy, you should moot your money elsewhere. These are signs that something exponent not be sort out about this computing machine sto

    回复
  2. Lee Simonsen

    Prior to making an order, do a price comparison on many websites. Search for particular discount coupons and gives on these web sites to actually are getting the best deal possible. Also look into what it will surely cost for the shipping and delivery in your products and when you can find free deli

    回复
  3. Jessen Ladegaard

    Ways of transportation include biking in which very popular, walking, trams, taxi, renting your own car, area bus along with the metro. It is best to use the metro in the event that you to be able to travel aside from Amsterdam. You want to take a canal boat ride it’s simple the city and read about

    回复
  4. Mose Meredith

    Be sure to investigate music specials when visiting the Amazon music download site. Albums and single downloads are often available for discounted prices here, and this can save you a lot of money on the songs you want the most. There are different discounts every day so be sure to check often.

    回复
  5. Linda Paz

    I loved as much as you’ll receive carried out right here.

    The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get bought an edginess
    over that you wish be delivering the following.

    unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this hike.

    回复
  6. Curtis Farmer

    If you are a sports fanatic check the actual schedule in the Ajax at de Amsterdam Arena. And make certain to travel at suitable time to talk to your favorite sport such as soccer. Utilizing over 350 hotels to remain at while you stay in Amsterdam. Will be able to choose which hotel is right for you

    回复
  7. Bowers Cannon

    It all makes sense to me now. I’ve always questioned why the CFL awards a point for a missed field goal. It must be due to place kickers being high on weed. You see, they’re probably seeing three uprights and the league to be able to ensure which get enjoyment point as a result of efforts (I’m just

    回复
  8. Vad Mcconnell

    Hemp is a proven source of energy. Akin to the power to be converted into ethanol or bio-diesel. Ethanol is typically added to gasoline, but could also be utilized as a alternative to gasoline. It should be noted that pure ethanol does have a lower BTU value than gasoline, causing more frequent fill

    回复
  9. Aarup Vazquez

    Powerball is an American lotto game currently offered by 45 states, including the District of Columbia, Puerto Rico, and the united states Virgin Islands. It really is sponsored by the Multi-State Lottery Association. Powerball players purchase Powerball tickets in specified amounts and Void or pay

    回复
  10. Lauritsen Hermann

    With the click of a mouse, you can download almost any song that has ever been recorded. Everything from the latest chart-topping hits to obscure folk songs from the 1940s is available online. To learn more about searching for music online, keep reading. You will learn how to download songs with eas

    回复
  11. Iversen Fuller

    Cannabis is among the company’s main coal in making their regarding clothes. And why not? Since the company’s unbreakable connection with nature, it is just natural to these fiber from cannabis plants.Dynamite, released in 2005 is only using the best offering from Jamiroquai and reached #3

    回复
  12. Stack Desai

    The Powerball jackpot amount depends upon how many combinations are picked during the Powerball draw. The reason being Powerball players have a choice on the combinations for their draws. The combinations for winning the Powerball lottery balls are selected randomly. The more people that buy Powerba

    回复
  13. Dalton Guldager

    The answer is different for every and every one of anyone. I myself can vanish from gambling for weeks or months at a time without any effect on the emotional wellbeing. If I never had another bet in lifestyle it would not bother us.Are we so gullible that we’re willing to break our future

    回复
  14. Kolding Brady

    Key Doesn’t Move or Turn – This is typical as we know, but neither among us know why does it develop. Lets first focus on why it happens and after that time how to troubleshoot difficulty. This happens mostly recognize parked auto or truck with its wheels which usually turned towards just one for wh

    回复
  15. Suhr Tange

    Does the mere mention of football send adrenaline rushing through your body? If, yes, then a person about encounter it once again. You can witness an active score of soccer here.More in addition to fans in order to own and wear football team technology. You can purchase quality NFL Fan Gea

    回复
  16. Seerup Hay

    Sports movies possess a long history of capturing the imaginations of audiences and inspiring them like few other genres can. Movies about football are no exception. Many films based on America’s most loved game have entertained audiences and brought new meaning to the game by showing how it can bri

    回复
  17. Rodriguez Terry

    In most states where powerball prizes are awarded, the prize money will be distributed among winning players. A small part of the prize money is kept by the Powerball Company as an ongoing support for the standard Powerball game. You can find Powerball prizes for jackpots of $1M and above, however t

    回复
  18. Vazquez Burch

    Acupuncture therapy may stimulate task of various other pain-relieving chemical compounds in the torso besides. American medicine doesn’t acknowledge the principles of qi and meridians. However, clinical research indicates different explanations for exactly why acupuncture therapy might provide pain

    回复
  19. Michael Kwak

    I have been browsing online greater than three hours today, but I
    never found any interesting article like yours.
    It is pretty value enough for me. Personally, if all site owners
    and bloggers made just right content as you did, the net
    will likely be a lot more useful than ever before.

    回复
  20. Bjerre Waugh

    When I finally decided it was time, I began reading titles like Gorilla Marketing by Jay Levinson and Small Time Operator by Bernard D. Kamoroff. And I started planning what equipment I want to to buy and how i was gonna be finance it then.After you have selected an extremely good repair s

    回复
  21. Herring Skafte

    By getting a plan you are allowing the winds of fortune to blow you every which way you can also bet often those winds will cease gentle breezes but massive hurricane force winds. As well as all know just how destructive hurricane force winds can usually.Also located Nevada, this city is r

    回复
  22. Sampson Ehlers

    If you are searching for a way to increase your cash flow and obtain out of debt, then your best way to do that is by playing online powerball. With this online lottery game it is possible to win thousands of dollars with ease. You don’t have to worry about competing with other folks in a local land

    回复
  23. Craft Craig

    If you lack to improve yourself, consider safekeeping a to-do list. This will avail support you unionised and deal your clock time sagely. It give notice natural covering the most of import tasks that you have, or you send away micromanage every case in your liveliness. It rattling does not subject.

    回复
  24. McMahan Stiles

    Ensure that your children have a very good sense of knowing about finances and purchases, from the young age. The sooner they are trained about fiscal accountability and what may be accomplished with effort, the greater away from they are in the long run, because they grow older. You may also requir

    回复
  25. Aycock Kristoffersen

    Da Microfiber là loại da công nghiệp cao cấp nhất hiện nay. 2. Shiny leather is a shiny leather: shiny leather is not phony natural leather. Imitation leather or simili with the English name Polyvinyl choride (PVC) is a sort of leather made from polyester material cellular lining. This is a way to c

    回复
  26. Kinney Langhoff

    Acupuncture is actually a holistic health strategy that stems from conventional Chinese Medicine practices in which educated experts stimulate particular points on your body by placing slim needles in to the skin. ” amazingly, although needles utilized in acupuncture therapy, treatments are relative

    回复
  27. Camp Flowers

    This process sounds rather simple; however, it wants a great deal of training and experience to understand it properly. The first step in the process is access to the area behind the damage. This involves removing the lining door panel or perhaps removing a tire for access together with wheel most c

    回复
  28. Niebuhr Kinney

    Especially the casino bonuses can be as high as $1000. And there are many of all. Some directories for these offers list more than $10000 in free casino cash. Generally work wind up. You get the no deposit bonus and half an hour or sixty minutes to fiddle with it. After this time the overall game is

    回复
  29. Fulton Holbrook

    “This only happens about 20 percent of that time period, but is still the possibility,” says Beisel, just who contributes that bruising should recover before the few days is actually up. To prevent bruising and as an alternative reach the ideal results, the individual receiving the procedure must in

    回复
  30. bet online zimbabwe

    I have been surfing online more than three hours today, yet I
    never found any interesting article like yours. It’s pretty worth
    enough for me. In my opinion, if all website owners and bloggers made good content as you did, the web will be much more useful than ever before.

    回复
  31. Slot Bullard

    One system does almost the equivalent thing as predicting a coin toss. It says any time Red is on the win for 9 times, than Black must be next. Another system tells the online casino player to up each bet or wager as they play. Indicates is you bet 10 credits on site directories . round as well as l

    回复
  32. Bond Tillman

    When you research the web, you’ll find plenty of free typefaces accessible for down load. Free of charge typefaces will help you produce a specialist, nevertheless distinctive website and enhance your on-line reputation. Nevertheless, there are actually fonts accessible for cost-free that aren’t top

    回复
  33. Glass Simmons

    Like a lot of things in everyday life, you will find a risk linked to purchasing stocks and shares. However, if you first spend your time and energy in educating yourself about carry assets, you may decrease that risk. The first task in lessening hazards is always to accept that dangers are involved

    回复
  34. Weiss Jenkins

    Finding the right web host for your site might seem daunting, with so many different providers and levels of service to choose from. But once you have a good idea of what your site needs, how much you want to spend, and what features you should have, you can make better choices.

    Here are

    回复
  35. Lott Benjamin

    About the previous amount of numerous many years, a escalating quantity of men and women today have sought out bucks making options by means of the On line to boost their gains. Loads of options exist for producing profits on line. Perfectly acknowledged avenues for gains selection from analyze havi

    回复
  36. Holst Gaarde

    Social Multimedia Marketing (SMM) Panel is definitely some sort of Common Reseller Screen Épigraphe, where People Pay for Social Media Services like Facebook or myspace likes, YouTube sights, Instagram fans, Twitter enthusiasts, Web page Site visitors. It allows you an opportunity in order to obtain

    回复
  37. adultfrinderfinder

    Its like you learn my thoughts! You seem to know so much approximately this, like you wrote the e-book in it or something.
    I believe that you simply can do with a few % to drive
    the message house a little bit, but other than that, this is wonderful blog.
    An excellent read. I’ll certainly be back.

    回复
  38. Harbo Keith

    Once find past the concept this game is accessible the high-rollers and the elite of society, you are join typically the fun that comes with casino baccarat live or on the world wide web. In an item of hours may well feel that you’ve got baccarat mastered because tend to be two only a few elementary

    回复
  39. Qvist Richards

    Web hosting is a vital part of any website. Without web hosting, websites cannot exist on the Internet and be accessed by the public. Since every website needs a web hosting service, choosing one of these services is one of the most important aspects in a website created. How do you choose a proper

    回复
  40. Weber Gottlieb

    First, think of how exactly to play Powerball as with regards to specific numbers and colors. The colors that are used for Powerball Jackpots are red, orange, yellow and green. You need to pick specific numbers for each of the five white balls plus one red ball for a maximum of six numbers; for a si

    回复

发表评论

邮箱地址不会被公开。