When installing foreman, I've used the installer to setup a dhcp service on
the same host. I define a network, a subnet range, name server, router, dns
search domain, etc everything you'd expect in a dhcp service, and it works
just fine.
When going into the smart proxy and clicking "import IPV4 subnets" the dhcp
configuration I've defined by the installer is detected and displayed in
the menu ready for import.
However there are fields / parameters missing from the foreman page that
are defined in the dhcp configuration on the file system.
As I'm having a seperate dhcp issue on this host where foreman offers IP's
that are already in the lease file, I thought trying to understand how the
smart proxy builds the settings it imports into foreman.
For example, I have the following dhcp config (that was generated by the
foreman installer) this is all private data on a test machine that gets
auto rebuilt most nights, so please don't worry about it being shared.
dhcpd.conf
omapi-port 7911;
key jarvis_omapi.key {
algorithm HMAC-MD5;
secret
"FFgje7gnbnsZZMBg72cYgdAGsUl6GTAdXZ+3SmwtTA13cgmHOY/UqSErvXnPppL3qwh35Ya0y7ZNrTTghQw4kbAQ==";
}
omapi-key swallow_omapi.key;
default-lease-time 43200;
max-lease-time 86400;
ddns-update-style none;
option domain-name "no-dns.local";
option domain-name-servers 192.168.10.1;
option ntp-servers none;
allow booting;
allow bootp;
option fqdn.no-client-update on; # set the "O" and "S" flag bits
option fqdn.rcode2 255;
option pxegrub code 150 = text ;
Bootfile Handoff
next-server 192.168.10.4;
option architecture code 93 = unsigned integer 16 ;
if option architecture = 00:06 {
filename "grub2/shim.efi";
} elsif option architecture = 00:07 {
filename "grub2/shim.efi";
} elsif option architecture = 00:09 {
filename "grub2/shim.efi";
} else {
filename "pxelinux.0";
}
log-facility local7;
include "/etc/dhcp/dhcpd.hosts";
no-dns.local
subnet 192.168.10.0 netmask 255.255.255.0 {
pool
{
range 192.168.10.30 192.168.10.254;
}
option subnet-mask 255.255.255.0;
option routers 192.168.10.1;
option domain-search "no-dns.local";
}
As you can see there is a range defined and there are name servers
defined.when I import the subnet, the name servers are missing. (see screen
shot attached).
I'm trying to understand how this import is worked out, does it just take
the IP details of the host it's running on, or does it try to do something
a bit smarter, such as parse the dhcpd.config it's generated / answer file
that was used to install foreman ?
I suspect it's nothing as advanced as that (I've not found it properly in
the code yet) as when I set the IP management to dhcp in the subnet menu,
it doens't auto fill in the range for me, I have to manually put it in,
suggesting it's not really parsed the dhcpd.conf or take it in from the
foreman installer options.
understanding this may assist with working through why my 1.15 install is
offering new host with IP's that are already defined in the dhcp lease file.
thanks,
Matt