on release and config-option routers?

kroesjnov x kroesjnov at hotmail.com
Mon Dec 17 21:00:28 UTC 2007


Hi,

I am trying to do some dynamic configuration from dhcpd.conf, but I am running into a problem with my 'on release' section. It seems 'config-option routers' is not known within it's scope or something? (see logfile below) I need to know this IP because I passed it to iptables in my 'on commit' section. In order to delete this iptables rule I need to replicate it exactly with the -D, otherwise it wont be deleted. Any help on this would be appreciated.

I am a bit confused on what exactly I can pass to the binary-to-ascii function, and what I can dissect from it. I can find some configurations from people on the internet, but not a clear overview on that subject. Any pointers on this are also very welcome.

====config====
ddns-update-style ad-hoc;

shared-network home
{
        subnet 192.168.10.0 netmask 255.255.255.0
        {
                range 192.168.10.3 192.168.10.20;
                option routers 192.168.10.1;
                option subnet-mask 255.255.255.0;
        }

        on commit
        {
                execute
                (
                        "/home/x/iptables.sh",
                        "add",
                        binary-to-ascii(10,8,".",leased-address),
                        binary-to-ascii(10,8,".",config-option routers)
                );
        }

        on release
        {
                execute
                (
                        "/home/x/iptables.sh",
                        "remove",
                        binary-to-ascii(10,8,".",leased-address),
                        binary-to-ascii(10,8,".",config-option routers)
                );
        }
}
===/config====


=====log=====
Dec 17 19:42:09 ubuntu dhcpd: DHCPDISCOVER from 00:0c:29:97:9c:b8 via eth0
Dec 17 19:42:10 ubuntu dhcpd: DHCPOFFER on 192.168.10.3 to 00:0c:29:97:9c:b8 (x-test) via eth0
Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[0] = /home/x/iptables.sh
Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[1] = add
Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[2] = 192.168.10.3
Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[3] = 192.168.10.1
Dec 17 19:42:10 ubuntu dhcpd: DHCPREQUEST for 192.168.10.3 (192.168.10.1) from 00:0c:29:97:9c:b8 (x-test) via eth0
Dec 17 19:42:10 ubuntu dhcpd: DHCPACK on 192.168.10.3 to 00:0c:29:97:9c:b8 (x-test) via eth0
Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[0] = /home/x/iptables.sh
Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[1] = remove
Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[2] = 192.168.10.3
Dec 17 19:42:12 ubuntu dhcpd: execute: bad arg 3
Dec 17 19:42:12 ubuntu dhcpd: DHCPRELEASE of 192.168.10.3 from 00:0c:29:97:9c:b8 (x-test) via eth0 (found)
====/log====


-- "Wisdom lies not in obtaining knowledge, but in using it in the right way"
- kroesjnov

Email: kroesjnov at hotmail.com
MSN: kroesjnov at hotmail.com
ICQ: 85685870
Yahoo: kroesjnov
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20071218/39db231f/attachment.html>


More information about the dhcp-users mailing list