首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ipsec重新加载无法加载ipsec.conf Strongswan 5.0

Ipsec重新加载无法加载ipsec.conf Strongswan 5.0
EN

Server Fault用户
提问于 2012-09-12 19:54:47
回答 1查看 16.6K关注 0票数 3

我在使用fedora 17 linux机器和强Swanv5.0.1dr2配置到Android设备的连接时遇到了问题。我已经取得了一些进展,但是当我尝试添加配置以支持xauth身份验证时,当我尝试重新加载配置文件时,我会收到一个错误。对于keyexchange设置的值ikev1,以及每当我试图为rightauth设置值时,我都会得到一个类似的错误。是否还有其他人有此问题? ipsec.conf的手册页和strongswan上的文档都表明,这些设置和值在5.0.x.x中应该是可以的。我可以尝试设置authby,但根据我所阅读的文档,这是不可取的,而且xauthpsk值不起作用。任何帮助都是非常感谢的。

无法加载配置'/etc/ipsec.conf':/etc/ipsec.conf:25:语法错误,意外字符串左紧

代码语言:javascript
复制
# /etc/ipsec.conf - Openswan IPsec configuration file
#
# Manual:     ipsec.conf.5
#
# Please place your own config files in /etc/ipsec.d/ ending in .conf

version 2.0     # conforms to second version of ipsec.conf specification

# basic configuration
config setup
       # For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
        protostack=netkey
        # Enable this if you see "failed to find any available worker"
        # nhelpers=0
        plutodebug=all
conn %default
        ikelifetime=240m
        #keylifetime=20m
        keyingtries=3
        ikev2=no


conn android
        left=10.1.12.212
        right=10.1.12.140
        leftxauthserver=yes
        leftauth=psk
        rightauth=xauth
        keyexchange=ikev1
        type=tunnel
        pfs=no
        rekey=no
        auto=start
        ike=aes256-md5;modp1024
        phase2=esp
        ikev2=no
#You may put your configuration (.conf) file in the "/etc/ipsec.d/"
#include /etc/ipsec.d/*.conf
EN

回答 1

Server Fault用户

回答已采纳

发布于 2012-09-12 21:48:46

要用XAuth 5.0.x (作为响应程序)配置strongSwan PSK,您必须使用:

代码语言:javascript
复制
    leftauth=psk
    rightauth=psk
    rightauth2=xauth

虽然不推荐使用authby=xauthpsk,但实际上它仍然可以作为上面的别名(添加了xauth=server )。

无法加载配置'/etc/ipsec.conf':/etc/ipsec.conf:25:语法错误,意外字符串左紧

这个错误以及这里使用的几个选项都不是有效的strongSwan选项(例如,phase2leftxauthserverike值中的分号也是无效的),这使我相信您实际上并不使用strongSwan,而是Openswan (leftauth是一个无效的选项)。

由于您可能直接从tarball构建了开发人员发行版,原因可能是您没有提供适当的./configure选项(例如,--prefix--sysconfdir)来替换默认的Fedora包提供的ipsec脚本。为了避免冲突,无论如何,您可能希望删除该包,如果不是,您还可以使用--with-ipsec-script=strongswan选项将strongswan的ipsec脚本重命名为strongswan。

票数 5
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/426860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档