You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,19 +145,19 @@ Enjoy your very own VPN! :sparkles::tada::rocket::sparkles:
145
145
146
146
*Read this in other languages: [English](README.md#important-notes), [简体中文](README-zh.md#重要提示).*
147
147
148
-
**Windows users**: This <ahref="docs/clients.md#windows-error-809"target="_blank">one-time registry change</a> is required if the VPN server and/or client is behind NAT (e.g. home router).
148
+
**Windows users**: A <ahref="docs/clients.md#windows-error-809"target="_blank">one-time registry change</a> is required if the VPN server or client is behind NAT (e.g. home router).
149
149
150
150
**Android users**: If you encounter connection issues, try <ahref="docs/clients.md#android-mtumss-issues"target="_blank">these steps</a>.
151
151
152
-
The same VPN account can be used by your multiple devices. However, due to an IPsec/L2TP limitation, if you wish to connect multiple devices simultaneously from behind the same NAT (e.g. home router), you must use only <ahref="docs/clients-xauth.md"target="_blank">IPsec/XAuth mode</a>.
152
+
The same VPN account can be used by your multiple devices. However, due to an IPsec/L2TP limitation, if you wish to connect multiple devices simultaneously from behind the same NAT (e.g. home router), you must use only <ahref="docs/clients-xauth.md"target="_blank">IPsec/XAuth mode</a>, or set up <ahref="docs/ikev2-howto.md"target="_blank">IKEv2</a>.
153
153
154
-
If you wish to add, edit or remove VPN user accounts, see <ahref="docs/manage-users.md"target="_blank">Manage VPN Users</a>. Helper scripts are included for convenience.
154
+
If you wish to view or update VPN user accounts, see <ahref="docs/manage-users.md"target="_blank">Manage VPN Users</a>. Helper scripts are included for convenience.
155
155
156
156
For servers with an external firewall (e.g. <ahref="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html"target="_blank">EC2</a>/<ahref="https://cloud.google.com/vpc/docs/firewalls"target="_blank">GCE</a>), open UDP ports 500 and 4500 for the VPN. Aliyun users, see <ahref="https://github.com/hwdsl2/setup-ipsec-vpn/issues/433"target="_blank">#433</a>.
157
157
158
158
Clients are set to use <ahref="https://developers.google.com/speed/public-dns/"target="_blank">Google Public DNS</a> when the VPN is active. If another DNS provider is preferred, replace `8.8.8.8` and `8.8.4.4` in both `/etc/ppp/options.xl2tpd` and `/etc/ipsec.conf`, then reboot your server. Advanced users can define `VPN_DNS_SRV1` and optionally `VPN_DNS_SRV2` when running the VPN setup script.
159
159
160
-
Using kernel support could improve IPsec/L2TP performance. It is available on [all supported OS versions](#requirements). Ubuntu users should install the `linux-modules-extra-$(uname -r)` (or `linux-image-extra`) package, then run `service xl2tpd restart`.
160
+
Using kernel support could improve IPsec/L2TP performance. It is available on [all supported OS](#requirements). Ubuntu users should install the `linux-modules-extra-$(uname -r)` (or `linux-image-extra`) package and run `service xl2tpd restart`.
161
161
162
162
To modify the IPTables rules after install, edit `/etc/iptables.rules` and/or `/etc/iptables/rules.v4` (Ubuntu/Debian), or `/etc/sysconfig/iptables` (CentOS/RHEL). Then reboot your server.
You may use these scripts to more easily manage VPN users: [add_vpn_user.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/add_vpn_user.sh), [del_vpn_user.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/del_vpn_user.sh) and [update_vpn_users.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/update_vpn_users.sh). They will update users for both IPsec/L2TP and IPsec/XAuth ("Cisco IPsec"). For changing the IPsec PSK, read the next section.
12
+
## View or update the IPsec PSK
13
+
14
+
The IPsec PSK (pre-shared key) is stored in `/etc/ipsec.secrets`. All VPN users will share the same IPsec PSK. The format of this file is:
15
+
16
+
```bash
17
+
%any %any : PSK "your_ipsec_pre_shared_key"
18
+
```
19
+
20
+
To change to a new PSK, just edit this file. DO NOT use these special characters within values: `\ " '`
21
+
22
+
You must restart services when finished:
23
+
24
+
```bash
25
+
service ipsec restart
26
+
service xl2tpd restart
27
+
```
28
+
29
+
## View VPN users
30
+
31
+
By default, the VPN setup scripts will create the same VPN user for both `IPsec/L2TP` and `IPsec/XAuth ("Cisco IPsec")` modes.
32
+
33
+
For `IPsec/L2TP`, VPN users are specified in `/etc/ppp/chap-secrets`. The format of this file is:
34
+
35
+
```bash
36
+
"username1" l2tpd "password1"*
37
+
"username2" l2tpd "password2"*
38
+
... ...
39
+
```
40
+
41
+
For `IPsec/XAuth ("Cisco IPsec")`, VPN users are specified in `/etc/ipsec.d/passwd`. Passwords in this file are salted and hashed. See [Manually manage VPN users and PSK](#manually-manage-vpn-users-and-psk) for more details.
42
+
43
+
## Manage VPN users using helper scripts
44
+
45
+
You may use these scripts to more easily manage VPN users: [add_vpn_user.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/add_vpn_user.sh), [del_vpn_user.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/del_vpn_user.sh) and [update_vpn_users.sh](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/extras/update_vpn_users.sh). They will update users for both IPsec/L2TP and IPsec/XAuth ("Cisco IPsec"). Replace command parameters below with your own values.
10
46
11
47
**Note:** VPN users are stored in `/etc/ppp/chap-secrets` and `/etc/ipsec.d/passwd`. The scripts will backup these files before making changes, with `.old-date-time` suffix.
12
48
13
49
### Add or edit a VPN user
14
50
15
-
Add a new VPN user or update an existing VPN user with a new password.
51
+
Add a new VPN user, or update an existing VPN user with a new password.
First, the IPsec PSK (pre-shared key) is stored in `/etc/ipsec.secrets`. To change to a new PSK, just edit this file. You must restart services when finished (see below). All VPN users will share the same IPsec PSK.
79
-
80
-
```bash
81
-
%any %any : PSK "your_ipsec_pre_shared_key"
82
-
```
114
+
## Manually manage VPN users
83
115
84
116
For `IPsec/L2TP`, VPN users are specified in `/etc/ppp/chap-secrets`. The format of this file is:
85
117
@@ -106,10 +138,3 @@ Passwords in this file are salted and hashed. This step can be done using e.g. t
106
138
# Put your password inside 'single quotes'
107
139
openssl passwd -1 'password1'
108
140
```
109
-
110
-
Finally, you must restart services if changing the PSK. For add/edit/remove VPN users, this is normally not required.
0 commit comments