{"id":188,"date":"2014-06-16T16:17:19","date_gmt":"2014-06-16T14:17:19","guid":{"rendered":"http:\/\/greentreesystems.wordpress.com\/?p=188"},"modified":"2022-01-21T17:04:27","modified_gmt":"2022-01-21T15:04:27","slug":"supporting-on-machines-on-an-adsl-line-nat-without-port-forwarding","status":"publish","type":"post","link":"https:\/\/greentree.systems\/?p=188","title":{"rendered":"Providing support on machines via an ADSL line (NAT) without port forwarding"},"content":{"rendered":"<p>We have often had the need to access client machines that are connected via an ADSL or other consumer type connections, but that typically requires the following to be done.<\/p>\n<ol>\n<li>Setup a dynamic DNS client (e.g. <a title=\"ddclient\" href=\"http:\/\/sourceforge.net\/p\/ddclient\/wiki\/Home\/\" target=\"_blank\" rel=\"noopener noreferrer\">ddclient<\/a>) on a machine inside the network to update the ddns address of the host whenever the IP address of the router on the client site changes.&nbsp; See the <a href=\"#ADSLnote\">note about ADSL in South Africa<\/a>.&nbsp; For instance<em> muncher.clientsite.co.za<\/em> could be updated by ddclient if the machine is running Linux. This could be the same machine that will be made accessible from outside the network (which is always a better idea than having this a windows since it will be accessible from the internet).<\/li>\n<li>Setup a port forward on the ADSL router for the port that you wish to access from an outside machine.&nbsp; To access a web service on an machine behind an ADSL router, set up port 80 to forward to internal IP (e.g. 192.168.1.10) port 80.&nbsp; Of course, it is entirely feasible to set up port 88 to translate to 192.168.10:80 as well.&nbsp; It makes a lot of sense to forward port 22 to this the machine, since ssh is secure and setting up a tunnel allows other services to be used as well via this port.<\/li>\n<\/ol>\n<p>The above is totally in order if the machine that is set up internally is properly secured.&nbsp; Using ssh to connect to the server with a password is however potentially a weak link, since the only thing between a hacker and access to the machine is a password. There are better ways to make a secure connection.<\/p>\n<p>Using digital keys allows the connection to be made only from machines that have the key, provided we&#8217;re seeking ssh access.&nbsp; If we want to access a database or webservice or another insecure service, making a persistent connection from inside to a designated server outside provides a very good and safe connection without any of the disadvantages of the above mentioned options.<\/p>\n<p><a title=\"presistent reverse tunnel\" href=\"https:\/\/raymii.org\/s\/tutorials\/Autossh_persistent_tunnels.html\" target=\"_blank\" rel=\"noopener noreferrer\">AutoSSH persistent tunnels<\/a> provide a great way to achieve this.&nbsp; It doesn&#8217;t require a ddns client or port forwarding to deal with the NAT.&nbsp; The connection is established automatically when the inside machine starts.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a name=\"ADSLnote\"><\/a><strong><em>Note about ADSL in South Africa (and possible elsewhere)<\/em><\/strong><\/p>\n<p>In South Africa all ADSL connections are essentially from Telkom despite other ISPs reselling them.&nbsp; Telkom changes the IP address every 24 hours in a crude attempt to prevent self-hosting on inhouse servers via relatively low cost ADSL services.&nbsp; Using DDNS to fix this works well, except that for about 5 minutes per day when the update happens the potential is there to have the DNS still pointing at the old address (which has now been assigned to a new client) and any connection then routing to a different server than the intended one.&nbsp; The place where this can potentially cause real trouble is if both the &#8220;old&#8221; client and the &#8220;new&#8221; one are running an email server and emails are delivered to the wrong server, which will probably bounce the messages back to the sender.<\/p>\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have often had the need to access client machines that are connected via an ADSL or other consumer type connections, but that typically requires the following to be done. Setup a dynamic DNS client (e.g. ddclient) on a machine inside the network to update the ddns address of the host whenever the IP address [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_glsr_average":0,"_glsr_ranking":0,"_glsr_reviews":0,"wds_primary_category":0,"footnotes":""},"categories":[2],"tags":[8,11,12,19,21],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-client-support","tag-adsl","tag-ddclient","tag-ddns","tag-reverse-tunneling","tag-ssh"],"_links":{"self":[{"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/greentree.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=188"}],"version-history":[{"count":3,"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":465,"href":"https:\/\/greentree.systems\/index.php?rest_route=\/wp\/v2\/posts\/188\/revisions\/465"}],"wp:attachment":[{"href":"https:\/\/greentree.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greentree.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greentree.systems\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}