Fresh Foreman 1.15.0 install dhcp subnet issue

Hi, I've setup a prototype environment using Virtualbox with Nat Network.
The Foreman VM is CentOS 7.3, I've installed foreman 1.15.0 with puppet
4.10, so I can play with Hiera 5.

Anyway, my installer command line is this:

foreman-installer --foreman-proxy-dhcp=true --foreman-proxy-dhcp-gateway=
'192.168.2.1' --foreman-proxy-dhcp-managed=true
–foreman-proxy-dhcp-nameservers='192.168.2.10' --foreman-proxy-dhcp-option-
domain='demo.local'
–foreman-proxy-dhcp-pxeserver='192.168.2.10' --foreman-proxy-dhcp-range='192.168.2.20
192.168.2.50'
–foreman-proxy-dhcp-search-domains='demo.local' --foreman-proxy-dhcp-server
='192.168.2.10' --foreman-proxy-dns=true
–foreman-proxy-dns-forwarders=8.8.8.8 --foreman-proxy-dns-forwarders=8.8.
4.4 --foreman-proxy-dns-managed=true
–foreman-proxy-dns-reverse='2.168.192.in-addr.arpa' --foreman-proxy-dns-
server='192.168.2.10'
–foreman-proxy-dns-ttl='360' --foreman-proxy-dns-zone='demo.local' –
foreman-unattended=true --foreman-use-vhost=true
–foreman-proxy-dhcp-provider='isc'–foreman-proxy-dns-provider='nsupdate'
–foreman-proxy-puppet=true
–foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true --puppet-agent=
true --puppet-autosign-entries='*.demo.local'
–puppet-server=true --puppet-server-ca=true --enable-foreman --enable-
foreman-proxy --enable-puppet

The installer throws an error when trying to start the dhcpd service…

May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address
192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255
May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main process
exited, code=exited, status=1/FAILURE

Basically, the installer isn't defining the dhcp subnet correctly and
here's what the subnet in dhcpd.conf looks like:

demo.local

subnet 192.168.2.10 netmask 255.255.255.255 {
pool
{
range 192.168.2.20 192.168.2.50;
}

option subnet-mask 255.255.255.255;
option routers 192.168.2.1;
option domain-search "demo.local";
}

Any idea why the installer is defining the subnet as a single ip address?

Sorry, I should have mentioned that the Virtualbox Nat Network's gateway is
192.168.2.1 and it has dhcp disabled. Also, the foreman server's IP
address is 192.168.2.10.

–Sean

··· On Wed, May 31, 2017 at 10:02 AM, Sean A wrote:

Hi, I’ve setup a prototype environment using Virtualbox with Nat Network.
The Foreman VM is CentOS 7.3, I’ve installed foreman 1.15.0 with puppet
4.10, so I can play with Hiera 5.

Anyway, my installer command line is this:

foreman-installer --foreman-proxy-dhcp=true --foreman-proxy-dhcp-gateway=‘
192.168.2.1’ --foreman-proxy-dhcp-managed=true
–foreman-proxy-dhcp-nameservers=‘192.168.2.10’ --foreman-proxy-dhcp-
option-domain=‘demo.local’
–foreman-proxy-dhcp-pxeserver=‘192.168.2.10’ --foreman-proxy-dhcp-range=‘192.168.2.20
192.168.2.50’
–foreman-proxy-dhcp-search-domains=‘demo.local’ --foreman-proxy-dhcp-
server=‘192.168.2.10’ --foreman-proxy-dns=true
–foreman-proxy-dns-forwarders=8.8.8.8 --foreman-proxy-dns-forwarders=8.8.
4.4 --foreman-proxy-dns-managed=true
–foreman-proxy-dns-reverse=‘2.168.192.in-addr.arpa’ --foreman-proxy-dns-
server=‘192.168.2.10’
–foreman-proxy-dns-ttl=‘360’ --foreman-proxy-dns-zone=‘demo.local’ –
foreman-unattended=true --foreman-use-vhost=true
–foreman-proxy-dhcp-provider=‘isc’–foreman-proxy-dns-provider=‘nsupdate’
–foreman-proxy-puppet=true
–foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true --puppet-agent
=true --puppet-autosign-entries=’*.demo.local’
–puppet-server=true --puppet-server-ca=true --enable-foreman --enable-
foreman-proxy --enable-puppet

The installer throws an error when trying to start the dhcpd service…

May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address
192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255
May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main process
exited, code=exited, status=1/FAILURE

