3. Brief How-to ….. OpenVPN and Site-to-Site Tunnels.
OpenVPN can be implemented either Site-to-site or client-server model. I will take example configurations of both models.
If you want to implement site-to-site configuration, the best way is to use static-keys instead of PKI. Using static keys, you can have your VPN tunnel up and running in a jiffy.
First, decide which Operating systems will be used for implementing VPN endpoints on your network. According to OS, download the OpenVPN software from these locations;
I would recommend using Mathias Sundman’s “OpenVPN GUI for windows” for its sheer simplicity.
Example of using static keys to create a site-to-site VPN:
In this example, a VPN tunnel will be created with a server endpoint of 10.33.66.1 and a client (peer) endpoint of 10.33.66.2. Encrypted communication between peers will occur over UDP port 1194, the default OpenVPN port.
First generate a static key using this command;
openvpn --genkey --secret static.key
Copy the static key to both peers over some secure channel. Heck, use a pen drive if you are paranoid and have access to both peers physically.
Copy the static key file in “config” directory of OpenVPN installation.
Create a configuration file named “server.ovpn” in the config directory of OpenVPN, and type this in the file;
ifconfig 10.33.66.1 10.33.66.2
Now create a “client.ovpn” file in config directory of second peer which will effectively become a client for the server you created just now. Put the following in the client file;
ifconfig 10.33.66.2 10.33.66.1
The IP address of remote server will come in place of “remoteserverip” in the remote directive of client.ovpn.
Now start OpenVPN executables using these ovpn files that we created. If you get “Initialization Sequence Completed” in the window, most of your work is done. Now ping the other end of tunnel. If ping succeeds, you are done!
Always make sure that you have UDP port 1194 (or any port/transport protocol over which you plan to create a tunnel) open through the network. This may require manually opening the ports at the firewalls/routers at both ends.
If you want to access the networks behind the endpoint servers, there are two options. Either you use routing (TUN) mode or bridging (TAP) mode on your OpenVPN machines. For some obscure reasons if you want to allow non-routable protocols to be tunneled (like NetBIOS) then you will have to use OpenVPN in TAP mode. Bridging ensures that your VPN endpoints make a long reach Ethernet over your WAN.
If you decide that you want to use a routed (TUN) mode, then you must enable IP forwarding on the OpenVPN machine. The virtual interface can be made external interface and local area connection can be designated internal. It will basically become a router and you can do everything with this box that you could with Linux/windows based router.
Next: Creating OpenVPN tunnels for Clients-to-site scenario….
- Parrot Security OS – Debian Based Security Oriented Operating System
- SamuraiWTF 3.x And Onwards – Web Testing Framework Linux LiveCD
- Pentoo – Gentoo Based Penetration Testing Linux LiveCD
- SSL VPNs and OpenVPN – Part II
- SSL VPNs and Using OpenVPN
- SSL VPNs and OpenVPN – Part IV
Most Read in Linux Hacking:
- Kon-Boot – Reset Windows & Linux Passwords - 137,533 views
- Russix – LiveCD Linux Distro for Wireless Penetration Testing & WEP Cracking - 125,782 views
- BackTrack v2.0 – Hackers LiveCD Finally Released - 100,748 views