{"id":550,"date":"2010-07-06T16:47:01","date_gmt":"2010-07-06T21:47:01","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=550"},"modified":"2010-07-06T17:31:44","modified_gmt":"2010-07-06T22:31:44","slug":"openvpn-mac-osx-static-routes","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2010\/07\/openvpn-mac-osx-static-routes\/","title":{"rendered":"OpenVPN, Mac OSX, Static Routes"},"content":{"rendered":"<p>Companies usually use Windows machines on a Windows network &#8211; everything is pretty much the same flavor of Windows, and all updates are forced upon the users.  It&#8217;s actually very easy to maintain a Windows environment, provided the company allows the IT department to lock everything down on the end users.<\/p>\n<p>Ah, but I had a new challenge today &#8211; get a Macintosh OSX 10.6.3 (now 10.6.4) to connect to the VPN and gain access to all of the network resources.<\/p>\n<p>The company is using an OpenVPN solution &#8211; which means the choices for connecting are a lot nicer.<\/p>\n<blockquote><p>Download Tunnelblick for Mac OS X<br \/>\n<a href=\"http:\/\/code.google.com\/p\/tunnelblick\">http:\/\/code.google.com\/p\/tunnelblick<\/a><br \/>\nAt the time of this writing, they&#8217;re on version 3.0 stable and 3.1.06 beta.  I&#8217;m using the stable version.<br \/>\nInstall Tunnelblick by double clicking on the DMG file and then double clicking on the Tunnelblick.app file<br \/>\nPress the Install button<br \/>\nLaunch Tunnelblick<br \/>\nUse your LOCAL credentials to install<br \/>\nCreate and open configuration folder<br \/>\nMove your filename.ovpn and your certificate.pem\/crt file (\/Users\/username\/Library\/Application Support\/Tunnelblick\/Configurations)<br \/>\nLaunch the Tunnelblick program &#8211; it should show up next to the time in the apple menu bar<br \/>\nNow you can click on the icon and select the VPN you want to connect to\n<\/p><\/blockquote>\n<p>Ah, but you want static routes too?  OK.<\/p>\n<p>Roark Holz gave me this snippet to use (I edited a bit):<br \/>\nLogin as root (or sudo in front of all of these commands)<br \/>\n<code>cd \/Library\/StartupItems<\/code><br \/>\n<code>mkdir AddRoutes<\/code><br \/>\n<code>cd AddRoutes<\/code><br \/>\n<code>nano AddRoutes<\/code><\/p>\n<blockquote><p>#!\/bin\/sh<br \/>\n. \/etc\/rc.common<br \/>\nStartService ()<br \/>\n{<br \/>\n        ConsoleMessage &#8220;Adding Static Routing Tables&#8221;<br \/>\n        route add -net 10.1.0.0 -netmask 255.255.255.0 10.50.0.254<br \/>\n}<br \/>\nStopService ()<br \/>\n{<br \/>\n        return 0<br \/>\n}<br \/>\nRestartService ()<br \/>\n{<br \/>\n        return 0<br \/>\n}<br \/>\nRunService &#8220;$1&#8221;\n<\/p><\/blockquote>\n<p><code>nano StartupParameters.plist<\/code><\/p>\n<blockquote><p>{<br \/>\n        Description     = &#8220;Add static routing tables&#8221;;<br \/>\n        Provides        = (&#8220;AddRoutes&#8221;);<br \/>\n        Requires        = (&#8220;Network&#8221;);<br \/>\n        OrderPreference = &#8220;None&#8221;;<br \/>\n}<\/p><\/blockquote>\n<p><code>chmod 755 AddRoutes StartupParameters.plist<\/code><br \/>\n<code>reboot<\/code><\/p>\n<p>After rebooting, check the route tables with:<br \/>\n<code>netstat -r<\/code><\/p>\n<p>Obviously 10.1.0.0 is the network, the netmask will be any variation of your netmask on the network, and the final IP is the gateway.<\/p>\n<p>***EDIT***<br \/>\nOK, so I found out that since the TAP network is not enabled until AFTER booting and starting Tunnelblick&#8230; I had to edit the .ovpn file to include the following:<br \/>\n<code>--route 10.1.0.0 255.255.255.0 10.50.0.254<\/code><br \/>\n<code>--route 10.2.0.0 255.255.255.0 10.50.0.254<\/code><br \/>\nETC.  Works like a charm now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Companies usually use Windows machines on a Windows network &#8211; everything is pretty much the same flavor of Windows, and all updates are forced upon the users. It&#8217;s actually very easy to maintain a Windows environment, provided the company allows the IT department to lock everything down on the end users. Ah, but I had &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2010\/07\/openvpn-mac-osx-static-routes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">OpenVPN, Mac OSX, Static Routes<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,4],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry","category-linux","category-networking"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":6,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":556,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/550\/revisions\/556"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}