<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFCC">
My take on this would be to test this:<br>
<br>
<tt>class "pxeclient" {
</tt><tt><br>
</tt><tt>
match if substring (option vendor-class-identifier, 0, 9) =
"PXEClient";
</tt><tt><br>
</tt><tt>
}
</tt><tt><br>
</tt><tt>
</tt><tt><br>
</tt><tt> host boottest {
</tt><tt><br>
</tt><tt>
hardware ethernet 02:13:10:07:11:58;
</tt><tt><br>
</tt><tt>
fixed-address 192.168.255.12;
</tt><tt><br>
</tt><tt>
}
</tt><tt><br>
</tt><tt>
</tt><tt><br>
</tt><tt><br>
</tt><tt>shared-network all</tt><tt> {</tt><tt><br>
</tt><tt> subnet 192.168.254.0 netmask 255.255.255.0 {
</tt><tt><br>
</tt><tt>
pool {
</tt><tt><br>
</tt><tt>
allow members of "pxeclient";
</tt><tt><br>
</tt><tt>
range 192.168.254.100 192.168.254.109;
</tt><tt><br>
</tt><tt>
}
</tt><tt><br>
</tt><tt>
}
</tt><tt><br>
</tt><tt><br>
</tt><tt> subnet 192.168.255.0 netmask 255.255.255.0 {
</tt><tt><br>
</tt><tt>
deny members of "pxeclient";
}
</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><br>
The uncertain point here is that in a shared network there is really
nothing to tell which subnet the host belongs to, no DHCP-Relays
etc. This should work if a class has higher preference than a host
statement.<br>
<br>
I don't know the answer to that, I would have to test it.<br>
<br>
<div class="moz-cite-prefix">On 21/10/13 17.06, Anders Blomdell
wrote:<br>
</div>
<blockquote cite="mid:5265430D.3040905@control.lth.se" type="cite">I
would like the ISC dhcpd server to hand out either a dynamic ip
address or
<br>
a fixed address based on the vendor-class-identifier (I want a
dynamic address
<br>
from one subnet during pxeboots and a [possibly] fixed address
from another
<br>
subnet otherwise). I have been able to do it by running two
instances of the
<br>
dhcp server on the interface, but not by using shared-network.
<br>
<br>
The working configuration consists of /tmp/254.conf:
<br>
<br>
class "pxeclient" {
<br>
match if substring (option vendor-class-identifier, 0, 9) =
"PXEClient";
<br>
}
<br>
<br>
subnet 192.168.254.0 netmask 255.255.255.0 {
<br>
pool {
<br>
allow members of "pxeclient";
<br>
range 192.168.254.100 192.168.254.109;
<br>
}
<br>
}
<br>
<br>
and /tmp/255.conf:
<br>
<br>
host boottest {
<br>
hardware ethernet 02:13:10:07:11:58;
<br>
fixed-address 192.168.255.12;
<br>
if substring(option vendor-class-identifier, 0, 9) =
"PXEClient" {
<br>
ignore booting;
<br>
}
<br>
}
<br>
subnet 192.168.255.0 netmask 255.255.255.0 {
<br>
}
<br>
<br>
when running both of them with:
<br>
/usr/sbin/dhcpd -d -cf /tmp/254.conf -lf /tmp/254.lease --no-pid
<br>
/usr/sbin/dhcpd -d -cf /tmp/255.conf -lf /tmp/255.lease --no-pid
<br>
<br>
I get the following expected result:
<br>
<br>
# PXE-booting
<br>
DHCPDISCOVER from 02:13:10:07:11:58 via eth0
<br>
DHCPOFFER on 192.168.254.100 to 02:13:10:07:11:58 via eth0
<br>
# Ordinary boot
<br>
DHCPDISCOVER from 02:13:10:07:11:58 via eth0
<br>
DHCPOFFER on 192.168.255.12 to 02:13:10:07:11:58 via eth0
<br>
<br>
But I'm not able to achieve it with just one instance of dhcpd,
<br>
the reason seems to be that the 'ignore booting' will be active
<br>
for both subnets when the machine is PXE-booting and hence it will
<br>
not get an address from the pool.
<br>
<br>
Anybody that has a good idea on how to solve this?
<br>
<br>
Regards
<br>
<br>
Anders
<br>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Best regards
Sten Carlsen
No improvements come from shouting:
"MALE BOVINE MANURE!!!"
</pre>
</body>
</html>