How to bridge networks with OpenVPN

OpenVPN is an easy-to-use open source VPN software based on SSL (Secure Sockets Layer) that offers cross-platform interoperability. The majority of OpenVPN tutorials I’ve found describe how users can connect to a corporate network from their laptops over insecure networks, such as the wireless network in a hotel. By contrast, the setup I’m about to describe is better suited for permanently connecting entire networks — for example, branch offices to the headquarters of a company.

For this setup I’ll assume that you have two networks, A and B, in different locations, both connected to the Internet with broadband. At each location you will need a Linux system acting as a router/firewall to serve as the VPN end point. I’m using two Asus WL-500G Deluxe routers running OpenWRT RC5 — a Linux distribution for embedded routers — but you’re free to use the hardware and distribution of your choice. You can use one of the BSDs, Mac OS X, or even Windows; check the documentation on OpenVPN’s homepage for a list of supported operating systems. If your use OpenBSD, have a look at the article Creating secure wireless access points with OpenBSD and OpenVPN.

Comment +0