Premier, laissez-moi dit je suis delsole que c’est en anglais. Mais je pense que plupart de mes lecteurs est anglais. Cette article est comment mourir dhcp leases sans modifier dhcpd.lease fichier. Si vous pouvez lire francais, je pense qeu vous pouvez lire cette article.
There is an article floating around on the internet which has a similar procedure as below but it lacks the client IP section of the DHCP packet. That section is critical to getting the DHCP server to release.
Ever had a case where you want to delete DHCP leases? Sure, you can install webmin and try it that way. But I have had some bad experiences with external utilites to edit sensitive data files such as dhcpd.leases.
Enter SHO-CLI from our folks at http://www.cubsystems.com (the download link is here: http://www.cubsystem.com/sho/).
Just install it into your linux box (its just a simple library file and a tiny client).
Then, do the following to send a dhcp release for a particular ip / mac (yes, you need to know the mac):
sho-cli Then type in this in the shell: eth :: Ethernet eth.sourceMAC = 00:01:02:03:04:05 eth.destinationMAC = FF:FF:FF:FF:FF:FF ip :: IP ip.sourceIP = 0.0.0.0 ip.destinationIP = 255.255.255.255 ip.protocol = 17 udp :: UDP udp.sourcePort = 68 udp.destinationPort = 67 dhcp :: DHCP dhcp.clientMAC = 00:01:02:03:04:05 dhcp.clientIP = 10.1.2.3 dhcp.AddOption MESSAGE_TYPE DHCP_RELEASE eth << ip ip << udp udp << dhcp compile eth set interface = eth0 send eth Now can someone please write me a perl script to parse through dhcpd.leases and ping addreses, then release those addresses which don't reply?