View Single Post
  #1   (View Single Post)  
Old 16th October 2014
denriktiga denriktiga is offline
New User
 
Join Date: Oct 2014
Posts: 6
Default Trouble with Dynamic DNS using powerDNS and dhcpd

I'm back again with another migrating from ubuntu to OBSD question.

On ubuntu I use this config to achive Dynamic DNS with powerDNS.

The second code segment is what enables me to update the dns:

Code:
allow booting;
allow bootp;
ddns-update-style none;
log-facility local7;
default-lease-time -1;
max-lease-time 7200;
authoritative;
option space gpxe;
option gpxe-encap-opts code 175 = encapsulate gpxe;
option gpxe.bus-id code 177 = string;


Code:
on commit {
                set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
                set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
                log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", option host-name));
                execute("/tda/dhcp-event", "commit", ClientIP, ClientMac, option host-name);
}

on release {
                set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
                set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
                log(concat("Release: IP: ", ClientIP, " Mac: ", ClientMac));
                execute("/tda/dhcp-event", "release", ClientIP, ClientMac, "1");
                #log(concat("Release: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", option host-name/host-decl-name));
}

on expiry {
                set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
                set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
                log(concat("Expiry: IP: ", ClientIP, " Mac: ", ClientMac));
                #log(concat("Expiry: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", option host-name/host-decl-name));
                execute("/tda/dhcp-event", "expiry", ClientIP, ClientMac, "1");
                #execute("/usr/local/bin/dhcp-event", "expiry", ClientIP, ClientMac, option host-name);
}
subnet 192.168.0.0 netmask 255.255.255.0 { use-host-decl-names on; range 192.168.0.2 192.168.0.254; option routers 192.168.0.1; option broadcast-address 192.168.0.255; option root-path "192.168.0.252:/data/tftpboot/gpxe"; next-server 192.168.0.252; option domain-name-servers 192.168.0.1; option domain-name "tda.local"; if not exists gpxe.bus-id { filename "gpxe/undionly.kpxe"; } else { filename "http://172.16.0.30/boot.php"; # filename "gpxe/menu.gpxe"; # filename "gpxe/pxelinux.0"; } server-name "fw"; server-identifier 192.168.1.1; }
Adding this code to /etc/dhcpd.conf on OBSD

Code:
on commit {
                set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
                set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
                log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", option host-name));
                execute("/tda/dhcp-event", "commit", ClientIP, ClientMac, option host-name);
}
Generates this error:


Code:
Oct 16 19:12:56 kloster-14-cj-fw dhcpd[16622]: /etc/dhcpd.conf line 12: expecting a parameter or declaration.
Oct 16 19:12:56 kloster-14-cj-fw dhcpd[16622]: on
Oct 16 19:12:56 kloster-14-cj-fw dhcpd[16622]: ^
Oct 16 19:12:56 kloster-14-cj-fw dhcpd[16622]: Configuration file errors encountered
Oct 16 19:12:56 kloster-14-cj-fw dhcpd[16622]: exiting.
I have not found anything useful on google. I really have no idea what to do.

Thank you in advance!
Reply With Quote