Author Topic: DDNS issues where client has two interfaces (wired & wireless)  (Read 3965 times)

andyp

  • Zen Apprentice
  • *
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Hi all,

I have just enabled DDNS on Zentyal 2.2 for my two LANs:

192.168.0.0/24
192.168.111.0/24

Everything works well except when someone disconnects from the wifi on 192.168.0.0/24 and reconnects to the wired network on 192.168.111.0/24.  This results in a lot of error messages like:

Code: [Select]
Mar 14 12:57:58 kgeorge dhcpd: DHCPACK to 192.168.111.14 (00:24:8c:7b:5f:0b) via eth2
Mar 14 13:01:23 kgeorge dhcpd: DHCPREQUEST for 192.168.111.11 from 00:25:64:7d:70:d1 (Andy-Laptop) via eth2
Mar 14 13:01:23 kgeorge dhcpd: DHCPACK on 192.168.111.11 to 00:25:64:7d:70:d1 (Andy-Laptop) via eth2
Mar 14 13:04:01 kgeorge dhcpd: DHCPREQUEST for 192.168.111.14 from 00:24:8c:7b:5f:0b (Andy-Desktop) via eth2
Mar 14 13:04:01 kgeorge dhcpd: DHCPACK on 192.168.111.14 to 00:24:8c:7b:5f:0b (Andy-Desktop) via eth2
Mar 14 13:05:45 kgeorge dhcpd: DHCPDISCOVER from 90:4c:e5:45:22:01 via eth0
Mar 14 13:05:46 kgeorge dhcpd: DHCPOFFER on 192.168.0.2 to 90:4c:e5:45:22:01 (Andy-Laptop) via eth0
Mar 14 13:05:46 kgeorge named[10571]: client 127.0.0.1#42065: updating zone 'brocas.oit/IN': update unsuccessful: Andy-Laptop.brocas.oit: 'name not in use' prerequisite not satisfied (YXDOMAIN)
Mar 14 13:05:46 kgeorge named[10571]: client 127.0.0.1#51922: updating zone 'brocas.oit/IN': update unsuccessful: Andy-Laptop.brocas.oit/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (NXRRSET)
Mar 14 13:05:46 kgeorge dhcpd: Forward map from Andy-Laptop.brocas.oit. to 192.168.0.2 FAILED: Has an A record but no DHCID, not mine.
Mar 14 13:05:46 kgeorge dhcpd: DHCPREQUEST for 192.168.0.2 (192.168.0.254) from 90:4c:e5:45:22:01 (Andy-Laptop) via eth0
Mar 14 13:05:46 kgeorge dhcpd: DHCPACK on 192.168.0.2 to 90:4c:e5:45:22:01 (Andy-Laptop) via eth0
Mar 14 13:05:50 kgeorge dhcpd: DHCPINFORM from 192.168.0.2 via eth0
Mar 14 13:05:50 kgeorge dhcpd: DHCPACK to 192.168.0.2 (90:4c:e5:45:22:01) via eth0

Does anyone have any suggestions?  Surely this is not a very unusual situation?

I wanted to try the suggestion made in the below article where they change the ddns-hostname to append "-wifi" to the name of all the hosts on a particular network (192.168.0.0/24).

http://www.techswamp.com/2011/06/20/working-around-binds-ddns-limits-for-multi-homed-hosts/

According to your documentation customising configuration scripts is supposed to be easy - so I thought I'd give it a go.  However, I have no idea how to make that simple change to a section of the template that looks like this:

Code: [Select]
<%perl>
        foreach my $iface (keys(%real_ifaces)) {
           # Write configuration if there are any range or fixed addresses
           my @ifacesToCheck = @{$real_ifaces{$iface}};
           push(@ifacesToCheck, $iface);
           my $nIfaceToWrite = grep { @{$ifaces{$_}->{ranges}} > 0 or values(%{$ifaces{$_}->{fixed}}) > 0 } @ifacesToCheck;
           if ( $nIfaceToWrite > 0) {
</%perl>
<& dhcp/shared-network.mas, iface => $iface, ifaces => \%ifaces, vifaces => $real_ifaces{$iface} &>
%          }
%       }

I would really appreciate anyone's help here.  Either to make this minor change or to suggest a better way to overcome the problem.

Cheers,
Andy
« Last Edit: March 22, 2012, 05:53:00 pm by jjmontes »

andyp

  • Zen Apprentice
  • *
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: DDNS issues where client has two interfaces (wired & wireless)
« Reply #1 on: March 19, 2012, 11:08:49 am »
Any ideas?

andyp

  • Zen Apprentice
  • *
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: DDNS issues where client has two interfaces (wired & wireless)
« Reply #2 on: March 20, 2012, 12:16:15 pm »
Seriously, no one here can help?  Just in case its was not clear I shall try once more...

I simply want to make the below change (shown in bold below) to the dhcpd.conf file.  Is it possible with Zentyal?

==============================================
/etc/dhcpd.conf:

shared-network eth0 {

        subnet 192.168.0.0 netmask 255.255.255.0 {

            option routers 192.168.0.254;
                option domain-name "brocas.oit";
            option domain-name-servers 192.168.0.254, 192.168.111.105;
                option ntp-servers 192.168.0.254;
                default-lease-time 1800;
                max-lease-time 7200;

                option host-name = config-option server.ddns-hostname;
                ddns-hostname = pick-first-value( option fqdn.hostname,
                                                  option host-name,
                                                  concat("dhcp-", binary-to-ascii(10, 8, "-", leased-address), "-wifi"));
                ddns-domainname      "brocas.oit.";
                zone brocas.oit. {
                    primary 127.0.0.1;
                    key brocas.oit.;
                }
                zone 0.168.192.in-addr.arpa. {
                    primary 127.0.0.1;
                    key brocas.oit.;
                }

            pool {
                range 192.168.0.1 192.168.0.30;
            }
        }
==============================================

Thanks in advance.

andyp

  • Zen Apprentice
  • *
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: DDNS issues where client has two interfaces (wired & wireless)
« Reply #3 on: March 22, 2012, 01:56:13 pm »
I guess the customisation of dhcpd.conf is not possible then?  It's certainly not easy unless maybe if you happen to be a Perl developer.  Cheers community for all your help!

Back to SBS 2011 with either ClearOS, Endian or IPCop for me!

jjmontes

  • Zentyal Staff
  • Zen Monk
  • *****
  • Posts: 86
  • Karma: +8/-0
    • View Profile
Re: DDNS issues where client has two interfaces (wired & wireless)
« Reply #4 on: March 22, 2012, 05:36:14 pm »
The file you have too look at is not 'dhcpd.conf.mas', but 'subnet.mas'. You can write it to "/etc/zentyal/stubs/dhcp/subnet.mas" so it replaces the normal template.

I am not convinced about the resolution to your exact problem, though. Let everybody know if you manage to fix this please.

Remember that you can always replace the full file (dhcpd.conf.mas) with your own configuration if you don't manage to fix the template logic, so you are free to override the service settings, starting from a semi-working configuration, for example. As usual, it's preferable to do this in the appropriate /etc/zentyal/stubs/ subdirectory.

Regards!