How to Start OpenVPN?

Drew Tomlinson drew at
Mon Jun 27 23:06:48 GMT 2005

I installed OpenVPN 2.0 via the ports on a 4.11 machine.  I can start it 
just find by these two steps:

1.  cd /usr/local/etc/openvpn
2.  openvpn server.conf &

The OpenVPN man page suggests that using the '--daemon' switch will make 
OpenVPN run as a daemon but it doesn't work for me.  No error message 
but no process started.  There are no entries in the log file.

The port installed /usr/local/etc/rc.d/  I've looked 
at the script but all it does is start the tun interface.  Thus I have 
attempted to modify it to include actually starting the OpenVPN daemon.  
Here is my script:

case x$1 in
  xstart) echo -e "Starting OpenVPN\n" ;
          exec kldload if_tap ;
          openvpn --daemon \
                --cd /usr/local/etc/openvpn \
                --writepid /var/run/ \
                --config server.conf.nogateway ;;

   xstop)  echo -e "Stopping OpenVPN\n"  ;
          exec kldunload if_tap ;
          kill `cat /var/run/` ;
          rm /var/run/ ;;

  *)      echo >&2 "Usage: $0 {start|stop}"

Can anyone tell me my error?



Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!

More information about the freebsd-questions mailing list