1

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

Ivanari
  • 11
  • 3

1 Answers1

0

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.

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