10

In my CentOS, i need to run dhclient -v command at every time i start/reboot the server. How to make this permanent please?

2 Answers 2

20

In CentOS, put the following into /etc/sysconfig/network-scripts/ifcfg-ethX:

DEVICE=ethX
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=XX:XX:XX:XX:XX:XX

Of course change ethX to your interface name (eth0, eth1 or similar).

Similarly, change HWADDR to yours interface MAC address. You can see it by looking at the output of ifconfig -a command (the part after HWaddr keyword).

0
2

Had a similar issue. dhclient wouldn't start on boot, even though the config looked to be correct. After a while i remembered that this is case sensitive.

BOOTPROTO=DHCP

will not start your dhclient on boot.

BOOTPROTO=dhcp

The value needs to be lowercase.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .