我在使用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:语法错误,意外字符串左紧
# /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发布于 2012-09-12 21:48:46
要用XAuth 5.0.x (作为响应程序)配置strongSwan PSK,您必须使用:
leftauth=psk
rightauth=psk
rightauth2=xauth虽然不推荐使用authby=xauthpsk,但实际上它仍然可以作为上面的别名(添加了xauth=server )。
无法加载配置'/etc/ipsec.conf':/etc/ipsec.conf:25:语法错误,意外字符串左紧
这个错误以及这里使用的几个选项都不是有效的strongSwan选项(例如,phase2和leftxauthserver,ike值中的分号也是无效的),这使我相信您实际上并不使用strongSwan,而是Openswan (leftauth是一个无效的选项)。
由于您可能直接从tarball构建了开发人员发行版,原因可能是您没有提供适当的./configure选项(例如,--prefix和--sysconfdir)来替换默认的Fedora包提供的ipsec脚本。为了避免冲突,无论如何,您可能希望删除该包,如果不是,您还可以使用--with-ipsec-script=strongswan选项将strongswan的ipsec脚本重命名为strongswan。
https://serverfault.com/questions/426860
复制相似问题