Cheat Sheets

Network - No DHCP Clients

Description

Production servers should not use DHCP to assign IPs

Tags

  • CCE-27021-5

Check Script: network-no-dhcp-client.sh

#!/bin/bash

# solution: Configure a static IP

if /bin/grep -q '^iface.*dhcp' /etc/network/interfaces /etc/network/interfaces.d/* >/dev/null 2>&1; then result_failed "Found DHCP configured interfaces." else result_ok fi