How To: Use Your Ubuntu Computer as a VPN Router

Want a VPN router but don’t have the cash to buy new hardware? Here’s an easy and free way to create a wireless VPN router for all the devices on your network using the Ubuntu Linux operating system.

First, a little background on VPN routers. A VPN router is a router connected to a VPN service and routes all traffic through it into the VPN. The big advantage is that all devices that connect to your router — computers, phones, tablets, TVs, etc. — will have automatic access to the VPN.

You can buy or create a router that is specifically designed for VPN access. (We have a review of the top options here.) But you could also just use an Ubuntu computer to do this.

This would even work with an old, spare computer, which makes it a great way to re-purpose a machine that would otherwise be sitting unused in your closet.

Here are the steps for setting up a VPN router using an Ubuntu PC or laptop:

  1. Install Ubuntu on your computer. We used Ubuntu 14.04, but any recent version should work.
  2. Connect your Ubuntu machine to the Internet using an ethernet cable.
  3. Disable wireless by right-clicking on the NetworkManager icon in the top-right part of the screen.
  4. Install an app to connect to your VPN provider’s service on Ubuntu, and connect to the service. Some services provide custom apps for VPN connections. You could also install the generic Ubuntu OpenVPN app, which should allow you to connect to any service that supports OpenVPN — which virtually all do.
  5. Right-click on the NetworkManager icon.
  6. Select Edit Connections.
  7. Click Add to create a new connection.
  8. Choose Wi-Fi as the type of connection.
  9. In the next window, enter a name for your network, set the mode as Infrastructure and in the Device MAC address field, select your wireless card (which is most likely called wlan0) from the list.
  10. Switch to the IPv4 Settings tab and select Shared to other computers in the Method list.
  11. Use the Wifi Security tab to set a password for your wireless network, if desired.
  12. Click save to save and enable the configuration.
  13. Reenable wireless so that changes take effect.

That’s it. Now any other device should be able to connect to the wireless network you created. Once connected, its traffic will be routed through your VPN provider’s network as long as your Ubuntu computer is logged into the VPN.

The major downside to this method is that it requires you to have a wired connection for your Ubuntu PC to access the Internet. (If you have two wireless cards, you should be able to do this without a wired connection, but we didn’t test that setup.) Otherwise, this is a free and relatively easy way to build a VPN router for yourself, even if you don’t have a lot of experience with Ubuntu.

2 thoughts on “How To: Use Your Ubuntu Computer as a VPN Router”

  1. Hello greycoder,
    what if I want the vpn sending computer to be connected to the internet via wifi, and the vpn receiving computer to be connected to the ethernet port of the vpn sending computer?

Leave a Comment

Your email address will not be published. Required fields are marked *