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, Airtel offers unlimited bandwidth at 512 kbps for Rs 1499 ($38) a month.
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.
- A domain name – to access my machine without having to remember an ip
- ssh access – so I could login and muck around
- http access – so I could host a mini-site with photos etcetera
How do I manage with a dynamic ip?
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.
Dynamic DNS
I was about to implement this when I came across Dynamic DNS. 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).
To get started, you will have to register an account with one of the Dynamic DNS service providers. DynDns.org, TZO, No-IP are the popular players. You can find a comprehensive listing here. I chose DynDNS.org. After you create an account, goto “Host services” and select “Add new Hostname”. Choose a sub-domain and domain here and click on “Create Host”.
Now you will have to configure your modem/router with this information. Your modem’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!
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).
Getting SSH access working
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.
sudo apt-get install openssh-server openssh-client
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.
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 “Add” button and set filter name to “ssh” and destination port to 22. “Save/Apply” now.
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 “Add” here. Select “Custom server” and type “ssh”. 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 “TCP/UDP”. Click “Save/Apply”. You are done. All ssh requests will now be forwarded to the ssh server running on your computer.

Login box for ADSL modem web admin page

Adding a host in DynDns.org account

Setting up Dynamic DNS on the modem

Port forwarding for SSH
Setting up HTTP access
You will need a web server on your computer. If you have Ubuntu, it is straight-forward to set up Apache.
sudo apt-get install apache2

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.
You are now on the internet, Baby!
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!
Additional links
- http://vinuthomas.com/Forums/viewtopic/p=74539.html
- http://broadbandforum.in/dial-up/2697-how-keep-my-ip-constant/
- http://en.wikipedia.org/wiki/Dynamic_DNS

Tagged: apache, dynamic dns, dyndns, networking, openssh
2 Trackbacks
[...] problem in Port forwarding in Beetel 220BXI ADSL2 modem-router http://i4.tinypic.com/5y2f8ds.jpg This is for receiving websites. Please post your settings. chek theses setting also. http://i6.tinypic.com/6ur7rd3.jpg and have a look on that Accessing your home computer from the internet | Prashanth Ellina [...]
[...] not working in Beetel 220BXI ADSL2 modem-router) see the blog link for detailed instructions. http://blog.prashanthellina.com/2007…-the-internet/ I came to know about this DDNS menu item. in Beetel quite [...]
23 Comments
The only problem with Dynamic DNS is that DNS propagation is a weird thing and doesn’t happen as quickly as you would like it to at times. It should work fine for your scenario but I was struggling with it in connection to Amazon’s EC2 (which doesnt have any static IPs )
The cache time for DNS entries in case of Dynamic DNS is usually set to a low number. In my case, it is 60 seconds. I’ve not had any problems so far. What was the cache time you configured?
Good Guide! I got tired setting so many steps. so what I had to do was .. grab a software that allows me to access my home computer.. (obviously you need to install the same software again on the other pc.) and had hell loads of issues with them. This guide is simple and good for novice users!
Stumbled it upon..! May be the people who are looking for such could hunt them down
Cheers!
I did this setup because I want to sometimes “push” data into my computer rather than log-in using a software and “pull” data in. Which software are you using?
Prashanth,
I was using RA Admin ( http://www.radmin.com/ ) to access my home computer and well you are right… “push” data is something you have been looking out for and I am sure no-ip should have provided a good service. I did try them before sometime..!
Cheers!
Actually I’m using DynDNS, not No-IP.
nice tute,
which firmware version are you using . as i can`t find any dynamic dns page at dns
Software Version: 3.04L.01.A2pB021c.d16m
Hello Gaurav, You wil not see the dynamic dns options if you use the bridging option to connect to the internet, it should be a pppoe connection.
http://192.168.1.1/main.html
I see. SO how can i switch from bridged to pppoe mode
When I accessed the newly created website from the same machine I was getting the DSL modems web page…
So access the site via a proxy site to verify whether it works…..
Thanks for the tip Xavier. I did the same thing to verify that my connection was working.
Hello,
Thanks for this guide, however, I have been unable to get the damned thing working. The worst part was, I once got it to work, and it no longer does. I wanted to use port 9000 on the external to fwd to ssh at home. My setup is as follows:
IP Filtering>Incoming> Dest Port = 22
Virtual Servers>
External:22-22 Internal 22-22
I still can’t get it to work. Strangely I can get my bittorrent clients to complete a loop using port 6881 etc.
Any ideas?
Jay
i am not able to find dynamic dns option.please help me…
Jay. Nope I don’t know what is wrong. Did you get it to work? If yes, please post. Vamsi, check out Kalyan’s comment above (to Gaurav).
hi my problem is when i type my dyndns address the router page (ut star wa3002g4 mtnl delhi) pops up!
whats to be done here ??
“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.”
can you elaborate this with screenshots im having this problem!!
actually my modem doesnt have an option of destination ip in NAT, it only has start port and end port, ip address and service. what to do? the router page keeps popping up
ok i found the ipfilter settings but it is asking for a lot more than destination port. it wants source ip/port/subnet masks as well…. my apache server is listening on port 80 so let me know whats up!!>?? thnx!
here are some screenshots if u need any http://broadbandforum.in/mtnl-broadband/33045-setting-up-home-web-server/
Hi,
Can u tell me the about relaiblity of dyndns.com?(Downtime and service if i go got my own domain)
If i have wireless net coneection, then how should i configure the dynamic dns in that case? Do u have any idea about it.
Nice writeup.
Sometimes, I do need to access my home machine to get to some much needed files.
I have IIS on my WinXP machine. Do I still need to use an ssh server?
Hi Guys,
We are looking for DYN DNS Service Providers in India. Can any1 help me to get their contact nos. plz.
ANil