Basically, the installer isn’t defining the dhcp subnet correctly and
here’s what the subnet in dhcpd.conf looks like:

demo.local

subnet 192.168.2.10 netmask 255.255.255.255 {
pool
{
range 192.168.2.20 192.168.2.50;
}

option subnet-mask 255.255.255.255;
option routers 192.168.2.1;
option domain-search “demo.local”;
}

Any idea why the installer is defining the subnet as a single ip address?


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/foreman-users/2G1mQWMo1u0/unsubscribe.
To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

It works here, here is my command:

SATNET=122
–foreman-proxy-dhcp true
–foreman-proxy-dhcp-interface virbr1
–foreman-proxy-dhcp-gateway=192.168.${SATNET}.1
–foreman-proxy-dhcp-range="192.168.${SATNET}.10 192.168.${SATNET}.109"
–foreman-proxy-dhcp-nameservers="192.168.${SATNET}.1" \

Make sure you provide foreman-proxy-dhcp-interface and it has correct
IP and mask.

··· On Wed, May 31, 2017 at 4:09 PM, Sean wrote: > Sorry, I should have mentioned that the Virtualbox Nat Network's gateway is > 192.168.2.1 and it has dhcp disabled. Also, the foreman server's IP address > is 192.168.2.10. > > > --Sean > > On Wed, May 31, 2017 at 10:02 AM, Sean A wrote: >> >> Hi, I've setup a prototype environment using Virtualbox with Nat Network. >> The Foreman VM is CentOS 7.3, I've installed foreman 1.15.0 with puppet >> 4.10, so I can play with Hiera 5. >> >> Anyway, my installer command line is this: >> >> foreman-installer --foreman-proxy-dhcp=true >> --foreman-proxy-dhcp-gateway='192.168.2.1' --foreman-proxy-dhcp-managed=true >> \ >> --foreman-proxy-dhcp-nameservers='192.168.2.10' >> --foreman-proxy-dhcp-option-domain='demo.local' \ >> --foreman-proxy-dhcp-pxeserver='192.168.2.10' >> --foreman-proxy-dhcp-range='192.168.2.20 192.168.2.50' \ >> --foreman-proxy-dhcp-search-domains='demo.local' >> --foreman-proxy-dhcp-server='192.168.2.10' --foreman-proxy-dns=true \ >> --foreman-proxy-dns-forwarders=8.8.8.8 >> --foreman-proxy-dns-forwarders=8.8.4.4 --foreman-proxy-dns-managed=true \ >> --foreman-proxy-dns-reverse='2.168.192.in-addr.arpa' >> --foreman-proxy-dns-server='192.168.2.10' \ >> --foreman-proxy-dns-ttl='360' --foreman-proxy-dns-zone='demo.local' >> --foreman-unattended=true --foreman-use-vhost=true \ >> --foreman-proxy-dhcp-provider='isc'--foreman-proxy-dns-provider='nsupdate' >> --foreman-proxy-puppet=true \ >> --foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true >> --puppet-agent=true --puppet-autosign-entries='*.demo.local' \ >> --puppet-server=true --puppet-server-ca=true --enable-foreman >> --enable-foreman-proxy --enable-puppet >> >> The installer throws an error when trying to start the dhcpd service... >> >> May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address >> 192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255 >> May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main process >> exited, code=exited, status=1/FAILURE >> >> Basically, the installer isn't defining the dhcp subnet correctly and >> here's what the subnet in dhcpd.conf looks like: >> >> # demo.local >> subnet 192.168.2.10 netmask 255.255.255.255 { >> pool >> { >> range 192.168.2.20 192.168.2.50; >> } >> >> >> option subnet-mask 255.255.255.255; >> option routers 192.168.2.1; >> option domain-search "demo.local"; >> } >> >> Any idea why the installer is defining the subnet as a single ip address? >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Foreman users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/foreman-users/2G1mQWMo1u0/unsubscribe. >> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. > > > -- > 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 https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

Thanks for the reply, Lukas. It's possible I ran the command above using
the --foreman-proxy-dhcp-subnet='192.168.2.0/24', and it seems using the
CIDR notation doesn't work. I started fresh again, with the same installer
args and reproduced it, then tried the installer again with
–foreman-proxy-dhcp-subnet='192.168.2.0/255.255.255.0' and this seems to
resolve the issue.

The interface error is blatantly obvious since it's defaults to eth0, even
if no eth0 exists on the system. Seems like some logic could be used to
match the ipaddress fact to an interface and set that interface as the
default for both dns and dhcp components…but I'm sure if it was that
simple it would have been done already.

