DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 6 Days Ago
denriktiga denriktiga is offline
New User
 
Join Date: Oct 2014
Posts: 4
Thanked 0 Times in 0 Posts
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
  #2   (View Single Post)  
Old 6 Days Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

It's not clear to me what you have configured, or what you are trying to achieve.

It looks like you are trying to use ISC dhcpd configuration instructions, such as on commit, which are not in the built-in dhcpd(8), and not described in the dhcpd.conf(5) man page.

As I noted previously, ISC's dhcpd is available as a third party package, and you may prefer to use it as you are trying to use features which do not exist in the OpenBSD fork.

As it happens, PowerDNS is available as a package for OpenBSD, also.
Reply With Quote
  #3   (View Single Post)  
Old 6 Days Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

Further details on these packages:

The OpenBSD port for ISC's reference implementation of DHCP is net/isc-dhcp. It has three packages available: a DHCPd server (isc-dhcp-server), a DHCP client (isc-dhcp-client) and a relay agent (isc-dhcp-omapi). For OpenBSD 5.5-release, this is ISC's version 4.2.5-P1. For OpenBSD 5.6, which will be released on November 1, it is version 4.3.0.

The OpenBSD port for PowerDNS is net/powerdns. There are four packages, depending on the backing database: powerdns, powerdns-ldap powerdns-mysql, and powerdns-pgsql. For OpenBSD 5.5 and 5.6, this is version 2.9.22.6.

For more on packages and ports, see FAQ 15.
Reply With Quote
  #4   (View Single Post)  
Old 6 Days Ago
denriktiga denriktiga is offline
New User
 
Join Date: Oct 2014
Posts: 4
Thanked 0 Times in 0 Posts
Thumbs up

I actually have tried to use the isc-dhcp-server package. But until a few minutes ago, I could not figure out how to set the interface for the server.

Turns out it was this easy:
Code:
/usr/local/sbin/dhcpd em1
and there was no use for the rc.conf.local in this case, wich I thougt.

I now have powerdns and isc-dhcp-server running smooth.

Thanks for your replies anyway =)
Reply With Quote
Reply

Tags
ddns powerdns dhcpd dynamic

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble pxe booting a .php file with dhcpd denriktiga OpenBSD General 3 2 Weeks Ago 05:36 PM
Trouble after changing static IP to dynamic IP on OpenBSD gateway magrin OpenBSD General 5 5th April 2014 10:38 AM
dhcpd and dns sputnik OpenBSD General 8 8th May 2009 02:50 PM
dhcpd within ezjail? zelut FreeBSD General 7 10th February 2009 10:31 PM
dhcpd problems... dynamic and static leases present edhunter FreeBSD General 7 16th May 2008 02:34 PM


All times are GMT. The time now is 06:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick