{"id":86,"date":"2006-03-09T03:19:54","date_gmt":"2006-03-09T03:19:54","guid":{"rendered":"https:\/\/www.darknet.org.uk\/2006\/03\/ssl-vpns-and-openvpn-part-iii\/"},"modified":"2010-06-21T18:48:28","modified_gmt":"2010-06-21T17:48:28","slug":"ssl-vpns-and-openvpn-part-iii","status":"publish","type":"post","link":"https:\/\/www.darknet.org.uk\/2006\/03\/ssl-vpns-and-openvpn-part-iii\/","title":{"rendered":"SSL VPNs and OpenVPN – Part III"},"content":{"rendered":"

<\/p>\n

3. Brief How-to ….. OpenVPN and Site-to-Site Tunnels.<\/h2>\n

OpenVPN can be implemented either Site-to-site or client-server model. I will take example configurations of both models.<\/p>\n

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.<\/p>\n

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;<\/p>\n

Linux<\/strong>: http:\/\/openvpn.net\/download.html<\/a><\/p>\n

I would recommend using Mathias Sundman’s “OpenVPN GUI for windows” for its sheer simplicity.<\/p>\n

Windows<\/strong>: http:\/\/openvpn.se\/download.html<\/a><\/p>\n

Example of using static keys to create a site-to-site VPN:<\/strong><\/p>\n

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.<\/p>\n

First generate a static key using this command;<\/p>\n

openvpn --genkey --secret static.key<\/code><\/p>\n

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.<\/p>\n

Copy the static key file in “config”\u009d directory of OpenVPN installation.<\/p>\n

Create a configuration file named “server.ovpn” in the config directory of OpenVPN, and type this in the file;<\/p>\n

dev tun<\/code><\/p>\n

ifconfig 10.33.66.1 10.33.66.2<\/code><\/p>\n

secret static.key<\/code><\/p>\n

Now create a “client.ovpn”\u009d 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;<\/p>\n

remote remoteserverip<\/code><\/p>\n

dev tun<\/code><\/p>\n

ifconfig 10.33.66.2 10.33.66.1<\/code><\/p>\n

secret static.key<\/code><\/p>\n

The IP address of remote server will come in place of “remoteserverip”\u009d in the remote directive of client.ovpn.<\/p>\n

Now start OpenVPN executables using these ovpn files that we created. If you get “Initialization Sequence Completed”\u009d in the window, most of your work is done. Now ping the other end of tunnel. If ping succeeds, you are done!<\/p>\n

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.
\nIf you want to access the networks behind <\/strong>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.<\/p>\n

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.<\/p>\n

Next: Creating OpenVPN tunnels for Clients-to-site scenario….<\/strong><\/p>\n

Read on in Part IV<\/a><\/p>\n

Previously:<\/p>\n

<\/p>\n

1. SSL VPNs and Using OpenVPN : What is an SSL VPN<\/a>
\n
2. SSL VPNs and OpenVPN – Part II : Why OpenVPN?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[6,5,11],"tags":[188,215,191,213,190,214,189],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Siddharth","author_link":"https:\/\/www.darknet.org.uk\/author\/siddharth\/"},"_links":{"self":[{"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/posts\/86"}],"collection":[{"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.darknet.org.uk\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}