FreeBSD ifconfig 尝试连接 OpenVPN 服务器时失败

FreeBSD ifconfig 尝试连接 OpenVPN 服务器时失败

我正在尝试使用 pfSense 中内置的 OpenVPN 客户端连接到远程服务器。

我失败了并检查了 OpenVPN 日志,上面写着(从下到上):

Exiting due to fatal error
FreeBSD ifconfig failed: external program exited with error status: 1
/sbin/ifconfig ovpnc5 10.11.0.34 netmask 255.255.255.0 mtu 1500 up
do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
TUN/TAP device /dev/tap5 opened
TUN/TAP device ovpnc5 exists previously, keep at program end
OPTIONS IMPORT: route-related options modified
OPTIONS IMPORT: --ifconfig/up options modified
OPTIONS IMPORT: timers and/or timeouts modified
Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
PUSH: Received control message: 'PUSH_REPLY,route 10.10.0.0 255.255.255.0,route-gateway 10.11.0.1,ping 10,ping-restart 120,ifconfig 10.11.0.34 255.255.255.0'
SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
[server] Peer Connection Initiated with [AF_INET]XX.XX.XX.XX:1194

据我了解,服务器推送ifconfig命令,但失败了。当我尝试手动执行它时,它也失败

>/sbin/ifconfig ovpnc5 10.11.0.34 netmask 255.255.255.0
ifconfig: ioctl (SIOCAIFADDR): Destination address required

这是否意味着服务器发送的命令使用了不正确的 FreeBSD 语法?或者这个不正确的语法来自 OpenVPN?

如何配置 OpenVPN 客户端忽略此类命令?

答案1

您错过了inet关键字:

ifconfig MYIFACE inet MYIPADDRESS netmask 255.255.255.0 mtu 1500 up

并且netmask可以快捷方式到inet MYIPADDRESS/24.

相关内容