4.2. Configuring Capsule Server with External DHCP
To configure Capsule Server with external DHCP, you must complete the following procedures:
4.2.1. Configuring an External DHCP Server to Use with Capsule Server リンクのコピーリンクがクリップボードにコピーされました!
To configure an external DHCP server to use with Capsule Server, on a Red Hat Enterprise Linux server, you must install the ISC DHCP Service and Berkeley Internet Name Domain (BIND) packages. You must also share the DHCP configuration and lease files with Capsule Server. The example in this procedure uses the distributed Network File System (NFS) protocol to share the DHCP configuration and lease files.
If you use dnsmasq as an external DHCP server, enable the dhcp-no-override
setting. This is required because Satellite creates configuration files on the TFTP server under the grub2/
subdirectory. If the dhcp-no-override
setting is disabled, clients fetch the bootloader and its configuration from the root directory, which might cause an error.
Procedure
On a Red Hat Enterprise Linux Server server, install the ISC DHCP Service and Berkeley Internet Name Domain (BIND) packages:
yum install dhcp bind
# yum install dhcp bind
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a security token:
dnssec-keygen -a HMAC-MD5 -b 512 -n HOST omapi_key
# dnssec-keygen -a HMAC-MD5 -b 512 -n HOST omapi_key
Copy to Clipboard Copied! Toggle word wrap Toggle overflow As a result, a key pair that consists of two files is created in the current directory.
Copy the secret hash from the key:
cat Komapi_key.+*.private |grep ^Key|cut -d ' ' -f2
# cat Komapi_key.+*.private |grep ^Key|cut -d ' ' -f2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
dhcpd
configuration file for all of the subnets and add the key. The following is an example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the
option routers
value is the Satellite or Capsule IP address that you want to use with an external DHCP service.- Delete the two key files from the directory that they were created in.
On Satellite Server, define each subnet. Do not set DHCP Capsule for the defined Subnet yet.
To prevent conflicts, set up the lease and reservation ranges separately. For example, if the lease range is 192.168.38.10 to 192.168.38.100, in the Satellite web UI define the reservation range as 192.168.38.101 to 192.168.38.250.
Configure the firewall for external access to the DHCP server:
firewall-cmd --add-service dhcp \ && firewall-cmd --runtime-to-permanent
# firewall-cmd --add-service dhcp \ && firewall-cmd --runtime-to-permanent
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Satellite Server, determine the UID and GID of the
foreman
user:id -u foreman id -g foreman
# id -u foreman 993 # id -g foreman 990
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the DHCP server, create the
foreman
user and group with the same IDs as determined in a previous step:groupadd -g 990 foreman useradd -u 993 -g 990 -s /sbin/nologin foreman
# groupadd -g 990 foreman # useradd -u 993 -g 990 -s /sbin/nologin foreman
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To ensure that the configuration files are accessible, restore the read and execute flags:
chmod o+rx /etc/dhcp/ chmod o+r /etc/dhcp/dhcpd.conf chattr +i /etc/dhcp/ /etc/dhcp/dhcpd.conf
# chmod o+rx /etc/dhcp/ # chmod o+r /etc/dhcp/dhcpd.conf # chattr +i /etc/dhcp/ /etc/dhcp/dhcpd.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the DHCP service:
systemctl start dhcpd
# systemctl start dhcpd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the DHCP configuration and lease files using NFS:
yum install nfs-utils systemctl enable rpcbind nfs-server systemctl start rpcbind nfs-server nfs-lock nfs-idmapd
# yum install nfs-utils # systemctl enable rpcbind nfs-server # systemctl start rpcbind nfs-server nfs-lock nfs-idmapd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create directories for the DHCP configuration and lease files that you want to export using NFS:
mkdir -p /exports/var/lib/dhcpd /exports/etc/dhcp
# mkdir -p /exports/var/lib/dhcpd /exports/etc/dhcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create mount points for the created directories, add the following line to the
/etc/fstab
file:/var/lib/dhcpd /exports/var/lib/dhcpd none bind,auto 0 0 /etc/dhcp /exports/etc/dhcp none bind,auto 0 0
/var/lib/dhcpd /exports/var/lib/dhcpd none bind,auto 0 0 /etc/dhcp /exports/etc/dhcp none bind,auto 0 0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the file systems in
/etc/fstab
:mount -a
# mount -a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure the following lines are present in
/etc/exports
:/exports 192.168.38.1(rw,async,no_root_squash,fsid=0,no_subtree_check) /exports/etc/dhcp 192.168.38.1(ro,async,no_root_squash,no_subtree_check,nohide) /exports/var/lib/dhcpd 192.168.38.1(ro,async,no_root_squash,no_subtree_check,nohide)
/exports 192.168.38.1(rw,async,no_root_squash,fsid=0,no_subtree_check) /exports/etc/dhcp 192.168.38.1(ro,async,no_root_squash,no_subtree_check,nohide) /exports/var/lib/dhcpd 192.168.38.1(ro,async,no_root_squash,no_subtree_check,nohide)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the IP address that you enter is the Satellite or Capsule IP address that you want to use with an external DHCP service.
Reload the NFS server:
exportfs -rva
# exportfs -rva
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the firewall for the DHCP omapi port 7911:
firewall-cmd --add-port="7911/tcp" \ && firewall-cmd --runtime-to-permanent
# firewall-cmd --add-port="7911/tcp" \ && firewall-cmd --runtime-to-permanent
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Configure the firewall for external access to NFS. Clients are configured using NFSv3.
firewall-cmd --zone public --add-service mountd \ && firewall-cmd --zone public --add-service rpc-bind \ && firewall-cmd --zone public --add-service nfs \ && firewall-cmd --runtime-to-permanent
# firewall-cmd --zone public --add-service mountd \ && firewall-cmd --zone public --add-service rpc-bind \ && firewall-cmd --zone public --add-service nfs \ && firewall-cmd --runtime-to-permanent
Copy to Clipboard Copied! Toggle word wrap Toggle overflow