<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi,<br><br>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.<br><br>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.<br><br>====config====<br>ddns-update-style ad-hoc;<br><br>shared-network home<br>{<br>        subnet 192.168.10.0 netmask 255.255.255.0<br>        {<br>                range 192.168.10.3 192.168.10.20;<br>                option routers 192.168.10.1;<br>                option subnet-mask 255.255.255.0;<br>        }<br><br>        on commit<br>        {<br>                execute<br>                (<br>                        "/home/x/iptables.sh",<br>                        "add",<br>                        binary-to-ascii(10,8,".",leased-address),<br>                        binary-to-ascii(10,8,".",config-option routers)<br>                );<br>        }<br><br>        on release<br>        {<br>                execute<br>                (<br>                        "/home/x/iptables.sh",<br>                        "remove",<br>                        binary-to-ascii(10,8,".",leased-address),<br>                        binary-to-ascii(10,8,".",config-option routers)<br>                );<br>        }<br>}<br>===/config====<br>
<br>=====log=====<br>Dec 17 19:42:09 ubuntu dhcpd: DHCPDISCOVER from 00:0c:29:97:9c:b8 via eth0<br>Dec 17 19:42:10 ubuntu dhcpd: DHCPOFFER on 192.168.10.3 to 00:0c:29:97:9c:b8 (x-test) via eth0<br>Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[0] = /home/x/iptables.sh<br>Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[1] = add<br>Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[2] = 192.168.10.3<br>Dec 17 19:42:10 ubuntu dhcpd: execute_statement argv[3] = 192.168.10.1<br>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<br>Dec 17 19:42:10 ubuntu dhcpd: DHCPACK on 192.168.10.3 to 00:0c:29:97:9c:b8 (x-test) via eth0<br>Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[0] = /home/x/iptables.sh<br>Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[1] = remove<br>Dec 17 19:42:12 ubuntu dhcpd: execute_statement argv[2] = 192.168.10.3<br>Dec 17 19:42:12 ubuntu dhcpd: execute: bad arg 3<br>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)<br>====/log====<br><br><br>-- "Wisdom lies not in obtaining knowledge, but in using it in the right way"<br>- kroesjnov<br><br>Email: kroesjnov@hotmail.com<br>MSN: kroesjnov@hotmail.com<br>ICQ: 85685870<br>Yahoo: kroesjnov<br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>