[Linux-Discussion] DHCP Server Detection

  • From: "David A. Wallace" <dwallace@xxxxxxxxxxx>
  • To: <linux-discussion@xxxxxxxxxxxxx>
  • Date: Tue, 27 Aug 2002 21:27:59 -0500

Linux Gurus,

    I recently built a simple Firewall/NAT box to go between our college's
network and the (privately addressed) network used in our networking lab.
The instructor has requested that I add DHCP service to the lab side of the
box. This shouldn't be a big deal. The Howto is pretty straight forward.

    The problem is that they have a M$ DHCP server in the lab that they
occasionally need to turn on for the W2K classes. I would like to write a
cron job script that will bring the my box's DHCP service down when the M$
DHCP server comes up.

    My thinking is that I could write a cron job script to occasionally
check port 68 on the M$ DHCP server. If the port is active the script would
bring the Linux DHCP down. If the port isn't answering DHCP requests it
would bring the Linux DHCP service up.

    Here's the big question. Is there a simple utilility of some type that I
can use to "ping" (I know ping can't be used) or probe the M$ DHCP server's
port 68 to find out if it is actively answering requests or not? I saw
netcat on the web tonight. Is that the answer? Is there a better method?

    All input would be greatly appriciated.


David




Other related posts: