dud*_*bro 3 linux ipsec android
我在使用 fedora 17 linux 机器和 strongSwanv5.0.1dr2 配置与 Android 设备的连接时遇到问题。我取得了一些进展,但是当我尝试添加配置以支持 xauth 身份验证时,我在尝试重新加载配置文件时收到错误消息。对于 keyexchange 设置的值 ikev1 以及每当我尝试为 rightauth 设置值时,我都会收到类似的错误。有没有其他人遇到过这个问题 ipsec.conf 的手册页和 strongswan wiki 上的文档都表明这些设置和值在 5.0.xx 中应该没问题我可以尝试设置 authby 但根据我阅读的文档已弃用xauthpsk 值不起作用。非常感谢任何帮助。
无法加载配置 '/etc/ipsec.conf': /etc/ipsec.conf:25: 语法错误,意外字符串 [leftauth]
# /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
Run Code Online (Sandbox Code Playgroud)
要使用 strongSwan 5.0.x(作为响应者)配置 XAuth PSK,您必须使用:
leftauth=psk
rightauth=psk
rightauth2=xauth
Run Code Online (Sandbox Code Playgroud)
虽然 deprecatedauthby=xauthpsk实际上仍然可以作为上述的别名(xauth=server也添加了)。
无法加载配置 '/etc/ipsec.conf': /etc/ipsec.conf:25: 语法错误,意外字符串 [leftauth]
这个错误以及这里使用的几个选项都不是有效的 strongSwan 选项的事实(例如phase2和leftxauthserver,值中的分号ike也是无效的)让我相信你实际上不使用 strongSwan 而是使用 Openswan(leftauth是一个无效的选项) )。
由于您可能直接从 tarball 构建开发人员版本,原因可能是您没有提供适当的./configure选项(例如--prefix和--sysconfdir)来替换ipsec默认 Fedora Openswan 软件包提供的脚本。为避免冲突,您可能希望删除该软件包,否则,您还可以使用该--with-ipsec-script=strongswan选项将 strongSwan 的ipsec脚本重命名为strongswan。