In this config we are going to configure a network interface to receive an IP configuration settings from DHCP server. First get the name of the network interface you would like to set as DHCP client. To do this you can run command:
# ip addr show
2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:15:38:b7 brd ff:ff:ff:ff:ff:ff
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe15:38b7/64 scope link
valid_lft forever preferred_lft forever
Once we have located a name of the network interface in question open a corresponding configuration file. So as an example, for network interface epn0s3
vi will edit a /etc/sysconfig/network-scripts/ifcfg-enp0s3
. Open this file and enter the minimum configuration settings in order to make this network interface act as a DHCP client:
DEVICE=enp0s3
BOOTPROTO=dhcp
ONBOOT=yes
Read more