APIs to change the interface???

Naveen naveensampath at tataelxsi.co.in
Mon Jan 6 09:47:01 UTC 2014


Hi,

Thanks for ur reply....
I can able to run the server now. But the server by-default listens to 
eth0 only. Can i change it listening to "lo" interface? Coz i am working 
on developing an application to provide IP addresses to virtual hosts 
running on the same machine. Is there any APIs available in the code to 
do so or i need to change some piece of code?

Is there any alternative solution for my application?



Regards,
Naveen S




On Saturday 04 January 2014 05:30 PM, dhcp-users-request at lists.isc.org 
wrote:
> Send dhcp-users mailing list submissions to
> 	dhcp-users at lists.isc.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.isc.org/mailman/listinfo/dhcp-users
> or, via email, send a message with subject or body 'help' to
> 	dhcp-users-request at lists.isc.org
>
> You can reach the person managing the list at
> 	dhcp-users-owner at lists.isc.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of dhcp-users digest..."
>
>
> Today's Topics:
>
>     1. Re: How to run the server? (Glenn Satchell)
>     2. on (commit|expiry|release) events (Brett @Google)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 3 Jan 2014 23:11:07 +1100
> From: "Glenn Satchell" <glenn.satchell at uniq.com.au>
> To: "Users of ISC DHCP" <dhcp-users at lists.isc.org>
> Subject: Re: How to run the server?
> Message-ID:
> 	<e4cbfed34cbd8ffd224baf216074df73.squirrel at mail.uniq.com.au>
> Content-Type: text/plain;charset=iso-8859-1
>
> Hi Naveen
>
> The startup scripts vary a lot between different distributions and
> operating systems, eg dhcpd can run on linux (ubuntu, debian, redhat,
> centos, etc), bsd, solaris, hpux, aix, etc. It is left to the
> distributions to add whatever config and startup scripts are used on that
> operating system.
>
> So to make this work you would typically install the distribution dhcpd
> package and make a copy of the various startup files, and so on. Then
> remove the package amnd copy the startup scripts back into place, or
> overwrite the executable with your newly compiled version. Some
> distributions may put files, eg dhcpd.leases and dhcpd.conf in non-default
> directories so you may need to tweak the startup scripts or build
> commands.
>
> Using your own compiled version of dhcpd is not for the faint hearted,
> certainly it is easier to start with the standard distribution package and
> get things working. Then if you need a feature in a new version see if
> pre-built packages are available, if not then build and install your own.
>
> regards,
> -glenn
>
>> On 3 January 2014 05:31, Naveen <naveensampath at tataelxsi.co.in> wrote:
>>> but after that, how can i start the server????
>>> I read the README file too, but no information available on how to run
>>> the
>>> server..
>>> plz reply asap...
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 4 Jan 2014 12:38:45 +1000
> From: "Brett @Google" <brett.maxfield at gmail.com>
> To: dhcp-users at lists.isc.org
> Subject: on (commit|expiry|release) events
> Message-ID:
> 	<CAJiMZ94DKzzUs3YNnQG4dJYF65YXg-3K+tMMW_N8K_ygZJhGZg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I have been investigating /learning how to use on (commit|expiry|release)
> events in dhcpd.
>
> As a starting point I defined the following in dhcpd.conf (in the global
> scope) :
>
> on commit {
> log(info, concat("commit", " ", binary-to-ascii(10, 8, ".",
> leased-address), " ", concat ( suffix (concat ("0", binary-to-ascii (16, 8,
> "", substring(hardware, 1, 1))),2),":", suffix (concat ("0",
> binary-to-ascii (16, 8, "", substring(hardware, 2, 1))),2),":", suffix
> (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 3,
> 1))),2),":", suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 4, 1))),2),":", suffix (concat ("0", binary-to-ascii
> (16, 8, "", substring(hardware, 5, 1))),2),":", suffix (concat ("0",
> binary-to-ascii (16, 8, "", substring(hardware, 6, 1))),2)), " ", "'",
> (option agent.circuit-id), "'"));
> }
>
> on expiry {
> log(info, concat("expiry", " ", binary-to-ascii(10, 8, ".",
> leased-address)));
> }
>
> on release {
> log(info, concat("release", " ", binary-to-ascii(10, 8, ".",
> leased-address)));
> }
>
> This should just log the events and ips / macs, and not do anything else.
>
> When i do a "ipconfig /release" on a windows dhcp client i can see :
>
> Jan  4 12:09:38 dns dhcpd: expiry 192.168.0.239
> Jan  4 12:09:38 dns dhcpd: DHCPRELEASE of 192.168.0.239 from
> 00:19:d2:45:73:2d (xplaptop) via em0 (found)
> Jan  4 12:09:38 dns dhcpd: Removed forward map from xplaptop.example.net to
> 192.168.0.239
> Jan  4 12:09:38 dns dhcpd: Removed reverse map on 239.0.168.192.in-addr.arpa
>
> When i do a "ipconfig /renew" on the windows dhcp client, i get :
>
> Jan  4 12:12:10 dns dhcpd: DHCPDISCOVER from 00:19:d2:45:73:2d via em0
> Jan  4 12:12:11 dns dhcpd: DHCPOFFER on 192.168.0.239 to 00:19:d2:45:73:2d
> (xplaptop) via em0
> Jan  4 12:12:11 dns dhcpd: DHCPREQUEST for 192.168.0.239 (192.168.0.252)
> from 00:19:d2:45:73:2d (xplaptop) via em0
> Jan  4 12:12:11 dns dhcpd: DHCPACK on 192.168.0.239 to 00:19:d2:45:73:2d
> (xplaptop) via em0
> Jan  4 12:12:11 dns dhcpd: Added new forward map from
> xplaptop.example.netto 192.168.0.239
> Jan  4 12:12:11 dns dhcpd: Added reverse map from
> 239.0.168.192.in-addr.arpa to xplaptop.example.net
>
> Note there is no logged "commit" event in this case, but the DDNS still
> seems to work ?
>
> The doco says that you should not use events when you are doing dynamic dns
> updates as it will break the dynamic updates, which you can see from the
> logs above i am. But i am seeing an expiry event, when i would have
> expected a release event rather than an expiry event.
>
> My long term goal was to do something like :
>
> on commit {
>      set option host-name = pick-first-value(
>          option fqdn.hostname,
>          option host-name,
>          <client provided host name>,
>          binary-to-ascii(10, 8, "-", leased-address));
> }
>
> Meaning to use the configured hostname, and if none, make one that is the
> allocated ip with the dots replaced with dashes.. as if the client does not
> provide a client name, and they are an unknown dhcp requester (there is no
> hardware address matching it to a host entry) and there is no name provided
> by the client, then it would provide some default client name, that DNS can
> still use (even if not descriptive).
>
> Otherwise if the client does not provide a dhcp client name, the dns is not
> updated (as there is no name to put in the DNS, do that is probably a
> reasonable thing)
>
> If this will indeed break DDNS updates (say if i put my events in a zone,
> and not as globals), is there a way to call the DDNS internal code after i
> have created the default client name, if one was not provided ? Or can
> global scripts be made to work also, when a zone has DDNS enabled ?
>
> Any thoughts are welcome..
>
> Cheers
> Brett
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140104/c215fe55/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> End of dhcp-users Digest, Vol 63, Issue 6
> *****************************************
> .
>



More information about the dhcp-users mailing list