开发者社区> 问答> 正文

在ECS CentOS上配置L2tP服务,一直无法连接,提示“no connection has been authorized with policy=PSK”

ECS上配置L2TP服务后,执行ipsec verify,正常:
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.38/K3.10.0-514.26.2.el7.x86_64 (netkey)
Checking for IPsec support in kernel [OK]
SAref kernel support [N/A]
NETKEY: Testing XFRM related proc values [OK]

[OK]
[OK]

Hardware RNG detected, testing if used properly [OK]
Checking that pluto is running [OK]
Pluto listening for IKE on udp 500 [OK]
Pluto listening for NAT-T on udp 4500 [OK]
Checking for 'ip' command [OK]
Checking /bin/sh is not /bin/dash [OK]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]

但是连接L2TP时,/var/log/secure中出现下列错误:
Nov 17 11:43:15 izj6c6h25ghj5n6vo0emwnz pluto[10722]: packet from 124.205.127.38:500: ignoring Vendor ID payload [IKE CGA version 1]
Nov 17 11:43:15 izj6c6h25ghj5n6vo0emwnz pluto[10722]: packet from 124.205.127.38:500: initial Main Mode message received on 172.31.232.230:500 but no connection has been authorized with policy=PSK
Nov 17 11:43:16 izj6c6h25ghj5n6vo0emwnz pluto[10722]: packet from 124.205.127.38:500: phase 1 message is part of an unknown exchange
折腾了3天仍然不知原因,能否指点一下?
非常感谢!

展开
收起
camore 2017-11-17 13:36:02 14190 0
4 条回答
写回答
取消 提交回答
  • 最佳回答:

    一般都是安全组和iptables的问题, 4500/500/1701 udp端口允许

    然后就能连上, 不过连上不一定能上网, 解决方式如下

    vi /etc/sysconfig/iptables

    注释掉-A POSTROUTING -s 192.168.8.0/24 -j SNAT -o eth0 --to-source 47.52.xxx.xxx(外网IP)

    加一条-A POSTROUTING -s 192.168.8.0/24 -o eth0 -j MASQUERADE

    service iptables restart

    更多参考地址: 阿里云官方(新用户需官网注册查看)

    2021-04-08 18:27:49
    赞同 展开评论 打赏
  • 兄台,解决了没有,安全组端口都打开了,还是这样,求解

    2019-07-17 21:44:09
    赞同 展开评论 打赏
  • 一般都是安全组和iptables的问题, 4500/500/1701 udp端口允许

    然后就能连上, 不过连上不一定能上网, 解决方式如下

    vi /etc/sysconfig/iptables

    注释掉-A POSTROUTING -s 192.168.8.0/24 -j SNAT -o eth0 --to-source 47.52.xxx.xxx(外网IP)
    加一条-A POSTROUTING -s 192.168.8.0/24 -o eth0 -j MASQUERADE

    service iptables restart

    2019-07-17 21:44:09
    赞同 展开评论 打赏
  • 乐善好施

    建议使用 1000+以上端口试下

    2019-07-17 21:44:09
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载