我的 FreeBsd 11 中的 /etc/rc.conf:
hostname="abcd"
sshd_enable="YES"
static_routes="linklocal"
ifconfig_vtnet0="DHCP"
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_activate_all_interfaces="YES"
rtsold_enable="YES"
rtsold_flags="-aF"
nginx_enable="YES"
postgresql_enable="YES"
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf" # it exists
openvpn_if="tun"
gateway_enable="YES"
firewall_enable="YES"
firewall_type="open"
firewall_nat_enable="YES"
firewall_nat_interface="vtnet0"
natd_enable="YES"
natd_interface="vtnet0"
natd_flags="-dynamic -m"
尝试启动 openvpn 时:
$ sudo openvpn --config openvpn.conf
WARNING: Ignoring option 'dh' in tls-client mode, please only include this in your server configuration
disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Options error: You must define TUN/TAP device (--dev)
但为什么?我已经在 rc.conf 中指定了一个设备
如何修复?
附言
sudo service openvpn start
===>/usr/local/etc/rc.d/openvpn: WARNING: failed to start openvpn
答案1
rc.conf
/etc/rc.d
设置由和中的启动脚本使用/usr/local/etc/rc.d
。openvpn
它本身不读取此文件。您需要使用 中的脚本来rc.d
启动openvpn
。