Steps:
1. dhcpd的lease table是放在/var/lib/dhcpd/dhcpd.leases
2. 檢查一下格式:
lease 10.10.6.125 {
starts 2 2012/10/16 22:12:53;
ends 3 2012/10/17 22:12:53;
tstp 3 2012/10/17 22:12:53;
binding state active;
next binding state free;
hardware ethernet b8:ac:6f:21:53:ec;
uid "\001\270\254o!S\354";
client-hostname "D129252S";
}
10.10.6這個range被fake DHCP client用完了,所以我要把它們手動通通砍掉。
3. Sed:
sed -i "/10.10.6/,/}/d" /var/lib/dhcpd/dhcpd.leases
4. 重啟DHCP Server:
# /etc/init.d/dhcpd restart
參考: http://en.kioskea.net/faq/1451-sed-delete-one-or-more-lines-from-a-file
No comments:
Post a Comment