I was asked recently if the ISP I use provides static (or rather fixed dynamic) IP addresses. My ISP doesn't offer such a service so I rely on one of the many Dynamic DNS services available. This led to a discussion of how to configure a Cisco SOHO router to act as the Dynamic DNS client. I thought I would spare 10 mins and run through the set-up I have and how to get it working.
For the sake of clarity this is what you will need to get this up and running.
- A Cisco router, that supports DDNS configuration. Most SoHo devices do.
- A suitable working ISP service.
- A base configuration so that your router is already up and running on the internet.
- A basic knowledge of how to log in, enter enable mode and configure the router.
- A Dynamic DNS account and associated host name.
Dynamic DNS account configuration.
I won't bore you with the details of this, just head over to Dynamic DNS, set up an account and choose one of the many competitively priced DNS hosting options. I went for the single host for free, but this requires you to log in once every so often to confirm your account is active. Fortunately they send you an email with a link to confirm your account, so it isn't difficult to keep the account active.
Once you have set up your account you will end up with some information we will be using later in the Cisco configuration.
- Account Name
- I've used ddnsAccName
- Account Password
- I've used ddnsPasswd
- Domain Name that you have just chosen
- I've used greatservice.dyndns.org
Obviously the information above is purely fictional.
Cisco Configuration Step 1.
So assuming you have met the pre-requisites, and have the account information to hand the configuration is quiet simple.
Initially we need to define the update method the Cisco will use:
ip ddns update method DynDNS
There are 2 gotchas with the next lines. The first is that you must press CTRL-V immediately prior to typing the "?" in the config lines below. If you don't do this the Cisco will invoke the context sensitive help function with will prevent you from entering the configuration lines. The second, is that although they may be wrapped in your browser, they are in reality just two very long commands, I have separated them out to try and help make it clearer.
Obviously replace the highlighted details with your details where appropriate. Furthermore these commands should immediately follow those already outlined above.
The updates will be triggered by the Cisco when it detects an IP address change, but you should also update periodically to protect against your host being aged out. Update to often though when it isn't required may be considered abusive and can lead to a ban. The settings below are the ones I've been using for over a year with no problems. These should also be configured immediately after the previous commands still within the update method definition.
interval maximum 28 12 0 0
interval minimum 28 0 0 0
Cisco Configuration Step 2.
Once the update method is defined, this just needs to be tied to the interface connected to the internet. In my case here it is ATM0.101, yours may be different but it should be the same commands. It is worth pointing out here that the update command specifying the method needs to match that specified earlier.
interface ATM0.101 point-to-point
description WAN Link to the Internet
ip ddns update hostname greatservice.dyndns.org
ip ddns update DynDNS
ip address dhcp
All the other configuration commands have been omitted to boil this down to the bare minimum required.
Hope this helps someone.