找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 11115|回复: 12

【不懂就问】Openwrt如何使用xl2tpd和Strongswan连接L2TP/IPSec

[复制链接]
本帖最后由 wangziraniop 于 2020-2-22 14:43 编辑

近期需要远程办公连公司网络,想用Openwrt直接进行连接,但是Openwrt上没有现成的luci-app用于连接L2TP/IPSec,只能按照网上的方法使用xl2tpd和Strongswan尝试进行连接。
在编译时选择了xl2tpd和strongswan,并参考了下面这个文档进行设置,但是还是不通,日志和命令详见下方。
http://villasyslog.net/openwrt-p p t p-l2tp-ikev2-setup-strongswan-virtual**-client/变更了以下几个文件,但是不知道每个文件都是什么意思:
/etc/ipsec.conf /etc/ipsec.secrets /etc/xl2tpd/xl2tpd.conf /etc/ppp/options.l2tpd.client请问各位大佬有没有最新版的中文设置教程,
或者更好的Openwrt连接L2TP/IPSec的方案(内外网都找不到详细的文档)。


我把我变更的这几个文件粘贴在下面,希望有大佬路过能帮我看一下配置哪里有问题:
/etc/ipsec.conf
  1. config setup
  2.         strictcrlpolicy=yes
  3.         uniqueids = no
  4.         charondebug=all

  5. conn %default
  6.         ikelifetime=60m
  7.         keylife=20m
  8.         rekeymargin=3m
  9.         keyingtries=1
  10.         keyexchange=ikev2

  11. conn L2TP-PSK
  12.         authby=secret
  13.         leftauth=psk
  14.         auto=add
  15.         keyingtries=3
  16.         dpddelay=30
  17.         dpdtimeout=120
  18.         dpdaction=clear
  19.         rekey=yes
  20.         ikelifetime=8h
  21.         keylife=1h
  22.         type=transport
  23.         left=%defaultroute
  24.         leftprotoport=17/1701
  25.         right=服务器IP
  26.         rightauth=psk
  27.         rightprotoport=17/1701
  28.         auto=start
  29.         dpddelay=40
  30.         dpdtimeout=130
  31.         dpdaction=clear
复制代码

/etc/ipsec.secrets
  1. # /etc/ipsec.secrets - strongSwan IPsec secrets file
  2. : PSK "预共享密钥"
复制代码
/etc/xl2tpd/xl2tpd.conf
  1. [global]
  2. port = 1701
  3. auth file = /etc/xl2tpd/xl2tp-secrets
  4. access control = no

  5. ;[lns default]
  6. ;exclusive = yes
  7. ;ip range = 192.168.254.202-192.168.254.210
  8. ;lac = 10.0.1.2
  9. ;hidden bit = no
  10. ;local ip = 192.168.254.200
  11. ;length bit = yes
  12. ;refuse authentication = yes
  13. ;name = VersaLink
  14. ;ppp debug = yes
  15. ;pppoptfile = /etc/ppp/options.xl2tpd

  16. [lac strong-virtual**]
  17. lns = 服务器IP
  18. pppoptfile = /etc/ppp/options.xl2tpd.client
  19. length bit = yes
  20. bps = 1000000
复制代码
/etc/ppp/options.l2tpd.client
  1. ipcp-accept-local
  2. ipcp-accept-remote
  3. require-mschap-v2
  4. noccp
  5. noauth
  6. idle 1800
  7. mtu 1410
  8. mru 1410
  9. defaultroute
  10. replacedefaultroute
  11. usepeerdns
  12. connect-delay 5000
  13. name 我的用户名
  14. password 我的密码
  15. lcp-echo-interval 20
  16. lcp-echo-failure 5
复制代码
运行时的系统日志记录:

运行时的命令:

ipsec相关:

l2tp相关:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
用ikev2不好吗,为什么用L2TP这么落后的模式,性能差又难以配置

点评

楼主说的估计是L2TP over IPsec 不管Windows、macOS、还是iOS都可以直接用系统自带的L2TP客户端进行拨号登陆,速度非常快。  详情 回复 发表于 2020-2-22 22:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我也遇到同样问题,l2tp不能拨号
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

楼主是潘多拉吗?为什么我的软件包里搜不到strongswan
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

qqdwdbb 发表于 2020-2-22 16:50
用ikev2不好吗,为什么用L2TP这么落后的模式,性能差又难以配置

楼主说的估计是L2TP over IPsec
不管Windows、macOS、还是iOS都可以直接用系统自带的L2TP客户端进行拨号登陆,速度非常快。

点评

请问在openwrt搭建ikev2,用什么插件呀,请帮忙指教一下  详情 回复 发表于 2021-8-8 22:37
我说的就是L2TP over IPsec,ikev2比这简单多了,除了安卓都是自带ikev2客户端的  详情 回复 发表于 2020-2-23 16:45
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

kitty22030 发表于 2020-2-22 22:30
楼主说的估计是L2TP over IPsec
不管Windows、macOS、还是iOS都可以直接用系统自带的L2TP客户端进行拨号 ...

我说的就是L2TP over IPsec,ikev2比这简单多了,除了安卓都是自带ikev2客户端的

点评

请问LZ解决了么?  详情 回复 发表于 2020-4-13 16:15
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

qqdwdbb 发表于 2020-2-23 16:45
我说的就是L2TP over IPsec,ikev2比这简单多了,除了安卓都是自带ikev2客户端的

请问LZ解决了么?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

同问楼主解决了吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报


同问楼主解决了吗?求助求助
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

kitty22030 发表于 2020-2-22 22:30
楼主说的估计是L2TP over IPsec
不管Windows、macOS、还是iOS都可以直接用系统自带的L2TP客户端进行拨号 ...

请问在openwrt搭建ikev2,用什么插件呀,请帮忙指教一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这个问题现在有docker了,看我的帖子即可。

点评

设置隐私看不到你的贴子额,请问有什么解决方法呢  详情 回复 发表于 2022-4-26 15:26
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

qgtxqj 发表于 2022-4-8 08:15
这个问题现在有docker了,看我的帖子即可。

设置隐私看不到你的贴子额,请问有什么解决方法呢

点评

https://www.right.com.cn/forum/thread-8210761-1-1.html  详情 回复 发表于 2022-4-26 16:36
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我有我奥妙 发表于 2022-4-26 15:26
设置隐私看不到你的贴子额,请问有什么解决方法呢

https://www.right.com.cn/forum/thread-8210761-1-1.html
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-28 03:04

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表