This should really go into the ‘memo to self’ category but I don’t have one. Regardless…
I have an Ubuntu VM running OpenVPN in Bridge mode (tap). I wanted to bridge my cottage network to my home network using pfSense out at the cottage. In the process of making this work, a fair amount of googling was involved so I decided to aggregate all of the information in one place in case I ever needed to reproduce it. Friend Kurt was running up against some of the same issues.
First, make sure your OpenVPN server is working and that you have the following client specific files available (filenames will likely vary):
On the server, I had to make some minor changes to make everything work:
If you can ping client->server but the connection hangs when you try to edit a file or view a web-page
If on the client, you see “OpenVPN Bad LZO decompression header byte:”? I had to comment out “comp-lzo” on the server… This seems bogus but it made it work. Need to investigate this later.
The client says “Authenticate/Decrypt packet error: cipher final failed”, the issue is the cipher being used. The default on the server was “BF-CBC” but the pfSense default was “AES-128-CBC”. Change the pfSense to “BF-CBC” and you’re good to go.
The general procedure for making this work in pfSense is the following:
- Go to System->Cert. Manager and add your server’s “ca.crt” to Certificate Authorities. Give it a descriptive name.
- Then go to System->Cert. Manager->certificates and add your client.crt and client.key. Give it a descriptive name as well. Ensure you do this after you’ve added ca.crt so that when you add this certificate, it will reference the above ca.crt.
- Go to VPN->OpenVPN->Client and click ‘Add’
- Select Peer-to-Peer under ‘Server mode’
- Select ‘tap’ under ‘Device Mode’
- Select ‘WAN’ under ‘Interface’
- Set your server host/address to your VPN server address.
- Set the port accordingly.
- Set description to something you’ll recognize.
- Under TLS Authetication, set ‘Enable authentication of TLS packets’. It will drop down a text box into which you can paste the contents of ‘ta.key’.
- Set ‘Peer Certificate Authority’ to the one you added above.
- Set ‘Client Certificate’ to the one you added above.
- Set encryption algorithm to whatever your VPN server is using (BF-CBC in my case)
- Under ‘Custom Options’, I had:
The final note I’d like to add is one about IP addresses. When you set your ‘server-bridge’ parameter on the server’s VPN config, you assign a pool of IP addresses that are not in your dhcp server’s range. By default, the IP addresses assigned are specific to the client certificate. So if you find your clients are all getting the same IP address, it is because they each need a unique client certificate. You can override this behavior using the ‘duplicate-cn’ directive in your server’s config file. It’s generally not a good idea though so you should just create unique client certificates.