Koozali.org: home of the SME Server

Configuring DynDns with ADSL Router

Jon R

Configuring DynDns with ADSL Router
« on: December 10, 2003, 11:39:07 AM »
I've set up my e-smith in Server-Gateway mode connecting to the Internet over an ADSL link without static IP.  The server connects via the external ethernet card to a router.

I have set up dynamic DNS using the standard DynDns.org setup in 5.6 and all is well.  However, if the router is ever reset, it gains a new external IP address.  How does the e-smith know this & so update the DynDns entry?

The router I have doesn't have DynDns support built in.  The server is configured to use a Fixed IP address on the external interface, with an IP of 10.0.0.2.  The router is then 10.0.0.1.  Is this the correct config for using DynDns?

How can I ensure that the DynDns entry is updated each time the router is reset and gains a new external IP address?

Thanks

Alexander Ziemann

Re: Configuring DynDns with ADSL Router
« Reply #1 on: December 10, 2003, 06:49:47 PM »
Hi Jon,

Jon R wrote:

> connects via the external ethernet card to a router.

This is a real mistake. You should for several reasons directly connect the external NIC of your e-smith directly to the ADSL-Modem/Splitter.

E-Smith is better than any normal harware-router in the < 250 $ range and the dyn-dns function will only work properly, when the e-smith box is directly connected to internet.
 
> it gains a new external IP address.  How does the e-smith know
> this & so update the DynDns entry?

There are some tools to accomplish this, but they do not always work as they should. Believe me: Better stop hassle and connect your e-smith box directly.

az

[%sig%]

Dave

Re: Configuring DynDns with ADSL Router
« Reply #2 on: December 11, 2003, 02:11:36 AM »
Alexander Ziemann wrote:

> E-Smith is better than any normal harware-router in the < 250
> $ range

I'd place it a little higher. A Cisco 1600 series has barely more functionality than an e-smith box.

Jon R

Re: Configuring DynDns with ADSL Router
« Reply #3 on: December 12, 2003, 01:08:04 PM »
Thanks for your comments & after some more digging I've come to the following conclusions.  I know they're only answering a question that I raised myself & so may be of no interest to anyone else - but just in case anyone faces the same issues I did - here they are:

I can see the advantage of using the e-smith as the router, but there are some practical considerations.  Chearper ADSL modems are mostly USB or PCI, which raises a whole bunch of support issues.

You can get ethernet ADSL modems, but these are not so widely available as most manufacturers offer ADSL Modem / router combinations.  So its often cheaper and easier to buy an ADSL modem / router than just a modem alone.

Off course you can buy ethernet ADSL modems but you have to look around and so choice is more restricted.  Personally I also like having a four port router at the gateway, even if its normally only the e-smith connected to it, as it does give the option of connecting another machine to the router for testing by simulating remote access to the e-smith without having to find a telephone line & dial out.  It also means that if I need Internet access on a client site with my laptop I can connect directly to a free port on the router without having to worry about logging into their internal network.

I have used a combination of routers successfully with e-smith installs.  The Netgear and D-Link routers offer a DMZ option, which basically just forwards all traffic to an internal IP address, unless other rules have been created.  This seems to work fine, especially if you have a fixed IP address.

The only issues with this setup arises when using Dynamic IP, as the e-smith can't tell when the router is reset and so changes its IP address.  There appear to be 2 ways to resolve this, that I can see.

(1) Use a router (e.g. Netgear) that supports DynDns as part of its config.  The Netgear DG814 does this, although only basic functionality (note - early firmware versions of this router caused errors with PPTP dial-in, so upgrade to latest firmware).

