Bug 1490443 - Satellite-installer --foreman-proxy-dhcp-interface don't configure properly dhcpd interface on Rhel7
Summary: Satellite-installer --foreman-proxy-dhcp-interface don't configure properly d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.2.11
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.4.0
Assignee: Ewoud Kohl van Wijngaarden
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-11 14:45 UTC by Franck Grosjean
Modified: 2022-03-13 14:25 UTC (History)
6 users (show)

Fixed In Version: foreman-installer-1.17.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:35:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20912 0 Normal Closed Satellite-installer --foreman-proxy-dhcp-interface don't configure properly dhcpd interface on Rhel7 2020-11-06 19:22:38 UTC

Description Franck Grosjean 2017-09-11 14:45:40 UTC
Description of problem:

--foreman-proxy-dhcp-interface eth1 switch add interface name (eth1) to /etc/sysconfig/dhcpd. It work on Rhel6 but not on Rhel7 since this configuration file is ignored by systemctl

Version-Release number of selected component (if applicable):

Red Hat Satellite 6.2.11 and Red Hat Enterprise 7.x

How reproducible:

Install a Rhel 7 server and Red Hat Satellite 6.2 with switch --foreman-proxy-dhcp-interface to a specific interface

Steps to Reproduce:
1. Install a Rhel 7
2. Install Red Hat Satellite 6.2 with switch --foreman-proxy-dhcp-interface
3. Checks arguments on dhcpd command line with ps
4. Checks dhcpd listening interface with netstat or lsof

Actual results:

dhcpd listen on all interfaces even with -foreman-proxy-dhcp-interface switch

Expected results:

dhcpd should listen on a specifique interface and not complain about unconfigured networks from any other interfaces

Additional info:

On RHEL 7.x (or systemd compliant os) /etc/sysconfig/dhcpd should not be configured and something like followinf commands should be done (example with eth1)

#> sed 's|^ExecStart=.*$|& eth1|' /usr/lib/systemd/system/dhcpd.service > /etc/systemd/system/dhcpd.service
#> systemctl --system daemon-reload

cf : https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-dhcp-configuring-server.html

#> systemctl status dhcpd
● dhcpd.service - DHCPv4 Server Daemon
   Loaded: loaded (/etc/systemd/system/dhcpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2017-09-11 15:46:11 CEST; 9s ago
     Docs: man:dhcpd(8)
           man:dhcpd.conf(5)
 Main PID: 3236 (dhcpd)
   Status: "Dispatching packets..."
   CGroup: /system.slice/dhcpd.service
           └─3236 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid eth1  <---- here eth1 

journalctl -u dhcpd
dhcpd[3236]: Internet Systems Consortium DHCP Server 4.2.5
dhcpd[3236]: Copyright 2004-2013 Internet Systems Consortium.
dhcpd[3236]: All rights reserved.
dhcpd[3236]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[3236]: Wrote 0 leases to leases file.
dhcpd[3236]: Listening on LPF/eth1/52:54:00:86:19:3a/10.100.100.0/24   <----- listen
dhcpd[3236]: Sending on   LPF/eth1/52:54:00:86:19:3a/10.100.100.0/24   <----- answers
dhcpd[3236]: Sending on   Socket/fallback/fallback-net
systemd[1]: Started DHCPv4 Server Daemon.

instead of 

systemd[1]: Starting DHCPv4 Server Daemon...
dhcpd[5656]: Internet Systems Consortium DHCP Server 4.2.5
dhcpd[5656]: Copyright 2004-2013 Internet Systems Consortium.
dhcpd[5656]: All rights reserved.
dhcpd[5656]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[5656]: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
dhcpd[5656]: Internet Systems Consortium DHCP Server 4.2.5
dhcpd[5656]: Copyright 2004-2013 Internet Systems Consortium.
dhcpd[5656]: All rights reserved.
dhcpd[5656]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[5656]: Wrote 0 leases to leases file.
dhcpd[5656]: Listening on LPF/eth1/52:54:00:86:19:3a/10.100.100.0/24
dhcpd[5656]: Sending on   LPF/eth1/52:54:00:86:19:3a/10.100.100.0/24
dhcpd[5656]: 
dhcpd[5656]: No subnet declaration for eth0 (10.100.1.20).       <------ listen on eth0 and eth1 and complain
dhcpd[5656]: ** Ignoring requests on eth0.  If this is not what          about undefined network in dhcpd.conf
dhcpd[5656]:    you want, please write a subnet declaration
dhcpd[5656]:    in your dhcpd.conf file for the network segment
dhcpd[5656]:    to which interface eth0 is attached. **
dhcpd[5656]: 
dhcpd[5656]: Sending on   Socket/fallback/fallback-net
systemd[1]: Started DHCPv4 Server Daemon.

Comment 4 Ivan Necas 2017-09-13 05:58:44 UTC
Ewould: any thoughts on how to deal with this in the installer: it seems like we would need to manage the systemd service file, in order to achieve this.

Comment 5 Ewoud Kohl van Wijngaarden 2017-09-13 09:49:15 UTC
This was on my radar for a while because of the intent to merge theforeman/dhcp with voxpupuli/dhcp and they have https://github.com/voxpupuli/puppet-dhcp/pull/129. Sadly it fell off again.

I would prefer a drop in file rather than fully managing the service file but in essence we need to override the ExecStart one way or another as suggested by Franck.

Comment 6 Ivan Necas 2017-09-13 13:19:55 UTC
Created redmine issue http://projects.theforeman.org/issues/20912 from this bug

Comment 7 Satellite Program 2017-09-14 14:16:04 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20912 has been resolved.

Comment 14 Lukáš Hellebrandt 2018-07-24 15:07:33 UTC
Verified using Sat 6.4 snap 13.

#satellite-installer --scenario satellite --foreman-proxy-dhcp true --foreman-proxy-dhcp-interface eno2 --foreman-proxy-dhcp-range '[...]' --foreman-proxy-dhcp-gateway [...]

# ps ax | grep [d]hcpd
14506 ?        Ss     0:00 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid eno2

# journalctl -u dhcpd | grep Listening
Jul 24 16:13:08 ibm-hs22-04.rhts.eng.brq.redhat.com dhcpd[14506]: Listening on LPF/eno2/<mac>/<ip>/20

# netstat -plnt | grep dhcpd
tcp        0      0 0.0.0.0:7911            0.0.0.0:*               LISTEN      5608/dhcpd

Although the netstat input shows that dhcpd is listening on all interfaces, I think that's correct based on https://serverfault.com/questions/812892/cant-bind-isc-dhcp-server-to-interface

Comment 15 Bryan Kearney 2018-10-16 19:35:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927


Note You need to log in before you can comment on or make changes to this bug.