{"id":1312,"date":"2014-07-20T11:17:55","date_gmt":"2014-07-20T15:17:55","guid":{"rendered":"http:\/\/deridder.ca\/blog\/?p=1312"},"modified":"2014-07-20T11:22:54","modified_gmt":"2014-07-20T15:22:54","slug":"external-access-to-my-home-pc","status":"publish","type":"post","link":"https:\/\/deridder.ca\/blog\/?p=1312","title":{"rendered":"External access to my home PC"},"content":{"rendered":"<p>So I&#8217;ve never bothered to get a static IP address from my ISP.. this makes it a bit of a challenge when wanting to access files from work, that are sitting on my home pc.<\/p>\n<p>However.. I do have a website hosted elsewhere..<br \/>\nSo what I have done (actually for about 15 years now).. is run a little scheduled task on my home PC, that obtains it&#8217;s IP address, creates a little web page, and FTPs that page to the website.  Then, I can access the website and link to my home PC.  The odd time I want to make a slight change to this, I have to relearn what I&#8217;ve done.. So I&#8217;m writing it up here finally&#8230;in case I actually remember to check here \ud83d\ude09<\/p>\n<p>Its changed a little over the years.. pending my ISP, and changes to how I connect to them.  These days I have a router connected to them.. So my home PC never actually gets the external IP address assigned.<\/p>\n<p>SO.. it takes a mapping in my router to forward the requests to the static LAN IP, and it also take a little trick to find out what the external IP address is..<\/p>\n<p>Here is the script I use to do that:<\/p>\n<p><code>set &quot;header=^&lt;head^&gt;^&lt;body^&gt;^&lt;a href=http:\/\/&quot;<br \/>\nset &quot;footer=^&gt;my place^&lt;\/a^&gt; update at: %DATE% %TIME% ^&lt;\/body^&gt;^&lt;\/head^&gt;&quot;<\/p>\n<p>FOR \/F &quot;tokens=1 delims=&quot; %%A in (&#39;call wget -q -O - http:\/\/myexternalip.com\/raw&#39;) do SET ip=%%A <\/p>\n<p>echo.%header%%ip%%footer% &gt; linkhome.html <\/p>\n<p>FTP -v -i -s:ftpscript.txt<br \/>\n<\/code><br \/>\nThe website I use has changed a couple times (they seem to come and go).. but this one is working great right now (myexternalip.com).<br \/>\nI also use wget, which is just a handy thing to obtain websites as a file for parsing.<\/p>\n<p>The only other thing is serving it up.  For this, I use Apache.  I set it up to have an alias to the folder I want to allow access to, and enforce authentication based on a specific local user.<\/p>\n<p>The funny thing is that trying to access it within my LAN (ie. from my other PC), won&#8217;t work using the external IP address.. (it will if I just use the local machine name \/ lan ip address).. but it works fine when coming externally.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;ve never bothered to get a static IP address from my ISP.. this makes it a bit of a challenge when wanting to access files from work, that are sitting on my home pc. However.. I do have a &hellip; <a href=\"https:\/\/deridder.ca\/blog\/?p=1312\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"class_list":["post-1312","post","type-post","status-publish","format-standard","hentry","category-techie"],"_links":{"self":[{"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1312"}],"version-history":[{"count":4,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1312\/revisions"}],"predecessor-version":[{"id":1314,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1312\/revisions\/1314"}],"wp:attachment":[{"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deridder.ca\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}