Anyway, I don't understand why using the CIDR notation would create a
255.255.255.255 subnet for the host's IP.

··· On Thursday, June 1, 2017 at 10:03:43 AM UTC-4, Lukas Zapletal wrote: > > It works here, here is my command: > > SATNET=122 > --foreman-proxy-dhcp true \ > --foreman-proxy-dhcp-interface virbr1 \ > --foreman-proxy-dhcp-gateway=192.168.${SATNET}.1 \ > --foreman-proxy-dhcp-range="192.168.${SATNET}.10 192.168.${SATNET}.109" > \ > --foreman-proxy-dhcp-nameservers="192.168.${SATNET}.1" \ > > Make sure you provide foreman-proxy-dhcp-interface and it has correct > IP and mask. > > > > On Wed, May 31, 2017 at 4:09 PM, Sean <smal...@gmail.com > > wrote: > > Sorry, I should have mentioned that the Virtualbox Nat Network's gateway > is > > 192.168.2.1 and it has dhcp disabled. Also, the foreman server's IP > address > > is 192.168.2.10. > > > > > > --Sean > > > > On Wed, May 31, 2017 at 10:02 AM, Sean A > wrote: > >> > >> Hi, I've setup a prototype environment using Virtualbox with Nat > Network. > >> The Foreman VM is CentOS 7.3, I've installed foreman 1.15.0 with puppet > >> 4.10, so I can play with Hiera 5. > >> > >> Anyway, my installer command line is this: > >> > >> foreman-installer --foreman-proxy-dhcp=true > >> --foreman-proxy-dhcp-gateway='192.168.2.1' > --foreman-proxy-dhcp-managed=true > >> \ > >> --foreman-proxy-dhcp-nameservers='192.168.2.10' > >> --foreman-proxy-dhcp-option-domain='demo.local' \ > >> --foreman-proxy-dhcp-pxeserver='192.168.2.10' > >> --foreman-proxy-dhcp-range='192.168.2.20 192.168.2.50' \ > >> --foreman-proxy-dhcp-search-domains='demo.local' > >> --foreman-proxy-dhcp-server='192.168.2.10' --foreman-proxy-dns=true \ > >> --foreman-proxy-dns-forwarders=8.8.8.8 > >> --foreman-proxy-dns-forwarders=8.8.4.4 --foreman-proxy-dns-managed=true > \ > >> --foreman-proxy-dns-reverse='2.168.192.in-addr.arpa' > >> --foreman-proxy-dns-server='192.168.2.10' \ > >> --foreman-proxy-dns-ttl='360' --foreman-proxy-dns-zone='demo.local' > >> --foreman-unattended=true --foreman-use-vhost=true \ > >> > --foreman-proxy-dhcp-provider='isc'--foreman-proxy-dns-provider='nsupdate' > >> --foreman-proxy-puppet=true \ > >> --foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true > >> --puppet-agent=true --puppet-autosign-entries='*.demo.local' \ > >> --puppet-server=true --puppet-server-ca=true --enable-foreman > >> --enable-foreman-proxy --enable-puppet > >> > >> The installer throws an error when trying to start the dhcpd service... > >> > >> May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address > >> 192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255 > >> May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main > process > >> exited, code=exited, status=1/FAILURE > >> > >> Basically, the installer isn't defining the dhcp subnet correctly and > >> here's what the subnet in dhcpd.conf looks like: > >> > >> # demo.local > >> subnet 192.168.2.10 netmask 255.255.255.255 { > >> pool > >> { > >> range 192.168.2.20 192.168.2.50; > >> } > >> > >> > >> option subnet-mask 255.255.255.255; > >> option routers 192.168.2.1; > >> option domain-search "demo.local"; > >> } > >> > >> Any idea why the installer is defining the subnet as a single ip > address? > >> > >> -- > >> You received this message because you are subscribed to a topic in the > >> Google Groups "Foreman users" group. > >> To unsubscribe from this topic, visit > >> https://groups.google.com/d/topic/foreman-users/2G1mQWMo1u0/unsubscribe. > > >> To unsubscribe from this group and all its topics, send an email to > >> foreman-user...@googlegroups.com . > >> To post to this group, send email to forema...@googlegroups.com > . > >> Visit this group at https://groups.google.com/group/foreman-users. > >> For more options, visit https://groups.google.com/d/optout. > > > > > > -- > > 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-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com > . > > Visit this group at https://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > Later, > Lukas @lzap Zapletal >