Skip to content

Commit 38d8a6d

Browse files
jackivanovdguido
authored andcommitted
Deprecate IKEv2 for Windows (#1521)
* Windows to WireGuard * Add note about WireGuard * change wireguard faq * Clarify Windows instructions * Correct Wireguard description * Update README.md
1 parent ab0f0c0 commit 38d8a6d

21 files changed

+35
-391
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The easiest way to get an Algo server running is to let it set up a _new_ virtua
6363
```
6464
On macOS, you may be prompted to install `cc`. You should press accept if so.
6565
66-
5. **List the users to create.** Open `config.cfg` in your favorite text editor. Specify the users you wish to create in the `users` list. If you want to be able to add or delete users later, you **must** select `yes` for the `Do you want to retain the CA key?` prompt during the deployment.
66+
5. **List the users to create.** Open `config.cfg` in your favorite text editor. Specify the users you wish to create in the `users` list. If you want to be able to add or delete users later, you **must** select `yes` for the `Do you want to retain the CA key?` prompt during the deployment. Make a unique user for each device you plan to setup.
6767
6868
6. **Start the deployment.** Return to your terminal. In the Algo directory, run `./algo` and follow the instructions. There are several optional features available. None are required for a fully functional VPN server. These optional features are described in greater detail in [deploy-from-ansible.md](docs/deploy-from-ansible.md).
6969
@@ -105,14 +105,11 @@ If you prefer to use the built-in IPSEC VPN on Apple devices, or need "Connect o
105105
106106
WireGuard is used to provide VPN services on Android. Install the [WireGuard VPN Client](https://play.google.com/store/apps/details?id=com.wireguard.android). Import the corresponding `wireguard/<name>.conf` file to your device, then setup a new connection with it. See the [Android setup instructions](/docs/client-android.md) for more detailed walkthrough.
107107
108-
### Windows 10
108+
### Windows
109109
110-
Copy your PowerShell script `windows_{username}.ps1` to the Windows client and run the following command as Administrator to configure the VPN connection.
111-
```
112-
powershell -ExecutionPolicy ByPass -File windows_{username}.ps1 -Add
113-
```
110+
WireGuard is used to provide VPN services on Windows. Algo generates a WireGuard configuration file, `wireguard/<username>.conf`, for each user defined in `config.cfg`.
114111
115-
For a manual installation, see the [Windows setup instructions](/docs/client-windows.md).
112+
Install the [WireGuard VPN Client](https://www.wireguard.com/install/#windows-7-8-81-10-2012-2016-2019). Import the generated `wireguard/<username>.conf` file to your device, then setup a new connection with it.
116113
117114
### Linux Network Manager Clients (e.g., Ubuntu, Debian, or Fedora Desktop)
118115
@@ -149,12 +146,13 @@ To configure the connection to come up at boot time replace `auto=add` with `aut
149146
150147
Depending on the platform, you may need one or multiple of the following files.
151148
152-
* cacert.pem: CA Certificate
153-
* user.mobileconfig: Apple Profile
154-
* user.p12: User Certificate and Private Key (in PKCS#12 format)
155-
* ipsec_user.conf: strongSwan client configuration
156-
* ipsec_user.secrets: strongSwan client configuration
157-
* windows_user.ps1: Powershell script to help setup a VPN connection on Windows
149+
* ipsec/manual/cacert.pem: CA Certificate
150+
* ipsec/manual/<user>.p12: User Certificate and Private Key (in PKCS#12 format)
151+
* ipsec/manual/<user>.conf: strongSwan client configuration
152+
* ipsec/manual/<user>.secrets: strongSwan client configuration
153+
* ipsec/apple/<user>.mobileconfig: Apple Profile
154+
* wireguard/<user>.conf: WireGuard configuration profile
155+
* wireguard/<user>.png: WireGuard configuration QR code
158156
159157
## Setup an SSH Tunnel
160158

docs/client-windows.md

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,6 @@
1-
# Windows client manual setup
1+
# Windows client setup
22

3-
## Automatic installation
3+
## Installation via profiles
44

5-
To install automatically, use the generated user Powershell script.
6-
7-
1. Copy the user PowerShell script (`windows_USER.ps1`) to the client computer.
8-
2. Open Powershell as Administrator.
9-
3. Run the following command:
10-
```powershell
11-
powershell -ExecutionPolicy ByPass -File C:\path\to\windows_USER.ps1 -Add
12-
```
13-
14-
If you have more than one account on your Windows 10 machine (e.g. one with administrator privileges and one without) and would like to have the VPN connection available to all users, pass the parameter `-AllUsers`
15-
16-
```powershell
17-
powershell -ExecutionPolicy ByPass -File C:\path\to\windows_USER.ps1 -Add -AllUsers
18-
```
19-
20-
4. The command has help information available. To view its full help, run this from Powershell:
21-
```powershell
22-
Get-Help -Name .\windows_USER.ps1 -Full | more
23-
```
24-
25-
## Manual installation
26-
27-
1. Copy the CA certificate (`cacert.pem`) and user certificate (`USER.p12`) to the client computer
28-
2. Open PowerShell as Administrator. Navigate to your copied files.
29-
3. If you haven't already, you will need to change the Execution Policy to allow unsigned scripts to run.
30-
31-
```powershell
32-
Set-ExecutionPolicy Unrestricted -Scope Process
33-
```
34-
35-
4. In the same window, run the necessary commands to install the certificates and create the VPN configuration. Note the lines at the top defining the VPN address, USER.p12 file location, and CA certificate location - change those lines to the IP address of your Algo server and the location you saved those two files. Also note that it will prompt for the "User p12 password", which is printed at the end of a successful Algo deployment.
36-
37-
If you have more than one account on your Windows 10 machine (e.g. one with administrator privileges and one without) and would like to have the VPN connection available to all users, then insert the line `AllUserConnection = $true` after `$EncryptionLevel = "Required"`.
38-
39-
```powershell
40-
$VpnServerAddress = "1.2.3.4"
41-
$UserP12Path = "$Home\Downloads\USER.p12"
42-
$CaCertPath = "$Home\Downloads\cacert.pem"
43-
$VpnName = "Algo VPN $VpnServerAddress IKEv2"
44-
$p12Pass = Read-Host -AsSecureString -Prompt "User p12 password"
45-
46-
Import-PfxCertificate -FilePath $UserP12Path -CertStoreLocation Cert:\LocalMachine\My -Password $p12Pass
47-
Import-Certificate -FilePath $CaCertPath -CertStoreLocation Cert:\LocalMachine\Root
48-
49-
$addVpnParams = @{
50-
Name = $VpnName
51-
ServerAddress = $VpnServerAddress
52-
TunnelType = "IKEv2"
53-
AuthenticationMethod = "MachineCertificate"
54-
EncryptionLevel = "Required"
55-
}
56-
Add-VpnConnection @addVpnParams
57-
58-
$setVpnParams = @{
59-
ConnectionName = $VpnName
60-
AuthenticationTransformConstants = "GCMAES256"
61-
CipherTransformConstants = "GCMAES256"
62-
EncryptionMethod = "AES256"
63-
IntegrityCheckMethod = "SHA384"
64-
DHGroup = "ECP384"
65-
PfsGroup = "ECP384"
66-
Force = $true
67-
}
68-
Set-VpnConnectionIPsecConfiguration @setVpnParams
69-
70-
```
71-
72-
Your VPN is now installed and ready to use.
5+
1. Install the [WireGuard VPN Client](https://www.wireguard.com/install/#windows-7-8-81-10-2012-2016-2019) and start it.
6+
2. Import the corresponding `wireguard/<name>.conf` file to your device, then setup a new connection with it.

docs/cloud-do.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ ansible-playbook main.yml -e "provider=digitalocean
8686
ondemand_wifi=true
8787
dns_adblocking=false
8888
ssh_tunneling=false
89-
windows=false
9089
store_pki=true
9190
region=nyc3
9291
do_token=token"

docs/deploy-from-ansible.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ansible-playbook main.yml -e "provider=digitalocean
1515
ondemand_wifi=false
1616
dns_adblocking=true
1717
ssh_tunneling=true
18-
windows=false
1918
store_pki=true
2019
region=ams3
2120
do_token=token"
@@ -32,7 +31,6 @@ See below for more information about variables and roles.
3231
- `ondemand_wifi_exclude` (Required if `ondemand_wifi` set) - WiFi networks to exclude from using the VPN. Comma-separated values
3332
- `dns_adblocking` - (Optional) Enables dnscrypt-proxy adblocking. Default: false
3433
- `ssh_tunneling` - (Optional) Enable SSH tunneling for each user. Default: false
35-
- `windows` - (Optional) Enables compatible ciphers and key exchange to support Windows clients, less secure. Default: false
3634
- `store_cakey` - (Optional) Whether or not keep the CA key (required to add users in the future, but less secure). Default: false
3735

3836
If any of the above variables are unspecified, ansible will ask the user to input them.
@@ -57,7 +55,7 @@ Server roles:
5755
* Installs [strongSwan](https://www.strongswan.org/)
5856
* Enables AppArmor, limits CPU and memory access, and drops user privileges
5957
* Builds a Certificate Authority (CA) with [easy-rsa-ipsec](https://github.com/ValdikSS/easy-rsa-ipsec) and creates one client certificate per user
60-
* Bundles the appropriate certificates into Apple mobileconfig profiles and Powershell scripts for each user
58+
* Bundles the appropriate certificates into Apple mobileconfig profiles for each user
6159
- role: dns_adblocking
6260
* Installs DNS encryption through [dnscrypt-proxy](https://github.com/jedisct1/dnscrypt-proxy) with blacklists to be updated daily from `adblock_lists` in `config.cfg` - note this will occur even if `dns_encryption` in `config.cfg` is set to `false`
6361
* Constrains dnscrypt-proxy with AppArmor and cgroups CPU and memory limitations

docs/deploy-from-fedora-workstation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Some steps are needed before we can deploy our Algo VPN server.
7171
### Check `pip`
7272

7373
Run `pip -v` and check the python version it is using:
74-
74+
7575
````
7676
$ pip -V
7777
pip 19.0.3 from /usr/lib/python2.7/site-packages (python 2.7)
@@ -99,7 +99,6 @@ We can now deploy our server by running:
9999
./algo
100100
````
101101

102-
Ensure to allow Windows / Linux clients when going through the config options.
103102
Note the IP and password of the newly created Algo VPN server and store it safely.
104103

105104
If you want to setup client config on your Fedora Workstation, refer to [the Linux Client docs](client-linux.md).

docs/deploy-from-script-or-cloud-init-to-localhost.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The command will prepare the environment and install AlgoVPN with the default pa
1818
`ONDEMAND_CELLULAR` - "Connect On Demand" when connected to cellular networks. Boolean. Default: false.
1919
`ONDEMAND_WIFI` - "Connect On Demand" when connected to Wi-Fi. Default: false.
2020
`ONDEMAND_WIFI_EXCLUDE` - List the names of any trusted Wi-Fi networks where macOS/iOS IPsec clients should not use "Connect On Demand". Comma-separated list.
21-
`WINDOWS` - To support Windows 10 or Linux Desktop clients. Default: false.
2221
`STORE_PKI` - To retain the PKI. (required to add users in the future, but less secure). Default: false.
2322
`DNS_ADBLOCKING` - To install an ad blocking DNS resolver. Default: false.
2423
`SSH_TUNNELING` - Enable SSH tunneling for each user. Default: false.
@@ -36,7 +35,6 @@ The command will prepare the environment and install AlgoVPN with the default pa
3635
```
3736
#!/bin/bash
3837
export ONDEMAND_CELLULAR=true
39-
export WINDOWS=true
4038
export SSH_TUNNELING=true
4139
curl -s https://raw.githubusercontent.com/trailofbits/algo/master/install.sh | sudo -E bash -x
4240
```

docs/faq.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
No. This project is under active development. We're happy to [accept and fix issues](https://github.com/trailofbits/algo/issues) as they are identified. Use Algo at your own risk. If you find a security issue of any severity, please [contact us on Slack](https://empireslacking.herokuapp.com).
1818

19+
## What's the current status of WireGuard?
20+
21+
[WireGuard is a work in progress](https://www.wireguard.com/#work-in-progress). It has undergone [substantial](https://www.wireguard.com/formal-verification/) security review, however, its authors are appropriately cautious about its safety and the protocol is subject to change. As a result, WireGuard does not yet have a "stable" 1.0 release. Releases are tagged with their build date -- "0.0.YYYYMMDD" -- and users should be advised to apply new updates when they are available.
22+
1923
## Why aren't you using Tor?
2024

2125
The goal of this project is not to provide anonymity, but to ensure confidentiality of network traffic. Tor introduces new risks that are unsuitable for Algo's intended users. Namely, with Algo, users are in control over the gateway routing their traffic. With Tor, users are at the mercy of [actively](https://www.securityweek2016.tu-darmstadt.de/fileadmin/user_upload/Group_securityweek2016/pets2016/10_honions-sanatinia.pdf) [malicious](https://web.archive.org/web/20150705184539/https://chloe.re/2015/06/20/a-month-with-badonions/) [exit](https://community.fireeye.com/people/archit.mehta/blog/2014/11/18/onionduke-apt-malware-distributed-via-malicious-tor-exit-node) [nodes](https://www.wired.com/2010/06/wikileaks-documents/).

docs/troubleshooting.md

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ First of all, check [this](https://github.com/trailofbits/algo#features) and ens
2929
* [Various websites appear to be offline through the VPN](#various-websites-appear-to-be-offline-through-the-vpn)
3030
* [Clients appear stuck in a reconnection loop](#clients-appear-stuck-in-a-reconnection-loop)
3131
* [Wireguard: clients can connect on Wifi but not LTE](#wireguard-clients-can-connect-on-wifi-but-not-lte)
32-
* ["Error 809" or IKE_AUTH requests that never make it to the server](#error-809-or-ike_auth-requests-that-never-make-it-to-the-server)
33-
* [Windows: Parameter is incorrect](#windows-parameter-is-incorrect)
3432
* [IPsec: Difficulty connecting through router](#ipsec-difficulty-connecting-through-router)
3533
* [I have a problem not covered here](#i-have-a-problem-not-covered-here)
3634

@@ -229,7 +227,7 @@ You tried to deploy Algo from Windows and you received an error like this one:
229227

230228
```
231229
TASK [cloud-azure : Create an instance].
232-
fatal: [localhost]: FAILED! => {"changed": false,
230+
fatal: [localhost]: FAILED! => {"changed": false,
233231
"msg": "Error creating or updating virtual machine AlgoVPN - Azure Error:
234232
InvalidParameter\n
235233
Message: The value of parameter linuxConfiguration.ssh.publicKeys.keyData is invalid.\n
@@ -243,7 +241,7 @@ This is related to [the chmod issue](https://github.com/Microsoft/WSL/issues/81)
243241
You tried to deploy Algo from Docker and you received an error like this one:
244242

245243
```
246-
Failed to connect to the host via ssh:
244+
Failed to connect to the host via ssh:
247245
Warning: Permanently added 'xxx.xxx.xxx.xxx' (ECDSA) to the list of known hosts.\r\n
248246
Control socket connect(/root/.ansible/cp/6d9d22e981): Connection refused\r\n
249247
Failed to connect to new control master\r\n
@@ -265,7 +263,7 @@ TASK [wireguard : Generate public keys] ****************************************
265263
[WARNING]: Unable to find 'configs/xxx.xxx.xxx.xxx/wireguard//private/dan' in expected paths.
266264
267265
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: configs/xxx.xxx.xxx.xxx/wireguard//private/dan"}
268-
```
266+
```
269267
This error is usually hit when using the local install option on a server that isn't Ubuntu 18.04. You should upgrade your server to Ubuntu 18.04. If this doesn't work, try removing `*.lock` files at /etc/wireguard/ as follows:
270268

271269
```ssh
@@ -412,16 +410,10 @@ sed -i -e 's/#*.dos_protection = yes/dos_protection = no/' /etc/strongswan.d/cha
412410

413411
### WireGuard: Clients can connect on Wifi but not LTE
414412

415-
Certain cloud providers (like AWS Lightsail) don't assign an IPv6 address to your server, but certain cellular carriers (e.g. T-Mobile in the United States, [EE](https://community.ee.co.uk/t5/4G-and-mobile-data/IPv4-VPN-Connectivity/td-p/757881) in the United Kingdom) operate an IPv6-only network. This somehow leads to the Wireguard app not being able to make a connection when transitioning to cell service. Go to the Wireguard app on the device when you're having problems with cell connectivity and select "Export log file" or similar option. If you see a long string of error messages like "`Failed to send data packet write udp6 [::]:49727->[2607:7700:0:2a:0:1:354:40ae]:51820: sendto: no route to host` then you might be having this problem.
413+
Certain cloud providers (like AWS Lightsail) don't assign an IPv6 address to your server, but certain cellular carriers (e.g. T-Mobile in the United States, [EE](https://community.ee.co.uk/t5/4G-and-mobile-data/IPv4-VPN-Connectivity/td-p/757881) in the United Kingdom) operate an IPv6-only network. This somehow leads to the Wireguard app not being able to make a connection when transitioning to cell service. Go to the Wireguard app on the device when you're having problems with cell connectivity and select "Export log file" or similar option. If you see a long string of error messages like "`Failed to send data packet write udp6 [::]:49727->[2607:7700:0:2a:0:1:354:40ae]:51820: sendto: no route to host` then you might be having this problem.
416414

417415
Manually disconnecting and then reconnecting should restore your connection. To solve this, you need to either "force IPv4 connection" if available on your phone, or install an IPv4 APN, which might be available from your carrier tech support. T-mobile's is available [for iOS here under "iOS IPv4/IPv6 fix"](https://www.reddit.com/r/tmobile/wiki/index), and [here is a walkthrough for Android phones](https://www.myopenrouter.com/article/vpn-connections-not-working-t-mobile-heres-how-fix).
418416

419-
### "Error 809" or IKE_AUTH requests that never make it to the server
420-
421-
On Windows, this issue may manifest with an error message that says "The network connection between your computer and the VPN server could not be established because the remote server is not responding... This is Error 809." On other operating systems, you may try to debug the issue by capturing packets with tcpdump and notice that, while IKE_SA_INIT request and responses are exchanged between the client and server, IKE_AUTH requests never make it to the server.
422-
423-
It is possible that the IKE_AUTH payload is too big to fit in a single IP datagram, and so is fragmented. Many consumer routers and cable modems ship with a feature that blocks "fragmented IP packets." Try logging into your router and disabling any firewall settings related to blocking or dropping fragmented IP packets. For more information, see [Issue #305](https://github.com/trailofbits/algo/issues/305).
424-
425417
### Error: name 'basestring' is not defined
426418

427419
```
@@ -448,29 +440,6 @@ Then rerun the dependency installation explicitly using python 2.7
448440
python2.7 -m virtualenv --python=`which python2.7` env && source env/bin/activate && python2.7 -m pip install -U pip && python2.7 -m pip install -r requirements.txt
449441
```
450442

451-
### Windows: Parameter is incorrect
452-
453-
The problem may happen if you recently moved to a new server, where you have Algo VPN.
454-
455-
1. Clear the Networking caches:
456-
- Run CMD (click windows start menu, type 'cmd', right click on 'Command Prompt' and select "Run as Administrator").
457-
- Type the commands below:
458-
```
459-
netsh int ip reset
460-
netsh int ipv6 reset
461-
netsh winsock reset
462-
```
463-
464-
3. Restart your computer
465-
4. Reset Device Manager adaptors:
466-
- Open Device Manager
467-
- Find Network Adapters
468-
- Uninstall WAN Miniport drivers (IKEv2, IP, IPv6, etc)
469-
- Click Action > Scan for hardware changes
470-
- The adapters you just uninstalled should come back
471-
472-
The VPN connection should work again
473-
474443
### IPsec: Difficulty connecting through router
475444

476445
Some routers treat IPsec connections specially because older versions of IPsec did not work properly through [NAT](https://en.wikipedia.org/wiki/Network_address_translation). If you're having problems connecting to your AlgoVPN through a specific router using IPsec you might need to change some settings on the router.

0 commit comments

Comments
 (0)