Update docs

This commit is contained in:
hwdsl2 2018-02-11 00:37:00 -06:00
parent 00ea759883
commit 43dbac6c3c
4 changed files with 46 additions and 16 deletions

View File

@ -47,8 +47,6 @@ Libreswan 支持通过使用 RSA 签名算法的 X.509 Machine Certificates 来
rightaddresspool=192.168.43.10-192.168.43.250
rightca=%same
rightrsasigkey=%cert
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
narrowing=yes
dpddelay=30
dpdtimeout=120
@ -62,22 +60,39 @@ Libreswan 支持通过使用 RSA 签名算法的 X.509 Machine Certificates 来
EOF
```
还需要在该文件中添加一行,首先查看你的 Libreswan 版本:
还需要在该文件中添加一些行。首先查看你的 Libreswan 版本:
```bash
$ ipsec --version
```
对于 Libreswan 3.19 或以上版本,请运行:
对于 Libreswan 3.23 或更新版本,请运行:
```bash
$ echo " encapsulation=yes" >> /etc/ipsec.conf
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns="8.8.8.8, 8.8.4.4"
encapsulation=yes
EOF
```
对于 Libreswan 3.18 或以下版本,请运行:
对于 Libreswan 3.19-3.22,请运行:
```bash
$ echo " forceencaps=yes" >> /etc/ipsec.conf
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
encapsulation=yes
EOF
```
对于 Libreswan 3.18 或更早版本,请运行:
```bash
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
forceencaps=yes
EOF
```
1. 生成 Certificate Authority (CA) 和 VPN 服务器证书:

View File

@ -47,8 +47,6 @@ Before continuing, make sure you have successfully <a href="https://github.com/h
rightaddresspool=192.168.43.10-192.168.43.250
rightca=%same
rightrsasigkey=%cert
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
narrowing=yes
dpddelay=30
dpdtimeout=120
@ -62,22 +60,39 @@ Before continuing, make sure you have successfully <a href="https://github.com/h
EOF
```
We need to add one more line to that file. First check your Libreswan version:
We need to add a few more lines to that file. First check your Libreswan version:
```bash
$ ipsec --version
```
For Libreswan 3.19 and newer, run command:
For Libreswan 3.23 and newer, run command:
```bash
$ echo " encapsulation=yes" >> /etc/ipsec.conf
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns="8.8.8.8, 8.8.4.4"
encapsulation=yes
EOF
```
For Libreswan 3.19-3.22, run command:
```bash
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
encapsulation=yes
EOF
```
For Libreswan 3.18 and older, run command:
```bash
$ echo " forceencaps=yes" >> /etc/ipsec.conf
$ cat >> /etc/ipsec.conf <<EOF
modecfgdns1=8.8.8.8
modecfgdns2=8.8.4.4
forceencaps=yes
EOF
```
1. Generate Certificate Authority (CA) and VPN server certificates:

View File

@ -2,7 +2,7 @@
*其他语言版本: [English](manage-users.md), [简体中文](manage-users-zh.md).*
在默认情况下,将只创建一个用于 VPN 登录的用户账户。如果你需要添加,改或者删除用户,请阅读本文档。
在默认情况下,将只创建一个用于 VPN 登录的用户账户。如果你需要添加,改或者删除用户,请阅读本文档。
首先IPsec PSK (预共享密钥) 保存在文件 `/etc/ipsec.secrets` 中。如果要更换一个新的 PSK可以编辑此文件。所有的 VPN 用户将共享同一个 IPsec PSK。
@ -35,7 +35,7 @@
openssl passwd -1 '你的VPN密码1'
```
在完成后重启服务:
最后,如果你更换了新的 PSK则需要重启服务。对于添加更改或者删除 VPN 用户,一般不需重启。
```bash
service ipsec restart

View File

@ -35,7 +35,7 @@ Passwords in this file are salted and hashed. This step can be done using e.g. t
openssl passwd -1 'your_vpn_password_1'
```
When finished, restart services:
Finally, restart services if you changed to a new PSK. For add, edit or remove VPN users, a restart is normally not required.
```bash
service ipsec restart