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

  1. Hampton Donnelly

    It’s like no longer ensuring that water is drinkable, instead of doing anything so that folks each all the best of extremely water provide you with. Can you imagine quite a campaign against providing drinkable water along at the basis this particular tampers with individual freedom? that each person

    回复
  2. Moore McAllister

    Regretting your loss will not get cash back. Therefore, be wise and bet only you actually can afford to lose – setting and sticking with budget is really a good way to start. You shouldn’t be tempted to secure your curiosity by continuing to bet until you win as these vehicles actually exceed your f

    回复
  3. Willard Thomasen

    The manager is dependent all associated with the as well as their day to regular job needs. While said, it can be very demanding. Notice that there’s little reference to managing performance: the social side of the job.Just think for a moment, would you start an extended period of journey

    回复
  4. Sejersen Moon

    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

    回复
  5. Cohen Mckenzie

    But instead of Paris and New York, Las Vegas is primary place in order to locate the best and biggest new shows you. Ever since Sinatra starting belting out tunes, Las Vegas Nevada to get an entertainment capital. By no means just major ticket such things as Penn & Teller, Celine Dion and the Blue M

    回复
  6. Roberson Zamora

    Note every forms of legalized gambling are understandably not left to pure chance. How the house always has got the edge devote their taxes and overheads and to afford themselves a more than healthy profit, produces the situation where they aren’t gambling but taking a calculated potential risk. Whe

    回复
  7. Daly Benson

    My method is simple: affiliate with natural fits and Google AdSense which will be the simplest affiliation of each of the. I try to connect to affiliates based on products which use or are useful or match to my website. When I started affiliating, I went straight away to the business web page of ret

    回复
  8. Solarplane|Schwimmbadzubehör

    When shopping online, pee incontestable that the online SALT gone offers inviolable check sentence. This will help protect your well-formed family information from organism purloined. To safe the cyberspace place is encrypted look up into your web browser’s Uniform resource locator boxful. The settl

    回复
  9. Pool Zubehör|Pool ohne Beton

    Could you use a minimal savvy assistance to make you a smarter on the net shopper? For a ton of people, the speedy-transferring entire world of Internet browsing is a minor too much to handle. However, there is no need to be anxious but as an alternative additional educated. Browse this posting for

    回复
  10. Farmer Halvorsen

    However, if you are handy with photo and graphic editing software such as PhotoShop, Paint Shop Pro, or deals are going to graphic software Gimp, you may create and upload your own custom header and really make the your actually own. Look for a premium WordPress theme that also has a built in tool t

    回复
  11. Hermann Demant

    Hookup singles will be the most up-to-date craze inside the grownup online dating scenario. They have got taken over the talk bedrooms, social media marketing sites and the right place to satisfy them is on hookup men and women internet dating sites. People today are only as well active and cannot t

    回复
  12. Severinsen Kappel

    The James Bond game is very popular among casino goers as it is a game that requires strategy and good playing skills. Casino goers play this game as it can be fun and exciting at the same time. Casino goers should not be afraid of playing such games as the use of online technology has made it possi

    回复
  13. Hooper Dale

    Kickoffbet แทงบอล is one of the many ways that bettors use to win at football betting. Kickoffbet is an Internet-based service that offers to its users free bets on every football game that occurs in a specified season. The football betting market is one of the largest in the world and there are

    回复
  14. Flowers Mollerup

    스페인 타일은 오늘날 매우 수요가 많은 아주 좋은 루핑 재료입니다. 그러나이 자료를 사용하기 전에 고려해야 할 몇 가지 요소가 있습니다. 이 타일의 생산에 사용되는 것은 고품질 점토 타일입니다. 스페인 타일의 성능과 품질을 비교할 수있는 다른 방법은 없습니다. 고품질 점토 타일은 쉽게 구할 수 있으며 구매를 용이하게하는 다양한 웹 사이트가 있습니다. 구매시 고려해야 할 가장 중요한 측면은 다음과 같습니다. 아연-이것은 스페인 타일 생산에서 매우 중요한 구성 요소입니다. 스페인 타일을 집에 설

    回复
  15. Bonner Daly

    Popcornflix is another heartwarming free online movie watching websites which are enriched will all the latest and newest movie releases. Crunchyroll is a great resource for watching free anime shows and movies, while Tubi and YouTube provide access to a great selection of movies for families and ki

    回复
  16. Achtformbecken

    Video marketing is a highly effective tool that all smart business owners are utilizing to dramatically increase sales and boost profits. In order for video marketing to work it must be properly implemented. This article is chock full of several video marketing tips that will help to improve your bu

    回复
  17. Puckett Hays

    스페인 타일은 오늘날 매우 수요가 많은 아주 좋은 루핑 재료입니다. 그러나이 자료를 사용하기 전에 고려해야 할 몇 가지 요소가 있습니다. 이 타일의 생산에 사용되는 것은 고품질 점토 타일입니다. 스페인 타일의 성능과 품질을 비교할 수있는 다른 방법은 없습니다. 고품질 점토 타일은 쉽게 구할 수 있으며 구매를 용이하게하는 다양한 웹 사이트가 있습니다. 구매시 고려해야 할 가장 중요한 측면은 다음과 같습니다. 아연-이것은 스페인 타일 생산에서 매우 중요한 구성 요소입니다. 스페인 타일을 집에 설

    回复
  18. lắp đặt mạng vnpt hà nội

    + Internet cáp quang quẻ có tốc độ cao và ổn định rộng lên tới 20 lần so với ADSL trước đó cùng với giá bằng hoặc thấp hơn. Theo đó, từ là một/7/2013 bắt buộc tất cả những công ty phải sử dụng chữ ký số để kê khai thuế qua mạng. Thời gian vừa qua, một số nhà mạng tại nước ta đã khai triển thử ngh

    回复
  19. Stahlwandpool

    Who on your team is the most motivating? Who is the best speaker? This is the person to put on camera on behalf of your company. You don’t have to have the CEO or a sales person reading the sales pitch, instead focus on the person who will do the best job of selling your firm or products.D

    回复
  20. Mose Griffin

    The good news is: There are mobile apps that pay you to exercise. Severe thunderstorms bring hail down on Florida Cicadas are coming. An ideal down payment amount is 20% of the total car price. If you can follow major tricks of using WordPress, then you may get a good website. But the individual

    回复
  21. Fredericka Hedrick

    I seriously love your site.. Great colors & theme.
    Did you create this site yourself? Please
    reply back as I’m planning to create my own personal blog
    and want to know where you got this from or just what the theme is
    named. Thanks!

    回复
  22. lắp mạng vnpt ở hà nội

    Vì vậy, lựa chọn chiến lược phù hợp để rút ngắn thời gian đưa dịch vụ ra thị trường là vấn đề mà những nhà mạng cần cân nặng nhắc kỹ. Cơ quan tiền tráin lý Bưu chủ yếu và Viễn thông Thụy Điển cho biết, họ đã trả thành cuộc đấu giá phổ tần dành 5G vào những băng tần 3,5 GHz và 2,3 GHz sau khi Tòa

    回复
  23. Hartman Ralston

    여러 가지 가능성이 있기 때문에 카지노 슬롯을 플레이하는 것은 재미 있습니다. 하지만 플레이 할 때 어떤 전략과 팁이 가장 효과적인지 알아야합니다. 플레이하는 시간을 최대한 활용하려면 중요합니다. 다음은 몇 가지 인기있는 슬롯 카지노 전략 팁입니다.-슬롯을 플레이 할 때는 바카라 테이블이 카지노마다 다르기 때문에 언제 플레이해야하는지, 어떤 색상으로 플레이해야하는지, 어디서 플레이해야하는지 아는 것이 중요합니다. 블랙 잭과 바카라 테이블은 별도의 게임입니다. 라이브 카지노에는 라이브 블랙 잭과 바카라 머신을

    回复
  24. Markjek

    [url=https://arfhealth.com/]buy modafinil online australia[/url] [url=https://beipharmacy.com/]canadian pharmacy ltd[/url] [url=https://nexiumesomeprazol.com/]where to buy nexium[/url]

    回复
  25. Albertsen Hong

    Hookup men and women are definitely the most up-to-date fad inside the mature internet dating scenario. They already have taken over the chitchat rooms, social media sites and the right place to satisfy them is on hookup single people online dating sites. Individuals nowadays are simply as well hect

    回复
  26. Flowers Donovan

    The advent of hookup internet dating sites is the ideal thing that took place to online dating. It’s not really that internet dating sites are some type of new innovation in reality, they’ve been around for a good although. What’s altered is hookup dating sites have integrated capabilities that can

    回复
  27. Lykkegaard Duncan

    Kickoff Betting คาสิโนออนไลน์ – The World’s Most Popular Online SportsbookKickoffbet is one of the latest betting lines available on Baccarat Online. This is an interactive service that is a spin off of the well known Betfair system. The idea is simple: place your bet in the Betfair sit

    回复
  28. Achtformpool

    Are you the boss? If the answer is yes, you probably understand how hard it can be to promote your business. Videos are a cost-efficient medium to reach out to a wide audience thanks to the Internet. Online videos are a great way to spread the word about your business. The tips found in the followin

    回复
  29. Stahlwandpool|Edelstahlpool

    Interviews make great videos. Have a friend or a colleague interview you if you want to give some details about your business and products or interview some customers if you want to share some original reviews of your products. If possible, find an expert in your field who is willing to be interview

    回复
  30. Galloway Ibrahim

    여러 가지 가능성이 있기 때문에 카지노 슬롯을 플레이하는 것은 재미 있습니다. 하지만 플레이 할 때 어떤 전략과 팁이 가장 효과적인지 알아야합니다. 플레이하는 시간을 최대한 활용하려면 중요합니다. 다음은 몇 가지 인기있는 슬롯 카지노 전략 팁입니다.-슬롯을 플레이 할 때는 바카라 테이블이 카지노마다 다르기 때문에 언제 플레이해야하는지, 어떤 색상으로 플레이해야하는지, 어디서 플레이해야하는지 아는 것이 중요합니다. 블랙 잭과 바카라 테이블은 별도의 게임입니다. 라이브 카지노에는 라이브 블랙 잭과 바카라 머신을

    回复
  31. lắp internet vnpt hà nội

    VNPT Hà Nộicung cấp dịch vụ Internet cáp quang cho mọi đối tượng cùng với các gói cước không giống nhau thích hợp cùng với nhu yếu và quy mô của kể từng hộ marketing bên trên địa bàn Hà Nội Thủ Đô. Hộ sale, cá thể Khi đăng ký công tyInternet Cáp quang quẻ của VNPT sẽ tiến hành miễn phí lắp đặt đặ

    回复
  32. Innenfolie|Poolbecken

    People like online shopping for all sorts of reasons, but selection, pricing and convenience are likely some of the major ones. The idea way to perfect your online shopping skills is to read up a bit on the subject before beginning. The article that follows is full of great tips to get things starte

    回复
  33. Lindgren Oddershede

    So there you have it, the big list of tasks which you need to be able to in order to dont successful marketer. Sounds too simple? Well, it involving is simple, but not quite as simple as you’d expect to see. What you can do will be write good articles that can really answer the questions your reader

    回复
  34. Poolset

    When you are shopping online, you should but betray at reputable stores. If the computer memory does not get a unspoilt reputation, you May be interrogatory for fuss. Roughly populate take in had their recognition board and personal information purloined from shopping on less than reputable websites

    回复
  35. kitchen cabinets|shop cabinets

    Cherry wood is considerably less commonly used to treat cabinets. This particular for this can be a price. Cherry wood is pretty expensive. Although, cabinets comprised of cherry wood are impressive. Cherry wood cabinets tend to be darker even more elegant than other connected with wood.Af

    回复
  36. Pool ohne Beton|Poolshop|Pool Zubehör

    Using coupons and waiting for sales are old ways of finding deals. If you’re serious about saving money, shopping online is a must-do. When you buy things online, you can get the very best deals. You will learn how best to save in this article.Shop around for great prices when shopping onl

    回复

发表评论

邮箱地址不会被公开。