<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Prashanth Ellina &#187; networking</title>
	<atom:link href="http://blog.prashanthellina.com/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.prashanthellina.com</link>
	<description>In Pursuit of Truth</description>
	<lastBuildDate>Sun, 28 Nov 2010 09:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Accessing your home computer from the internet</title>
		<link>http://blog.prashanthellina.com/2007/12/10/accessing-your-home-computer-from-the-internet/</link>
		<comments>http://blog.prashanthellina.com/2007/12/10/accessing-your-home-computer-from-the-internet/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 17:15:22 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[networking]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dynamic dns]]></category>
		<category><![CDATA[dyndns]]></category>
		<category><![CDATA[openssh]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/12/10/accessing-your-home-computer-from-the-internet/</guid>
		<description><![CDATA[I recently bought a computer to use at home for development. Sometimes I have to access stuff (code, pictures, bittorrent) on my machine when I am away from home. I keep my machine running all the time and recently upgraded my internet connection from 128 kbps to 512 kbps. If you are in Bangalore, India, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/networking.jpg" alt="networking" align="left"/>I recently <a href="/2007/11/27/building-a-low-cost-bad-ass-server-machine/">bought a computer</a> to use at home for development. Sometimes I have to access stuff (code, pictures, bittorrent) on my machine when I am away from home. I keep my machine running all the time and recently upgraded my internet connection from 128 kbps to 512 kbps. If you are in Bangalore, India, Airtel offers unlimited bandwidth at 512 kbps for Rs 1499 ($38) a month.</p>
<p>Since I had the essentials in place, I started setting up things to make my machine accessible from anywhere. These are the goals I had in mind.</p>
<ol>
<li>A domain name &#8211; to access my machine without having to remember an ip</li>
<li>ssh access &#8211; so I could login and muck around</li>
<li>http access &#8211; so I could host a mini-site with photos etcetera</li>
</ol>
<h3>How do I manage with a dynamic ip?</h3>
<p>The problem with having an ADSL connection provided by Airtel (and most other internet service providers) is that the ip changes every time you reboot the modem. This is quite a pain even if you can keep your modem turned on all the time. My initial plan was to set up a script on my machine which would ping my website every once in a while to update the ip address. With this I could visit a special page on my website which would list the latest ip address of my home machine.</p>
<h4>Dynamic DNS</h4>
<p><img src="http://www.prashanthellina.com/images/dyndns.png" alt="dyndns.org" align="right"/>I was about to implement this when I came across <strong><a href="http://en.wikipedia.org/wiki/Dynamic_DNS">Dynamic DNS</a></strong>. Dynamic DNS is a mechanism similar in some sense to the one I described above. Basically, your ADSL modem connects to a DNS server every time it gets a new ip and registers it. The DNS server is configured to resolve a domain name to this ip when a DNS request comes in from anywhere on the internet. This is a wonderful solution because most ADSL modems come with this functionality built into the firmware (my Beetel 220BX does too).</p>
<p>To get started, you will have to register an account with one of the Dynamic DNS service providers. <a href="https://www.dyndns.com/">DynDns.org</a>, <a href="http://www.tzo.com/">TZO</a>, <a href="http://www.no-ip.com/">No-IP</a> are the popular players. You can find a comprehensive listing <strong><a href="http://www.technopagan.org/dynamic/">here</a></strong>. I chose <a href="https://www.dyndns.com/">DynDNS.org</a>. After you create an account, goto &#8220;Host services&#8221; and select &#8220;Add new Hostname&#8221;. Choose a sub-domain and domain here and click on &#8220;Create Host&#8221;.</p>
<p>Now you will have to configure your modem/router with this information. Your modem&#8217;s web interface will usually be 192.168.0.1 or 192.168.1.1. In case you have a Beetel modem, open IP_ADDRESS/main.html (eg: http://192.168.1.1/main.html). Here choose DNS > Dynamic DNS and fill in the details as shown (username and password are your Dyndns account details). Save the settings and you are done!</p>
<p>You should be able to access the web admin page of your modem using you DynDNS domain name (for me using the domain from my home network does not work for some reason, but I can access from outside).</p>
<h3>Getting SSH access working</h3>
<p>I am assuming that your computer is directly connected to the ADSL modem. You will have to install an ssh server. I have Ubuntu installed, so I installed OpenSSH server.</p>
<pre lang="BASH">
sudo apt-get install openssh-server openssh-client
</pre>
<p>Now that the SSH server is running, you have to allow access to this port through your modem from the internet. By default all incoming connections except 80 and a couple of others are blocked on my modem (as is the case with most modems). You have to tell your modem to allow access to port 22 and also to forward requests coming to your ip at 22 port to port 22 of your computer. Here is how you do it.</p>
<p>First configure the firewall on the model to let through connections to port 22. Goto the web admin page of the modem and navigate to Advanced Setup > Security > IP filtering > Incoming. Click on the &#8220;Add&#8221; button and set filter name to &#8220;ssh&#8221; and destination port to 22. &#8220;Save/Apply&#8221; now.</p>
<p>At this stage, incoming ssh requests are allowed but there is no ssh server available on the modem to handle them, so we must tell it to forward these requests to your computer where the server is setup. Navigate to Advanced Setup > NAT > Virtual Server. Click on &#8220;Add&#8221; here. Select &#8220;Custom server&#8221; and type &#8220;ssh&#8221;. In the server ip address provide the ip address of you computer. You will see a row of input boxes below for port numbers. Fill all the boxes in the first row with 22. For protocol choose &#8220;TCP/UDP&#8221;. Click &#8220;Save/Apply&#8221;. You are done. All ssh requests will now be forwarded to the ssh server running on your computer.</p>
<p><img src="http://www.prashanthellina.com/images/adsl_login.png" alt="modem web admin login"/><br />
<strong><small>Login box for ADSL modem web admin page</small></strong><br />
<br/></p>
<p><img src="http://www.prashanthellina.com/images/dyndns_host_add.png" alt="adding host to dyndns account"/><br />
<strong><small>Adding a host in DynDns.org account</small></strong><br />
<br/></p>
<p><img src="http://www.prashanthellina.com/images/modem_dyndns_setup.png" alt="modem dyndns setup"/><br />
<strong><small>Setting up Dynamic DNS on the modem</small></strong><br />
<br/></p>
<p><img src="http://www.prashanthellina.com/images/ssh_port_forwarding.png" alt="SSH port forwarding modem setup"/><br />
<strong><small>Port forwarding for SSH</small></strong><br />
<br/></p>
<h3> Setting up HTTP access </h3>
<p>You will need a web server on your computer. If you have Ubuntu, it is straight-forward to set up Apache.</p>
<pre lang="BASH">
sudo apt-get install apache2
</pre>
<p><img src="http://www.prashanthellina.com/images/apache_feather.png" alt="apache" align="left" width="30%"/><br />
You can customize the web site now by editing files in /var/www. Now you have allow access to the web server from the internet. The issue here is that port 80 which is the default port for http is used by the web admin page for the modem. So we have to settle for some other port. I chose 8080. Follow the steps for ssh (replacing 21 by 8080), but in the port forwarding step, set destination ip to 80 instead of 8080. This should get things working.</p>
<h3> You are now on the internet, Baby!</h3>
<p>You can now access you machine using ssh at your-sub-domain.dyndns.org and visit you personal webpage at http://your-sub-domain.dyndns.org:8080. Enjoy!</p>
<h3> Additional links </h3>
<ul>
<li><a href="http://vinuthomas.com/Forums/viewtopic/p=74539.html">http://vinuthomas.com/Forums/viewtopic/p=74539.html</a></li>
<li><a href="http://broadbandforum.in/dial-up/2697-how-keep-my-ip-constant">http://broadbandforum.in/dial-up/2697-how-keep-my-ip-constant</a>/</li>
<li><a href="http://en.wikipedia.org/wiki/Dynamic_DNS">http://en.wikipedia.org/wiki/Dynamic_DNS</a></li>
</ul>
<p><center><img src="http://www.prashanthellina.com/images/network.jpg" alt="on the internet"/></center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/12/10/accessing-your-home-computer-from-the-internet/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

