{"id":565,"date":"2011-02-23T10:27:51","date_gmt":"2011-02-23T10:27:51","guid":{"rendered":"http:\/\/www.esds.co.in\/data-centers\/kb\/?p=565"},"modified":"2015-06-22T11:25:12","modified_gmt":"2015-06-22T11:25:12","slug":"openvpn-to-access-the-internet","status":"publish","type":"post","link":"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/","title":{"rendered":"OpenVPN To Access The Internet"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-566\" title=\"openvpn-logo\" alt=\"\" src=\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/02\/openvpn-logo.png\" width=\"675\" height=\"67\" srcset=\"https:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/02\/openvpn-logo.png 656w, https:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/02\/openvpn-logo-300x30.png 300w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/>Sometimes you need to do so that the user, after connecting to VPN, could use the server colocation as a default gateway that is accessed through the Internet. Even if you already have a default gateway. The problem that arises here is: how to make sure that after installing the default gateway, encapsulated in the VPN packets can achieve this same VPN-server? Of course, if all users are in certain circumstances, it is possible to cheat a bunch of scripts that would route to the VPN-server through the old default gateway, but here in OpenVPN option appears, which allows you to automatically adjust routing as expected:<\/p>\n<p><strong>1. <\/strong>Prescribe the route to the VPN-server over the current default gateway.<br \/>\n<strong>2. <\/strong>Set a new default gateway through the VPN-server<\/p>\n<p><strong>This option is called the redirect-gateway. If you really decided to distribute internet through OpenVPN, here&#8217;s the technique:<\/strong><\/p>\n<p><em>In the configuration file, add a client:<br \/>\nredirect-gateway<br \/>\ndhcp-option DNS &lt;new DNS-server&gt;<\/em><\/p>\n<p><em>On the server set up, respectively, ip forwarding + NAT:<br \/>\n\/ Etc \/ sysctl.conf:<br \/>\nnet.ipv4.ip_forward = 1<\/em><\/p>\n<p><em># Sysctl-p<\/em><\/p>\n<p><em># Iptables-t nat-I POSTROUTING-s $ VPN_IP_RANGE-o $ INET_IFACE-j SNAT &#8211; to-source $ SERVER_EXT_IP<\/em><\/p>\n<p>And it works. At least for customers with Windows XP. Not tested with others.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you need to do so that the user, after connecting to VPN, could use the server colocation as a default gateway that is accessed through the Internet. Even if you already have a default gateway. The problem that arises here is: how to make sure that after installing the default gateway, encapsulated in the&#8230; <\/p>\n<div class=\"clear\"><\/div>\n<p><a href=\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\" class=\"gdlr-button small excerpt-read-more\">Read More<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[69],"tags":[227,200,228,229],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.9.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpenVPN To Access The Internet<\/title>\n<meta name=\"description\" content=\"KB about OpenVPN To Access The Internet including how to automatically adjust routing as expected through redirect-gateway.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenVPN To Access The Internet\" \/>\n<meta property=\"og:description\" content=\"KB about OpenVPN To Access The Internet including how to automatically adjust routing as expected through redirect-gateway.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\" \/>\n<meta property=\"og:site_name\" content=\"ESDS Official Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ESDSdc\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-23T10:27:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-06-22T11:25:12+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/02\/openvpn-logo.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ESDSDataCenter\" \/>\n<meta name=\"twitter:site\" content=\"@ESDSDataCenter\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#website\",\"url\":\"https:\/\/www.esds.co.in\/kb\/\",\"name\":\"ESDS Official Knowledgebase\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.esds.co.in\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/www.esds.co.in\/kb\/wp-content\/uploads\/2011\/02\/openvpn-logo.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/#webpage\",\"url\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\",\"name\":\"OpenVPN To Access The Internet\",\"isPartOf\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/#primaryimage\"},\"datePublished\":\"2011-02-23T10:27:51+00:00\",\"dateModified\":\"2015-06-22T11:25:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/#\/schema\/person\/d951a1b6843822458f3c5f5ee02a74e8\"},\"description\":\"KB about OpenVPN To Access The Internet including how to automatically adjust routing as expected through redirect-gateway.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/\",\"url\":\"https:\/\/www.esds.co.in\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\",\"url\":\"https:\/\/www.esds.co.in\/kb\/openvpn-to-access-the-internet\/\",\"name\":\"OpenVPN To Access The Internet\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#\/schema\/person\/d951a1b6843822458f3c5f5ee02a74e8\",\"name\":\"ESDS ADMIN\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.esds.co.in\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5618393df3c15e5b6b3b9ef917e83827?s=96&d=mm&r=g\",\"caption\":\"ESDS ADMIN\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/565"}],"collection":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":10,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":2827,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/posts\/565\/revisions\/2827"}],"wp:attachment":[{"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esds.co.in\/kb\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}