Smartproxy - isc - dhcp range being ignored when suggesting IPs for creating new hosts?

good afternoon :slight_smile:

i'm using foreman 1.1 on centos 6.4 64 bit
I have successfully created CentOS 6.4 hosts in the past through the entire
kickstart process.

I'm creating a new CentOS 6.4 64bit host with a new partition table (not
that this should matter)
I'm in the network tab, I select the domain, the subnet and foreman
pre-populates a suggested IP in the proper subnet as expected.
however, the suggested IP is outside the fairly narrow range I've specified
in dhcpd.conf

I'm running dhcp-4.1.1-34.P1.el6.centos.x86_64

here's my dhcpd.conf:
[snip]
ddns-update-style interim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
next-server 10.224.98.30;
filename "pxelinux.0";

omapi-port 7911;
key omapi_key {
algorithm HMAC-MD5;
secret "[secret]";
#<-The output from the generated key above.
};
omapi-key omapi_key;

max-lease-time 3600;
default-lease-time 3600;
option domain-name-servers server1, server2;

subnet 10.224.98.0 netmask 255.255.255.0 {
option routers 10.224.98.1;
range 10.224.98.170 10.224.98.185;
}

subnet 10.224.103.0 netmask 255.255.255.0 {
option routers 10.224.103.1;
range 10.224.103.21 10.224.103.249;
}

[snip]
you can see the range above; I should only get IPs between 170 and 185 in
my 10.224.98/24
this has worked as expected in the past.

now, foreman just suggested 10.224.98.6, which is outside my range.

For grins I restarted dhcpd, then restarted foreman and puppet.
didn't help

now, foreman just suggested 10.224.98.7.