(2) use some software based client to update DynDns.  These clients can use an external website to check your current IP and then update DynDns if needed.  There is an addon called DDClient for the e-smith, but I must confess at first glance it looked a little complicated to install (so didn't bother).

Instead I donloaded a windows client version from the DynDns website as the site I was installing had an MS server alongside the e-smith.  I ran the client on the windows machine and all was well.  (Check these forums for comments on the DDClient - many have got it working, I just didn't bother because I didn't have to)

Hope that's of interest to some other poor sole in the future.

Rick Jones

Re: Configuring DynDns with ADSL Router
« Reply #4 on: December 13, 2003, 04:59:00 PM »
Before I put an ADSL card in my e-smith box I had exactly this setup, and I did some tweaks to the e-smith scripts to update dyndns.org. These are the fixes, if they might be of some use.

1. I dropped a simple PHP script on my external web host to report my IP address (I think there are public ones you can use, but this was easy anyway). The script is:
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
if (!$ip)
   $ip = $_SERVER['REMOTE_ADDR'];
echo $ip;
?>
(The first line takes care of your ISP using a transparent proxy, as mine does)

2. I tweaked /sbin/e-smith/dynamic-dns/dyndns.org to call this URL and decide whether an update was needed. I've put the modded version at www.activeservice.co.uk/files/dyndns.org.
(e-smith needs to be already configured to use dyndns.org as dynamic DNS provider)

3. I added scripts to cron.hourly and cron.monthly.

In cron.hourly:
#! /bin/bash
exec /etc/e-smith/events/actions/update-dns - -

In cron.monthly:
#! /bin/bash
exec /etc/e-smith/events/actions/update-dns - x

The monthly one does an unconditional update, since dyndns may drop the account if it's never updated (my connection did last for more than 30 days once - only once!)

HTH
Rick

Jon R

Re: Configuring DynDns with ADSL Router
« Reply #5 on: December 15, 2003, 10:22:25 AM »
Rick,

Thanks for this.  I'll give it a try as its looks a better solution than I am currently using.

Cheers
 Jon R

Rick Jones

Re: Configuring DynDns with ADSL Router
« Reply #6 on: December 15, 2003, 12:15:36 PM »
Hope it works for you!

This obviously may take up to an hour after a re-connect to update the dyndns, but if you've done a deliberate re-connect you can just run the cron.hourly script off the command line to do it immediately. I actually put a PHP script on the e-smith server that called it so I could invoke an update from a browser.

Cheers
Rick

Eduardo Rivero

Re: Configuring DynDns with ADSL Router
« Reply #7 on: December 16, 2003, 02:26:47 AM »
Try with "I´m behind a proxy or firewall and point it to 10.0.0.1

Jon Blakely

Re: Configuring DynDns with ADSL Router
« Reply #8 on: December 16, 2003, 11:58:53 AM »
Check out a script called ipcheck.py  http://ipcheck.sourceforge.net/
I have used it for several years now and on different versions of sme. If you have a ADSL router that supports SNMP then you may be lucky and find that ipcheck already supports it. You also have the option of using the web based checkip.dyndns.org. I used to run ipcheck every 5 minutes. It only updates dyndns.org when your ip changes so you wont get banned for updating to often.

The other option is to get an ADSL router that has a half-bridge option. In this option the external ip address from the isp is forwarded via the built in dhcp server to the lan side and hence to your external eth port on your SME.

Jon

Arne

Re: Configuring DynDns with ADSL Router
« Reply #9 on: December 18, 2003, 03:07:52 AM »
I believe that the e-smith do not support all kind of adsl connections. Guess it will support pppoe but not pppoa (??!!)

I am using a e-smith on the inside of a pppoa router (If I coult connect directly with the e-smit, I think I would have done that, but I think it is not possible.)

I also use a dynamic dns other than dyndns.org The way I am solving the uptdate problem is by using a 1 time pr hour cron job. Of course it is a bit slowly, but for me it works ok.

Rick Jones

Re: Configuring DynDns with ADSL Router
« Reply #10 on: December 18, 2003, 10:52:39 AM »
You can in fact run PPPoA directly from SME. I'm doing just that using a PCI ADSL card. It's a Pulsar from Traverse (www.traverse.com.au).

It took me a while to optimise the configuration, I've ended up treating it like a dialup device under control of diald. The only mods to the system are one driver object file and a change to diald.conf.

I also have automatic updating of dynamic DNS on ZoneEdit.

I previously used a router, but switched to this setup and find it much better.

Let me know if you'd like more info.

Rick

rob wellesley

Re: Configuring DynDns with ADSL Router
« Reply #11 on: January 15, 2004, 12:46:22 AM »
Rick Jones wrote:
>
> Let me know if you'd like more info.
>

Hi rick

Can you offer any help re compiling/installing drivers?

also - what version of SME have you installed on?

cheers - rob

Doug M.

Re: Configuring DynDns with ADSL Router
« Reply #12 on: January 15, 2004, 08:06:46 AM »
I prefer ddclient for updating the dyndns settings.

http://summersoft.fay.ar.us/pub/linux/redhat/RPMS/i386/ddclient-2.3-2.i386.rpm

Rick Jones

Re: Configuring DynDns with ADSL Router
« Reply #13 on: January 15, 2004, 11:01:11 AM »
rob wellesley wrote:

> Can you offer any help re compiling/installing drivers?
>
> also - what version of SME have you installed on?

I'm no expert on Linux drivers, apart from basic use of insmod, modprobe etc.

However, the driver for the Pulsar can be compiled online for any variant of Linux 2.4. I've generated driver objects for SME 5.6 & 6.0, if you want the complete setup for the Pulsar I can let you have it (when I get a moment I'll make it available as a donwload :).

I'm currently running 5.6, but I have 6.0 on a test box and I shall upgrade the live machine once I'm comfortable.

If you're thinking of a driver for any other brand of ADSL card I'm afraid I can't help. I know of one other that has Linux drivers, but I haven't tried it - sorry!

Cheers
Rick

Rick Jones

Re: Configuring DynDns with ADSL Router
« Reply #14 on: January 15, 2004, 11:04:55 AM »
Doug M. wrote:

> I prefer ddclient for updating the dyndns settings.

I did have a look at ddclient when I was using a router, and it definitely does the job, but once I switched to a direct ADSL link I found that SME's hooks work so well it's easier to let SME get on with it!

It just does the update immediately on the ip-up event, and that's all.

Cheers