My /etc/rc.conf in FreeBsd 11:

  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"

When trying to start 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)

But why? I've already specified a device in rc.conf

How to fix that?

p.s.

sudo service openvpn start ===> /usr/local/etc/rc.d/openvpn: WARNING: failed to start openvpn

rc.conf settings are used by startup scripts in /etc/rc.d and /usr/local/etc/rc.d. openvpn itself doesn't read this file. You need to use a script from rc.d to start openvpn.

  • sudo service openvpn start ===> /usr/local/etc/rc.d/openvpn: WARNING: failed to start openvpn – Ivanari May 12 at 12:44
  • @lvanari you need to look into appropriate logs for the cause of failure to start openvpn. – AlexD May 12 at 14:12

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.