FreeBSD 10.3: Configure OpenVPN client

In this article VPNBook provider has been chosen. Check here what they provide:

Go to and download a certificate bundle. I’ve chosen Euro1 Server. After download it you’ll finish with a zip named something like:

After unzip it four files are available. All are the same certificate/keys, but with different configuration. We will use the UDP53 one, named as:


Install OpenVPN:

pkg install openvpn

Copy the vpnbook certificate to the right place and make a link to it:

cp vpnbook-euro1-udp53.ovpn /usr/local/etc/openvpn
cd /usr/local/etc/openvpn
ln -s vpnbook-euro1-udp53.ovpn openvpn.conf

Make sure your machine is able to IP Forwarding. In FreeBSD edit /etc/rc.conf and put this line:


To activate it manually (to avoid reboot):

sysctl net.inet.ip.forwarding=1

This is needed in order your machine can route traffic between interfaces (through new tun0 interface).

Then start OpenVPN:

service openvpn onestart

Check progress with:

tail -f /var/log/messages

It can take some time and several retryings to get ipsec tunnel up. When it finishes and the tunnel is stablished you’ll have:

ifconfig tun0
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
inet6 fe80::f2de:f1ff:fe6a:ccb5%tun0 prefixlen 64 scopeid 0x5
inet --> netmask 0xffffffff
Opened by PID 5608

Maybe a different resolv.conf with different nameservers could be needed. With some networks I must replace the resolv.conf obtained via dhcp with a custom with OpenDNS nameservers:


About jjjesss

I'm a guy interested in technology, bsd fan and concerned about the world around.
This entry was posted in BSD, FreeBSD. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s