API for identifying the DHCP server's IP address.

Discussion in 'Linux Networking' started by lawrieleo, Jul 25, 2005.

  1. lawrieleo

    lawrieleo Guest

    Hi all,

    Here we are writing an application, which basically shows the network
    configuration parameters of our linux box.
    A dhcp client is working which fetches the ip address from the DHCP
    server operating in our network. There could be morethan one server
    operating. This application also needs to display the DHCP server's IP
    address the one that assigned an IP address to our box?
    How can our application program identify the DHCP server's IP address?
    Any specific API or IOCTL for this purpose?
    Please suggest.

    Thanks,
    Lawrie.
     
    lawrieleo, Jul 25, 2005
    #1
    1. Advertisements

  2. lawrieleo

    cyclone Guest

    scan file /etc/dhcpc/dhcpc-d-ethx.info for
    'DHCPSID=x.x.x.x' That should be the server IP that gave
    you your address.
    Sys V filesystem may hide elswhere, or add a line of code to the dhcp
    client software to write a log file of the server IP when it gets one,
    perhaps in the /proc folder
    RObert
     
    cyclone, Jul 25, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.