Specifying an Alternate Wan address for dyndns



  • My current setup contains two WAN interfaces.  I'm using the second as failover incase the primary goes down (business environment with VoIP and asterisk).  I've found it useful to be able to connect in situations when the primary is down, unfortunately my secondary interface is just a cheap DSL connection with a dynamic IP.  I wanted to use dynamic dns with an alternate interface instead of the normal WAN.  One work around would be to put the secondary connection onto the WAN interface and enable DNS.  I didn't like this idea so I decided to hack around in the source code on the box.  Here's what i came up with.

    I modified the service_dyndns.php to add another field to select an alternate WAN interface (copied code from the load balancer edit section).

    Then i modified the services.inc to lookup the name of this new field and get the IP address.  I also modified the call to updatedns() to include the wan ip.

    I subsituted all the calls to get_wan_ip_address (or whatever it is) and used the internal _dnsWanip instead.

    I also modified all the CURL options to use the desired interface as the outbound connection to use (i use zoneedit so this was required).

    I haven't tested this with all dyndns providers and i need to make sure it works for them all.  However,  I don't want to bother if there is no community interest in this feature.

    If you think this feature is useful, let me know and I'll finish the development and test it against all dyndns providers, then post the necessary patch or put it in the develoeprs mailing list.



  • There is very much interest in this.  Ultimately if you can allow for DynDNS to work on multiple interfaces, that would be swell.



  • Just for completeness.
    1.3 has support for multiple DYNDNS accounts on multiple interfaces. In fact you can even run multiple dydns services on the same interface.

    Ermal


Log in to reply