l2tp ipsec 配置
时间: 2023-12-22 22:04:21 浏览: 143
ipsec+l2tp安装配置及插件
l2tp ipsec************ 配置 ipsec
编辑 /etc/ipsec.conf 文件,添加以下内容:
```
conn myvpn
keyexchange=ikev1
authby=secret
left=%defaultroute
leftsubnet=0.0.0.0/0
right=%any
rightsubnet=10.0.0.0/8
type=transport
ike=aes256-sha1-modp1024!
esp=aes256-sha1!
```***。
4. 配置 l2tp
编辑 /etc/xl2tpd/xl2tpd.conf 文件,添加以下内容:
```
[global]
ipsec saref = yes
[lns default]
ip range = 192.168.1.10-192.168.1.20
local ip = 192.168.1.1
require chap = yes
refuse pap = yes
require authentication = yes
name = myvpn
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
```***址。
5. 配置 ppp
编辑 /etc/ppp/options.xl2tpd 文件,添加以下内容:
```
require-mschap-v2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
auth
mtu 1200
mru 1200
crtscts
idle 1800
defaultroute
usepeerdns
debug
lock
```***```
sudo sh -c "echo 'username * password *' >> /etc/ppp/chap-secrets"
```***:
```
sudo systemctl start strongswan xl2tpd
```
阅读全文