{"id":8,"date":"2008-10-29T14:09:01","date_gmt":"2008-10-29T21:09:01","guid":{"rendered":"http:\/\/www.1oc.com\/blog\/?p=8"},"modified":"2008-10-29T14:09:01","modified_gmt":"2008-10-29T21:09:01","slug":"setting-up-a-vpn-tunnel-wit-pfsense-and-openvpn","status":"publish","type":"post","link":"http:\/\/blog.1oc.com\/?p=8","title":{"rendered":"Setting up a VPN tunnel with pfSense and OpenVPN"},"content":{"rendered":"<p>You&#8217;ll ned to pfSense boxes.<\/p>\n<p>On our example we have both connected to INTERNET each one with one public access on the WAN\u00a0interface.<\/p>\n<p>For the LAN we&#8217;ve set up 2 class C networks. Let&#8217;s call pfSenseA the one using\u00a010.110.8.1 (as LAN), and pfSenseB the one using\u00a010.110.9.1.<\/p>\n<p>First, Go to System -&gt;\u00a0Advance\u00a0Options and\u00a0Enable Secure Shell. We&#8217;ll connect to one of the boxes in order to create CA\u00a0certificates.<\/p>\n<p>We&#8217;ll start working on pfSeseB\u00a0which\u00a0is going to be our SERVER.<\/p>\n<div id=\"attachment_13\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-13.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13\" class=\"size-medium wp-image-13\" title=\"picture-13\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-13-300x104.png\" alt=\"Enable Secure Shell\" width=\"300\" height=\"104\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-13-300x104.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-13-500x173.png 500w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-13.png 913w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-13\" class=\"wp-caption-text\">Enable Secure Shell<\/p><\/div>\n<p>\u00a0And then SSH to the box.<\/p>\n<p>&gt;\u00a0ssh admin@10.110.9.1<\/p>\n<p>You&#8217;ll be presented with the Console options:<\/p>\n<p>*** Welcome to pfSense 1.2-RELEASE-embedded on fwofficebackup ***<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0\u00a0OPT1(DMZ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0-&gt; \u00a0 rl0 \u00a0 \u00a0 -&gt; \u00a0 \u00a0 \u00a0NONE<\/p>\n<p>\u00a0\u00a0LAN* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -&gt; \u00a0 rl1 \u00a0 \u00a0 -&gt; \u00a0 \u00a0 \u00a010.110.9.1<\/p>\n<p>\u00a0\u00a0WAN* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -&gt; \u00a0 rl2 \u00a0 \u00a0 -&gt; \u00a0 \u00a0 \u00a067.63.42.4<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0pfSense console setup\u00a0<\/p>\n<p>***********************<\/p>\n<p>\u00a00) \u00a0Logout (SSH only)<\/p>\n<p>\u00a01) \u00a0Assign Interfaces<\/p>\n<p>\u00a02) \u00a0Set LAN IP address<\/p>\n<p>\u00a03) \u00a0Reset webConfigurator password<\/p>\n<p>\u00a04) \u00a0Reset to factory defaults<\/p>\n<p>\u00a05) \u00a0Reboot system<\/p>\n<p>\u00a06) \u00a0Halt system<\/p>\n<p>\u00a07) \u00a0Ping host<\/p>\n<p>\u00a08) \u00a0Shell<\/p>\n<p>\u00a09) \u00a0PFtop<\/p>\n<p>10) \u00a0Filter Logs<\/p>\n<p>11) \u00a0Restart webConfigurator<\/p>\n<p>12) \u00a0pfSense PHP shell<\/p>\n<p>13) \u00a0Upgrade from console<\/p>\n<p>\u00a0<\/p>\n<p>Enter an option:\u00a0<\/p>\n<div>Just option 8 (shell).<\/div>\n<div>If you mounted disk is read-only move to\u00a0another-one\u00a0with rw privileges like &#8220;\/tmp&#8221;<\/div>\n<div>Then create a Shared Key<\/div>\n<div>&gt;\u00a0openvpn &#8211;genkey &#8211;secret shared.key<\/div>\n<div>copy it to the pfSense as follow:<\/div>\n<div>&gt;cat shared.key<\/div>\n<div>and Copy the output.<\/div>\n<div>Now, let&#8217;s go to pfSenseA and Click on VPN -&gt; OpenVPN and ADD (+) an new Server:<\/div>\n<div>\n<dl id=\"attachment_16\" class=\"wp-caption alignnone\" style=\"width: 310px;\">\n<dt class=\"wp-caption-dt\"><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-16\" title=\"picture-14\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-14-300x98.png\" alt=\"Add a Server OpenVPN\" width=\"300\" height=\"98\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-14-300x98.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-14-500x163.png 500w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-14.png 871w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/dt>\n<dd class=\"wp-caption-dd\">Add a Server OpenVPN<\/dd>\n<\/dl>\n<\/div>\n<div>Let&#8217;s Create a TCP one, and copy the pasted key from the shell to the Share Key Field.<\/div>\n<div>Add a Pool of unused addresses, in our example we&#8217;ll use 192.168.70.0\/24 and for Remote Network use the net for pfSenseA, in our case\u00a010.110.8.0\/24<\/div>\n<div>And we SAVE the changes on the pfSenseA<\/div>\n<div>\n<dl id=\"attachment_18\" class=\"wp-caption alignnone\" style=\"width: 310px;\">\n<dt class=\"wp-caption-dt\"><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-18\" title=\"picture-15\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-15-300x281.png\" alt=\"Server's side Configuration\" width=\"300\" height=\"281\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-15-300x281.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-15-319x300.png 319w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-15.png 872w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/dt>\n<dd class=\"wp-caption-dd\">Server<\/dd>\n<\/dl>\n<\/div>\n<div>Now, on pfSenseA, will go to VPN-&gt;OpenVPN and we create a Client.<\/div>\n<div>Configure the protocol as TCP and copy the SAME shared key we used on the server-side<\/div>\n<div>As Server Address enter the PUBLIC IP address of pfSenseB.<\/div>\n<div>As Remote IP use pfSenseB network\u00a010.110.9.0\/24 and for Interface IP use the pool of addresses you used on the Server-side (192.168.70.0\/25)<\/div>\n<div>NOTE. the attached image has the wrong IP Interface address, I&#8217;ve troubleshoot it at a later time.<\/div>\n<div>And SAVE it.<\/div>\n<div>\n<div id=\"attachment_20\" style=\"width: 310px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-16.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20\" class=\"size-medium wp-image-20\" title=\"picture-16\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-16-300x258.png\" alt=\"Client's Side\" width=\"300\" height=\"258\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-16-300x258.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-16-347x300.png 347w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2008\/10\/picture-16.png 855w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-20\" class=\"wp-caption-text\">Client<\/p><\/div>\n<p>\u00a0<\/p>\n<p>Make sure that you allow incoming TCP to the OpenVPN port on both ipSense comming from each other.<\/p>\n<p>Now ping from one network to the other, and DONE.<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You&#8217;ll ned to pfSense boxes. On our example we have both connected to INTERNET each one with one public access on the WAN\u00a0interface. For the LAN we&#8217;ve set up 2 class C networks. Let&#8217;s call pfSenseA the one using\u00a010.110.8.1 (as &hellip; <a href=\"http:\/\/blog.1oc.com\/?p=8\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-firewalls"],"_links":{"self":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8"}],"version-history":[{"count":0,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}