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

  1. Downs Mack

    Soccer players turn into human dominoes SHARE SHARE TWEET SHARE EMAIL Click to expand UP NEXT Soccer is their sport of preference on most days, but with this day, ?human dominoes? may be the name of the overall game. Players from the Russian team, Rubin Kazan, let off a little steam within their hot

    回复
  2. Spencer Gupta

    If you are looking for a casino with many slot machines, poker games, blackjack and craps games, then you should visit a reliable casino site. The aim of the casino is to make sure that they provide their customers with the best slots, roulette and poker games, blackjack games and other casino games

    回复
  3. 바다이야기|모바일바다이야기

    * 상품권을 건 도박의 탄생발단은 2001년, 경품성 상품권의 허용입니다. 2002년 월드컵을 앞두고 관광업계가 상품권의 경품화 허용을 강력하게 요구했고, 진통 끝에 월드컵이란 국민적 과제 앞에서 문화상품권의 경품화가 허용된 것이죠.당시에는 누구도 상상하지 못했을 겁니다. 경품성 상품권이 도박형 게임장을 폭발적으로 늘리는 결정적 계기가 됐다는 것을요. 2004년 국내에서 출시한 파친코 기기 바다이야기가 엄청난 반응을 불러일으키며 기름을 부었습니다. 바다이야기 게임장이 동네마다 하나씩 들어설 정도로 말입니다.<br/

    回复
  4. Scented Soy Wax melts Port Macquarie

    As the adage goes, “beauty is in the eye of the beholder.” The main ingredient to feeling beautiful is doing whatever makes you feel the best! Read this article to get some tips on how to put your best face and body forward, and let your inner beauty show on the outside.If you need to soak

    回复
  5. Buy scented melts Port Macquarie

    It is likely that you’ve passed the beauty counters at department stores many times. Have you always wondered about the makeup there? The following paragraphs are full of ideas you can use the next time you are at this counter and even when you are at home.If you have a hard time getting y

    回复
  6. Looking Inside Wrinkle Mask|A Scary Halloween Mask Is Needed For Any Halloween Party|Top 20 Safety Strategies For Halloween Day|A Concise Look At The Different Crucial Sides Pertaining To Subnet Masks|Acne Facials Treatment Options

    Party masks are intended for fun and pleasure occasionally like Christmas, New Year’s, Halloween, Fat tuesday or even birthdays. On these occasions, fancy dress costumes, wigs, and accessories are used, but masks are the easiest, shortest and cheapest way appreciate a shindig. Party masks can take a

    回复
  7. Scented Soy Wax melts Port Macquarie

    Achieve beauty by simply caring for your skin, body, and hair! This article has easy to follow tips on making sure every aspect of your appearance is at its best, to ensure you always look beautiful. Following this article’s advice, and maintaining consistent upkeep of your body will help you look a

    回复
  8. Rodgers Wilcox

    You must explore industry industry. Multiple offers help give ALL of the offers an expression of scale and price. Utilize the methods I have given you here. Use my Mortgage payment Calculator to help you. Always DO The mathematics and from the trends over energy. Information is performance.<br/

    回复
  9. Pauljek

    [url=https://cialiscentre.com/]canadian pharmacy cialis 10mg[/url] [url=https://cialisotab.com/]buy cialis online australia paypal[/url] [url=https://xmlpharm.com/]quineprox 60[/url] [url=https://femcialis.com/]how much is a cialis pill[/url] [url=https://cialismoz.com/]order cialis without prescription[/url]

    回复
  10. dankwoods near me

    Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe
    you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

    回复
  11. Am I Supposed To My Cpap Machine Every Day?|How Obtain The Right Cpap Mask For You|Dye Paintball Goggles - A Must For Facial Protection|Natural Facial Masks For Shiny Skin|Get Rid Of Oily Skin - Top 6 Ways Unleashed

    In recent years, in places from Mexico to Asia, outbreaks in flu cases tend to be matched with outbreaks in people wearing surgical hides. Those wearing masks believe they offer at least a a higher standard protection in the flu. However, they could be doing more damage than good.Masks can

    回复
  12. Beauty Within Your Kitchen - Best Home Beauty Recipes|Peel-Off Masks To Pay Off The Skin|Lighten Your Acne Scars - Cheap And Effective Homemade Remedies For Facial Scars|Anti-Aging - Natural Skin Care Treatments And Tips

    Natural Face masks are across just goofy tricks that girls try to get their “beauty rest.” Very good an important part of skin really care. It is proposed that you utilize a facial mask at least once 1 week. While that not were required to go overboard and wear <a href="https://files.fm/f/2y4qh3akz

    回复
  13. plumbers in burnley

    My partner and I stumbled over here coming from a different web page and thought I might check
    things out. I like what I see so now i am following you.
    Look forward to finding out about your web page again.

    回复
  14. Becker Becker

    What does it need to do with you? Everything. The ongoing crisis is your chance start off a new venture, increase your business showcase money can result in the economy seems to look wild. Along with the best starting point do offer online. Opposed to the background of economic downturn the prospect

    回复
  15. Rundpools|Ovalpools

    Affliction on your own far more for follow, then for the game of football by itself. Although you want to be completely ready for game day, observe will just take the most out of you physically. Thus, it is really important that your conditioning hold you up to par in apply and generating a good per

    回复
  16. Kincaid Kaas

    Revenue at six belonging to the largest You.S. banks declined by the biggest percentage in a few years in the initial quarter, as lending dropped and fees were lacking in. With unemployment stuck above 8 percent, housing prices falling again and restrictions on charges, the banks are underperforming

    回复
  17. Achtformpool|Stahlwandpools

    As your smartphone ages, it is expiration to streamlet slower and slower. Updates volition become more than and more unmanageable. Many times, you will be faced with a decisiveness to work. You prat abide the Sami and avoid the novel updates, or you butt induce an rise.Debrand your telepho

    回复
  18. The Latest Fashion Is To Unite Tribal Body Art With Modern Design|6 Innovative Ways To Real Estate For Your Real Estate Investing Business|Innovative Purposes For Scarves And Shawl Wraps|5 Innovative Ideas On Inviting Loved Ones To Your Big Day

    Innovative thinking is a healthy trait so that you more advanced than others. But, you can practice innovative thinking through doing things different. Successful people do not do different things; perform things in various ways. There will be always a path had been not in followed by anybody until

    回复
  19. Irwin Ruiz

    I bet you by no means seen that! Nobody seems to worry much about it until they suddenly notice that they cannot get debit. The individual or company refusing you doesn’t have a obligation to supply a reason, but they must tell you what credit reference agency they in use. You are then entitled to b

    回复
  20. Acne On Chin Treatment|5 Quick Fixes For That Top Cpap Problems|5 Recommendations For An Acne Scar Cure|Homemade Acne Cures And Masks|Cpap Nasal Masks As Well As The Other Elements Cpap Machines

    Sometimes the family are told you have a problem for get started building links time, we find ourselves inside alien world, filled with terminologies we all know nothing with reference to. What is the doctor trying health when or even she confirms that you have sleep apnea and would now must wear th

    回复
  21. Engel Chang

    The time period of nineteen fifties is acknowledged for the arrival of steroids in sports. In accordance to some informal resources, the Olympic team of Germany utilized oral testosterone compounds in the 1936 Berlin Olympics. The original ever conditions of steroids in sporting activities happened

    回复
  22. Geisler Woodard

    Negotiate: Negotiating with any online financier would be extremely important because always be provide you with acquiring best car financing deals online. Application process is extremely easy all you want do is provide details and stock up applications with correct instruction.Before the

    回复
  23. Dreamgame

    Hey there this is somewhat 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 guidance from someone with experience. Any help would be greatly appreciated!

    回复
  24. Turner Carstensen

    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

    回复
  25. Alanjek

    [url=http://extpharmacy.com/]cheap pharmacy no prescription[/url] [url=http://cialiskey.com/]cost of cialis[/url] [url=http://ernviagra.com/]viagra 30 tablet[/url] [url=http://stviagra.com/]cheap viagra online pharmacy[/url] [url=http://viagrabmed.com/]viagra pills for sale canada[/url] [url=http://extracialis.com/]cialis daily use 5mg[/url] [url=http://tunepharmacy.com/]reputable canadian online pharmacies[/url] [url=http://opacialis.com/]buy cialis online canadian pharmacy[/url] [url=http://cialisitab.com/]cialis online generic[/url] [url=http://cialiskb.com/]tadalafil 5mg price canada[/url]

    回复
  26. dankwoods near me

    Hello There. I found your blog using msn. This is a really well written article.

    I’ll be sure to bookmark it and return to read more of your useful
    info. Thanks for the post. I will certainly comeback.

    回复
  27. Clay Haley

    sebenarnya karena mereka menikmatinya. Mereka tidak terlalu terbawa, mereka hanya bersenang-senang. Yang lain melakukan itu sebagai pelarian dari masalah dan masalah – itu mengarahkan kembali perhatian mereka untuk sementara waktu. Dan masih yang lain melakukannya karena mereka kecanduan judi

    回复
  28. Holzpool|Rundpool

    Usually be moving in the course of the activity. You need to move to develop space between you and the defensive gamers. Be sure to be conscious of what is going on while shifting. You need to be able to know when you have open space to turn and reposition you to receive the ball.The situa

    回复
  29. Korsgaard Barron

    There are many reasons that one should choose a sm casino. First of all, the sm casino offers free transportation to and from the casino for players who participate in a bingo tournament. The a casino also has a wonderful reputation as one of the top casinos in the world. The sm casino is a wonderfu

    回复
  30. Poolleiter|Aufstellpool

    Football ought to usually be performed with the correct gear. The chance of severe damage is considerably as well substantial. If you aren’t donning the right equipment, do not engage in. You could split a leg or even your backbone. Not only could some of items keep you from participating in soccer

    回复

发表评论

邮箱地址不会被公开。