Openvpn client Freebsd
-
Basic openvpn client Freebsd
pkg install openvpn
sysrc openvpn_enable="YES"
sysrc openvpn_if="tun"
Place your openvpn config file in a location unavailable to other users.
Insure your .conf contains the proper tunnel name, in this case I’ll use ‘tun’
This guide is basic! For simplicity of getting started; As well, service openvpn start is not required or needed in this situation!
service openvpn start
cd into the directory of your config file
then:
openvpn config.conf
Output:
Fri Nov 10 04:45:43 2017 library versions: OpenSSL 1.0.2k-freebsd 26 Jan 2017, LZO 2.10 Enter Auth Username: Enter Auth Password: Fri Nov 10 04:45:50 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]<ip and port will print here> Fri Nov 10 04:45:50 2017 UDP link local (bound): [AF_INET][undef]:0 Fri Nov 10 04:45:50 2017 UDP link remote: [AF_INET]<ip and port will print here> Fri Nov 10 04:45:50 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this Fri Nov 10 04:45:50 2017 [rick] Peer Connection Initiated with [AF_INET]<ip and port will print here> Fri Nov 10 04:45:51 2017 TUN/TAP device /dev/tun0 opened Fri Nov 10 04:45:51 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0 Fri Nov 10 04:45:51 2017 /sbin/ifconfig tun0 10.10.2.10 10.10.2.9 mtu 1500 netmask 255.255.255.255 up add net <ip will print here>: gateway 10.10.5.1 add net 0.0.0.0: gateway 10.10.2.9 add net 128.0.0.0: gateway 10.10.2.9 add net 10.10.1.0: gateway 10.10.2.9 add net 10.10.2.1: gateway 10.10.2.9 Fri Nov 10 04:45:51 2017 Initialization Sequence Completed
As you can see there is a prompt for username and password. This can be circumvented, as well as starting the connection at boot. However this is just to get you going.
There is much more to learn!