<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div>Hi Glenn,</div><div><br></div><div>Thanks.</div><div><br></div><div>Hi All,</div><div><br></div><div>Anyone can help?</div><div><br></div><div>Best Regards,</div><div>Billy</div><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">寄件人﹕</span></b> Glenn Satchell <glenn.satchell@uniq.com.au><br><b><span style="font-weight: bold;">收件人﹕</span></b> Users of ISC DHCP <dhcp-users@lists.isc.org><br><b><span style="font-weight: bold;">傳送日期﹕</span></b> 2010/1/21 (四) 11:37:28 AM<br><b><span style="font-weight: bold;">主題:</span></b> Re: Remove Lease via omshell<br></font><br>Hi Billy<br><br>Selecting by
 anything only works when it matches one lease. That hardware-address must correspond to more than one lease, so in that case hardware-address and dhcp-identifier are not unique selectors. ip-address is always a unique selector for a lease.<br><br>I don't know about removing a lease, I thought that was only for host entries, perhaps someone else can help?<br><br>-- regards,<br>-glenn<br>--<br>Glenn Satchell                            |  Miss 9: What do you<br>Uniq Advances Pty Ltd, Sydney Australia   |  do at work Dad?<br>mailto:<a ymailto="mailto:glenn.satchell@uniq.com.au" href="mailto:glenn.satchell@uniq.com.au">glenn.satchell@uniq.com.au</a>         |  Miss 6: He just<br><a href="http://www.uniq.com.au" target="_blank">http://www.uniq.com.au</a> tel:0409-458-580   |  types random stuff.<br>Billy Ng wrote:<br>> Hi Glenn,<br>> <br>> I can't select the lease by either hardware address or dhcp-client-identifier:<br>> <br>> #
 omshell<br>>> server localhost<br>>> port 7911<br>>> key omapi_key<br>>  ph5ud2BgMmTYCKmHt7kwEQ==<br>>> connect<br>> obj: <null><br>>> new lease<br>> obj: lease<br>>> set hardware-address = 00:0e:7f:7c:2c:01<br>> obj: lease<br>> hardware-address = 00:0e:7f:7c:2c:01<br>>> open<br>> can't open object: more than one object matches key<br>> obj: lease<br>> hardware-address = 00:0e:7f:7c:2c:01<br>> <br>> # omshell<br>>> server localhost<br>>> port 7911<br>>> key omapi_key ph5ud2BgMmTYCKmHt7kwEQ==<br>>> connect<br>> obj: <null><br>>> new lease<br>> obj: lease<br>>> set dhcp-client-identifier = 01:00:0e:7f:7c:2c:01<br>> obj: lease<br>> dhcp-client-identifier = 01:00:0e:7f:7c:2c:01<br>>> open<br>> can't open object: more than one object matches key<br>> obj: lease<br>> dhcp-client-identifier = 01:00:0e:7f:7c:2c:01<br>> <br>> I'm able to select the lease by IP address but it is failed to remove the lease:<br>> <br>> # omshell<br>>> server localhost<br>>>
 port 7911<br>>> key omapi_key ph5ud2BgMmTYCKmHt7kwEQ==<br>>> connect<br>> obj: <null><br>>> new lease<br>> obj: lease<br>>> set ip-address = x.x.x.x<br>> obj: lease<br>> ip-address = x:x:x:x<br>>> open<br>> obj: lease<br>> ip-address = x:x:x:x<br>> state = 00:00:00:02<br>> dhcp-client-identifier = 01:00:0e:7f:7c:2c:01<br>> client-hostname = "winxp"<br>> subnet = 00:00:00:03<br>> pool = 00:00:00:04<br>> hardware-address = 00:0e:7f:7c:2c:01<br>> hardware-type = 00:00:00:01<br>> ends = 4b:57:ca:eb<br>> starts = 4b:57:c3:e3<br>> tstp = 4b:57:d5:77<br>> tsfp = 4b:56:df:5c<br>> atsfp = 00:00:00:00<br>> cltt = 4b:57:c3:e3<br>> flags = 00<br>>> remove<br>> can't destroy object: not implemented<br>> obj: lease<br>> ip-address = x:x:x:x<br>> state = 00:00:00:02<br>> dhcp-client-identifier = 01:00:0e:7f:7c:2c:01<br>> client-hostname = "winxp"<br>> subnet = 00:00:00:03<br>> pool = 00:00:00:04<br>> hardware-address = 00:0e:7f:7c:2c:01<br>> hardware-type =
 00:00:00:01<br>> ends = 4b:57:ca:eb<br>> starts = 4b:57:c3:e3<br>> tstp = 4b:57:d5:77<br>> tsfp = 4b:56:df:5c<br>> atsfp = 00:00:00:00<br>> cltt = 4b:57:c3:e3<br>> flags = 00<br>> <br>> Would you please kindly advise how can I remove the leave by hardware address. Many thanks.<br>> <br>> Best Regards,<br>> Billy<br>> <br>> ------------------------------------------------------------------------<br>> *寄件人﹕* Glenn Satchell <<a ymailto="mailto:glenn.satchell@uniq.com.au" href="mailto:glenn.satchell@uniq.com.au">glenn.satchell@uniq.com.au</a>><br>> *收件人﹕* Users of ISC DHCP <<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>><br>> *傳送日期﹕* 2010/1/20 (三) 7:00:58 PM<br>> *主題:* Re: Re: Re: Re: Remove Lease via omshell<br>> <br>> Billy Ng wrote:<br>>  > Hi All,<br>>  ><br>>  > Any idea?<br>>  ><br>>  > Best Regards,<br>>  > Billy<br>>  ><br>>  >
 ------------------------------------------------------------------------<br>>  > *寄件人﹕* Billy Ng <<a ymailto="mailto:mondeo1055@yahoo.com" href="mailto:mondeo1055@yahoo.com">mondeo1055@yahoo.com</a> <mailto:<a ymailto="mailto:mondeo1055@yahoo.com" href="mailto:mondeo1055@yahoo.com">mondeo1055@yahoo.com</a>>><br>>  > *收件人﹕* Users of ISC DHCP <<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>>><br>>  > *傳送日期﹕* 2009/12/29 (二) 10:25:17 AM<br>>  > *主題:* Re: Re: Remove Lease via omshell<br>>  ><br>>  > Dear All,<br>>  ><br>>  > When I tried to remove the lease from omshell by:<br>>  ><br>>  > omshell<br>>  >>server localhost<br>>  >>port 7911<br>>  >>key my_key xxxxxx<br>>  >>new host<br>>  >>set name = "HOSTNAME" 
 > (where the HOSTNAME is the client-hostname listed in the dhcpd.lease)<br>>  >>open<br>>  > can't open object: not found<br>>  > obj: host<br>>  > name = "HOSTNAME"<br>>  >>remove<br>>  > can't destroy object: not found<br>>  > obj: host<br>>  > name = "HOSTNAME"<br>>  ><br>>  > Any idea?<br>>  ><br>>  > Best Regards,<br>>  > Billy<br>>  ><br>>  > ------------------------------------------------------------------------<br>>  > *寄件人﹕* Glenn Satchell <<a ymailto="mailto:Glenn.Satchell@uniq.com.au" href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a> <mailto:<a ymailto="mailto:Glenn.Satchell@uniq.com.au" href="mailto:Glenn.Satchell@uniq.com.au">Glenn.Satchell@uniq.com.au</a>>><br>>  > *收件人﹕* <a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org"
 href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>><br>>  > *傳送日期﹕* 2009/12/7 (一) 7:24:05 PM<br>>  > *主題:* Re:Re: Remove Lease via omshell<br>>  ><br>>  > They are in /etc/dhcpd.conf, so you could either hard code them in your<br>>  > script, or use some grep and cut to extract them from dhcpd.conf into<br>>  > shell variables which you plug into your omshell command line.<br>>  ><br>>  > Something like this:<br>>  ><br>>  > #! /bin/sh<br>>  > PORT=`grep port /etc/dhcpd.conf | cut -f2 | sed -e 's/;//'`<br>>  > # repeat for other vars like secret and keyname<br>>  ><br>>  > omshell << EOF<br>>  > server localhost<br>>  > port $PORT<br>>  > key $keyname $secret<br>>  > connect<br>>  > new host<br>>  > set name = "hostname"<br>>  > open<br>>  > remove<br>>  > EOF<br>>  ><br>>  > regards,<br>>  > -glenn<br>>  ><br>>  >  >Date: Mon, 7 Dec 2009 18:59:15 +0800 (CST)<br>>  >  >From:
 syhshanda <<a ymailto="mailto:syhshanda@126.com" href="mailto:syhshanda@126.com">syhshanda@126.com</a> <mailto:<a ymailto="mailto:syhshanda@126.com" href="mailto:syhshanda@126.com">syhshanda@126.com</a>> <mailto:<a ymailto="mailto:syhshanda@126.com" href="mailto:syhshanda@126.com">syhshanda@126.com</a> <mailto:<a ymailto="mailto:syhshanda@126.com" href="mailto:syhshanda@126.com">syhshanda@126.com</a>>>><br>>  >  ><br>>  >  > Hi,<br>>  >  >  In the command line of "key keyname secret", how can I get the<br>>  > keyname and<br>>  > secret.<br>>  >  >  Thanks for you help.<br>>  >  > Best Regards,<br>>  >  > Bob<br>>  >  ><br>>  >  ><br>>  >  ><br>>  >  ><br>>  >  ><br>>  >  ><br>>  >  > 婓2009-12-07?12:07:25ㄛApu?<<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a> <mailto:<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a>> <mailto:<a
 ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a> <mailto:<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a>>>>?迡耋ㄩ<br>>  >  > >On?12/6/09?10:30?PM,?Billy?Ng?wrote:<br>>  >  > >>?Is?it?possible?to?remove?a?lease?via?omshell??If?yes,?would?you<br>>  >  > >>?please?kindly?advise?the?syntax?of?omshell??Thanks?a?lot.<br>>  >  > ><br>>  >  > ><br>>  >  > >    server?localhost<br>>  >  > >    port?7911<br>>  >  > >    key?keyname?secret<br>>  >  > >    connect<br>>  >  > >    new?host<br>>  >  > >    set?name?=?"hostname"<br>>  >  > >    open<br>>  >  > >    remove<br>>  >  > ><br>>  >  > ><br>>  >  > >--?<br>>  >  > >Apu?<<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a> <mailto:<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a>> <mailto:<a ymailto="mailto:apu@spfld.com"
 href="mailto:apu@spfld.com">apu@spfld.com</a> <mailto:<a ymailto="mailto:apu@spfld.com" href="mailto:apu@spfld.com">apu@spfld.com</a>>>><br>>  >  > ><a href="http://www.spfld.com/" target="_blank">http://www.spfld.com/</a><br>>  >  > ><br>>  >  > ><br>>  >  > >_______________________________________________<br>>  >  > >dhcp-users?mailing?list<br>>  >  > ><a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>>><br>>  >  > ><a href="https://lists.isc.org/mailman/listinfo/dhcp-users"
 target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>>  ><br>>  > _______________________________________________<br>>  > dhcp-users mailing list<br>>  > <a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>>><br>>  > <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>>  ><br>>  > ------------------------------------------------------------------------<br>>  >
 Yahoo!香港提供網上安全攻略,教你如何防範黑客!*了解更多*<br>>  > <<a href="http://hk.promo.yahoo.com/security/" target="_blank">http://hk.promo.yahoo.com/security/</a>><br>>  ><br>>  > ------------------------------------------------------------------------<br>>  > Yahoo!香港提供網上安全攻略,教你如何防範黑客!*了解更多*<br>>  > <<a href="http://hk.promo.yahoo.com/security/" target="_blank">http://hk.promo.yahoo.com/security/</a>><br>>  ><br>>  ><br>>  > ------------------------------------------------------------------------<br>>  ><br>>  > _______________________________________________<br>>  > dhcp-users mailing list<br>>  > <a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>><br>>  > <a
 href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>> <br>> After specifying server, port and key, you must connect to the dhcp<br>> server. Whenever an error is returned, there is no point in continuing,<br>> so in your example after not being able to open the remote host, there<br>> is no way to remove it.<br>> <br>> Here's an example that does work, cut and paste from my system. This is<br>> selecting by ip-address. In my earlier post I mistakenly put "name" as<br>> the key to match on. The correct variable is "client-hostname" but I<br>> don't think it can be used as a key to match on. Sorry about any<br>> confusion I caused.<br>> <br>> % omshell<br>>  > server localhost<br>>  > port 7911<br>>  > key OMAPI xxxxxx<br>>  > connect<br>> obj: <null><br>>  > new host<br>> obj: host<br>>  > set ip-address = 192.168.14.231<br>> obj: host<br>> ip-address =
 c0:a8:0e:e7<br>>  > open<br>> obj: host<br>> ip-address = c0:a8:0e:e7<br>> name = "ripper"<br>> hardware-address = 00:90:27:19:22:c2<br>> hardware-type = 00:00:00:01<br>>  > remove<br>> obj: <null><br>>  > ^D<br>> <br>> Note that when you use a host object, you don't match against things in<br>> the leases database, but rather things with host statements in<br>> dhcpd.conf. To match against dynamic entries you need to match against a<br>> lease. To match a lease you must use the ip-address, hardware-address or<br>> dhcp-client-identifier as the key to match on.<br>> <br>> Select a lease by ip-address:<br>> % omshell<br>>  > server localhost<br>>  > port 7911<br>>  > key OMAPI HgEqjc76U4FAfn4F5EEuPw==<br>>  > connect<br>> obj: <null><br>>  > new lease<br>> obj: lease<br>>  > set ip-address = 192.168.14.230<br>> obj: lease<br>> ip-address = c0:a8:0e:e6<br>>  > open<br>> obj: lease<br>> ip-address = c0:a8:0e:e6<br>> state = 00:00:00:01<br>>
 subnet = 00:00:00:0b<br>> pool = 00:00:00:0c<br>> hardware-address = 00:0d:60:1a:c4:fa<br>> hardware-type = 00:00:00:01<br>> ends = 4a:fe:ba:41<br>> starts = 4a:fd:68:c1<br>> tstp = 4a:fe:ba:41<br>> tsfp = 00:00:00:00<br>> atsfp = 00:00:00:00<br>> cltt = 4a:fd:68:c1<br>> flags = 00<br>> vendor-string = "SUNW.i86pc"<br>> <br>> Select a lease by ethernet address:<br>> % omshell<br>>  > server localhost<br>>  > port 7911<br>>  > key OMAPI HgEqjc76U4FAfn4F5EEuPw==<br>>  ><br>>  > connect<br>> obj: <null><br>>  > new lease<br>> obj: lease<br>>  > set hardware-address = 00:90:27:19:22:c2<br>> obj: lease<br>> hardware-address = 00:90:27:19:22:c2<br>>  > open<br>> obj: lease<br>> hardware-address = 00:90:27:19:22:c2<br>> state = 00:00:00:01<br>> ip-address = c0:a8:0e:e7<br>> dhcp-client-identifier = 01:00:90:27:19:22:c2<br>> ...<br>> <br>> Select a lease by client-id:<br>> % omshell<br>>  > server localhost<br>>  > port 7911<br>>  > key OMAPI
 HgEqjc76U4FAfn4F5EEuPw<br>>  > connect<br>> obj: <null><br>>  > new lease<br>> obj: lease<br>>  > set dhcp-client-identifier = 01:00:90:27:19:22:c2<br>> obj: lease<br>> dhcp-client-identifier = 01:00:90:27:19:22:c2<br>>  > open<br>> obj: lease<br>> dhcp-client-identifier = 01:00:90:27:19:22:c2<br>> state = 00:00:00:01<br>> ip-address = c0:a8:0e:e7<br>> ...<br>>  > remove<br>> can't destroy object: not implemented<br>> obj: lease<br>> dhcp-client-identifier = 01:00:90:27:19:22:c2<br>> ...<br>>  > ^D<br>> <br>> I hope this helps a bit, even though it is not a complete answer.<br>> <br>> -- regards,<br>> -glenn<br>> --<br>> Glenn Satchell                            |  Miss 9: What do you<br>> Uniq Advances Pty Ltd, Sydney Australia  |  do at work Dad?<br>> mailto:<a ymailto="mailto:glenn.satchell@uniq.com.au" href="mailto:glenn.satchell@uniq.com.au">glenn.satchell@uniq.com.au</a> <mailto:<a
 ymailto="mailto:glenn.satchell@uniq.com.au" href="mailto:glenn.satchell@uniq.com.au">glenn.satchell@uniq.com.au</a>>        |  Miss 6: He just<br>> <a href="http://www.uniq.com.au" target="_blank">http://www.uniq.com.au</a> tel:0409-458-580  |  types random stuff.<br>> _______________________________________________<br>> dhcp-users mailing list<br>> <a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a> <mailto:<a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>><br>> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>> <br>> ------------------------------------------------------------------------<br>> Yahoo!香港提供網上安全攻略,教你如何防範黑客!*了解更多* <<a href="http://hk.promo.yahoo.com/security/"
 target="_blank">http://hk.promo.yahoo.com/security/</a>><br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> dhcp-users mailing list<br>> <a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>_______________________________________________<br>dhcp-users mailing list<br><a ymailto="mailto:dhcp-users@lists.isc.org" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br><a href="https://lists.isc.org/mailman/listinfo/dhcp-users" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a></div></div><div style="position:fixed"></div>


<!-- cg31.c2.mail.re1.yahoo.com compressed/chunked Thu Jan 14 22:23:59 PST 2010 -->
</div><br>
      



      <hr size=1>Yahoo!香港提供網上安全攻略,教你如何防範黑客!<a href="http://hk.promo.yahoo.com/security/"><b>了解更多</b></a></body></html>