here's the proxy log:
[snip]
D, [2013-07-12T15:09:01.610453 #26074] DEBUG โ€“ : Reading config file
/etc/dhcp/dhcpd.conf
D, [2013-07-12T15:09:01.610781 #26074] DEBUG โ€“ : Loading subnets for
127.0.0.1
D, [2013-07-12T15:09:01.610993 #26074] DEBUG โ€“ : Added
10.224.98.0/255.255.255.0 to 127.0.0.1
D, [2013-07-12T15:09:01.611148 #26074] DEBUG โ€“ : Added
10.224.103.0/255.255.255.0 to 127.0.0.1
D, [2013-07-12T15:09:01.613621 #26074] DEBUG โ€“ : trying to find an ip
address, we got {:to=>nil, :mac=>nil, :from=>nil}
D, [2013-07-12T15:09:01.630178 #26074] DEBUG โ€“ : Loading subnet data for
10.224.98.0/255.255.255.0
D, [2013-07-12T15:09:01.632977 #26074] DEBUG โ€“ : Added server.domain.com
(10.224.98.180 / 00:50:56:a9:33:9f) to 10.224.98.0/255.255.255.0
I, [2013-07-12T15:09:01.638859 #26074] INFO โ€“ : Enumerated hosts on
10.224.98.0
D, [2013-07-12T15:09:01.639000 #26074] DEBUG โ€“ : Lazy loaded
10.224.98.0/255.255.255.0 records
D, [2013-07-12T15:09:01.658271 #26074] DEBUG โ€“ : Searching for free ip -
pinging 10.224.98.6
D, [2013-07-12T15:09:03.692103 #26074] DEBUG โ€“ : Found free ip 10.224.98.6
out of a total of 253 free ips
D, [2013-07-12T15:38:49.112911 #4191] DEBUG โ€“ : Reading config file
/etc/dhcp/dhcpd.conf
D, [2013-07-12T15:38:49.113280 #4191] DEBUG โ€“ : Loading subnets for
127.0.0.1
D, [2013-07-12T15:38:49.113493 #4191] DEBUG โ€“ : Added
10.224.98.0/255.255.255.0 to 127.0.0.1
D, [2013-07-12T15:38:49.113674 #4191] DEBUG โ€“ : Added
10.224.103.0/255.255.255.0 to 127.0.0.1
D, [2013-07-12T15:38:49.116619 #4191] DEBUG โ€“ : trying to find an ip
address, we got {:to=>nil, :mac=>nil, :from=>nil}
D, [2013-07-12T15:38:49.127476 #4191] DEBUG โ€“ : Loading subnet data for
10.224.98.0/255.255.255.0
D, [2013-07-12T15:38:49.129241 #4191] DEBUG โ€“ : Added server.domain.com
(10.224.98.180 / 00:50:56:a9:33:9f) to 10.224.98.0/255.255.255.0
I, [2013-07-12T15:38:49.137407 #4191] INFO โ€“ : Enumerated hosts on
10.224.98.0
D, [2013-07-12T15:38:49.137636 #4191] DEBUG โ€“ : Lazy loaded
10.224.98.0/255.255.255.0 records
D, [2013-07-12T15:38:49.139607 #4191] DEBUG โ€“ : Searching for free ip -
pinging 10.224.98.7
D, [2013-07-12T15:38:51.174432 #4191] DEBUG โ€“ : Found free ip 10.224.98.7
out of a total of 253 free ips
[snip]

It looks like the code is in smart-proxy / lib / proxy / dhcp / server /
isc.rb
however, I don't see it looking for range lines at all, unless I'm missing
something.

thanks!

Hey,

two things that might cause problems.

First, after editing dhcpd configuration, did you restart dhcpd itself?

Second, can you check our leases if the MAC address isn't really
reserved already?

LZ

ยทยทยท On Fri, Jul 12, 2013 at 03:56:52PM -0700, dustyketchum@gmail.com wrote: > good afternoon :) > > i'm using foreman 1.1 on centos 6.4 64 bit > I have successfully created CentOS 6.4 hosts in the past through the entire > kickstart process. > > I'm creating a new CentOS 6.4 64bit host with a new partition table (not > that this should matter) > I'm in the network tab, I select the domain, the subnet and foreman > pre-populates a suggested IP in the proper subnet as expected. > however, the suggested IP is outside the fairly narrow range I've specified > in dhcpd.conf > > I'm running dhcp-4.1.1-34.P1.el6.centos.x86_64 > > here's my dhcpd.conf: > [snip] > ddns-update-style interim; > ignore client-updates; > authoritative; > allow booting; > allow bootp; > next-server 10.224.98.30; > filename "pxelinux.0"; > > omapi-port 7911; > key omapi_key { > algorithm HMAC-MD5; > secret "[secret]"; > #<-The output from the generated key above. > }; > omapi-key omapi_key; > > max-lease-time 3600; > default-lease-time 3600; > option domain-name-servers server1, server2; > > subnet 10.224.98.0 netmask 255.255.255.0 { > option routers 10.224.98.1; > range 10.224.98.170 10.224.98.185; > } > > subnet 10.224.103.0 netmask 255.255.255.0 { > option routers 10.224.103.1; > range 10.224.103.21 10.224.103.249; > } > > [snip] > you can see the range above; I should only get IPs between 170 and 185 in > my 10.224.98/24 > this has worked as expected in the past. > > now, foreman just suggested 10.224.98.6, which is outside my range. > > For grins I restarted dhcpd, then restarted foreman and puppet. > didn't help > > now, foreman just suggested 10.224.98.7. > > here's the proxy log: > [snip] > D, [2013-07-12T15:09:01.610453 #26074] DEBUG -- : Reading config file > /etc/dhcp/dhcpd.conf > D, [2013-07-12T15:09:01.610781 #26074] DEBUG -- : Loading subnets for > 127.0.0.1 > D, [2013-07-12T15:09:01.610993 #26074] DEBUG -- : Added > 10.224.98.0/255.255.255.0 to 127.0.0.1 > D, [2013-07-12T15:09:01.611148 #26074] DEBUG -- : Added > 10.224.103.0/255.255.255.0 to 127.0.0.1 > D, [2013-07-12T15:09:01.613621 #26074] DEBUG -- : trying to find an ip > address, we got {:to=>nil, :mac=>nil, :from=>nil} > D, [2013-07-12T15:09:01.630178 #26074] DEBUG -- : Loading subnet data for > 10.224.98.0/255.255.255.0 > D, [2013-07-12T15:09:01.632977 #26074] DEBUG -- : Added server.domain.com > (10.224.98.180 / 00:50:56:a9:33:9f) to 10.224.98.0/255.255.255.0 > I, [2013-07-12T15:09:01.638859 #26074] INFO -- : Enumerated hosts on > 10.224.98.0 > D, [2013-07-12T15:09:01.639000 #26074] DEBUG -- : Lazy loaded > 10.224.98.0/255.255.255.0 records > D, [2013-07-12T15:09:01.658271 #26074] DEBUG -- : Searching for free ip - > pinging 10.224.98.6 > D, [2013-07-12T15:09:03.692103 #26074] DEBUG -- : Found free ip 10.224.98.6 > out of a total of 253 free ips > D, [2013-07-12T15:38:49.112911 #4191] DEBUG -- : Reading config file > /etc/dhcp/dhcpd.conf > D, [2013-07-12T15:38:49.113280 #4191] DEBUG -- : Loading subnets for > 127.0.0.1 > D, [2013-07-12T15:38:49.113493 #4191] DEBUG -- : Added > 10.224.98.0/255.255.255.0 to 127.0.0.1 > D, [2013-07-12T15:38:49.113674 #4191] DEBUG -- : Added > 10.224.103.0/255.255.255.0 to 127.0.0.1 > D, [2013-07-12T15:38:49.116619 #4191] DEBUG -- : trying to find an ip > address, we got {:to=>nil, :mac=>nil, :from=>nil} > D, [2013-07-12T15:38:49.127476 #4191] DEBUG -- : Loading subnet data for > 10.224.98.0/255.255.255.0 > D, [2013-07-12T15:38:49.129241 #4191] DEBUG -- : Added server.domain.com > (10.224.98.180 / 00:50:56:a9:33:9f) to 10.224.98.0/255.255.255.0 > I, [2013-07-12T15:38:49.137407 #4191] INFO -- : Enumerated hosts on > 10.224.98.0 > D, [2013-07-12T15:38:49.137636 #4191] DEBUG -- : Lazy loaded > 10.224.98.0/255.255.255.0 records > D, [2013-07-12T15:38:49.139607 #4191] DEBUG -- : Searching for free ip - > pinging 10.224.98.7 > D, [2013-07-12T15:38:51.174432 #4191] DEBUG -- : Found free ip 10.224.98.7 > out of a total of 253 free ips > [snip] > > It looks like the code is in smart-proxy / lib / proxy / dhcp / server / > isc.rb > however, I don't see it looking for range lines at all, unless I'm missing > something. > > thanks! > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/groups/opt_out. > >

โ€“
Later,

Lukas โ€œlzapโ€ Zapletal
irc: lzap #theforeman

Can you check and see if your Subnet (in the Foreman UI) has the range set?
Foreman doesn't read that info from the dhcpd.conf file, IIRC.

Greg