CentOS 7 minimal doesn’t get an IP address from DHCP on startup
23,414
Check that ONBOOT
is set to yes
in /etc/sysconfig/network-scripts/ifcfg-eno1677736
.
And a quick fix in case it already is—although not the best one—would be to add ifdown eno1677736; ifup eno1677736
at the bottom of /etc/rc.d/rc.local
.
Then save the file and make it executable:
chmod +x /etc/rc.d/rc.local
Now you’ll be running that command on every startup.
Related videos on Youtube
Comments
-
qin almost 2 years
I had install CentOS 7 minimal. The interface
eno1677736
is up without an IP address when the OS starts up.I restart the interface and it can obtain IP from DHCP server if I run this command:
ifdown eno1677736; ifup eno1677736
But if I reboot the OS, interface will lose the IP address.
My question is how to make the interface have an IP address automatically?
I tried configuring DHCP client as explained here.
-
Dylan Rozendom almost 8 yearsunix.stackexchange.com/questions/59789/… Have you tried it this way?
-
qin almost 8 years@DylanRz No, that way will use static ip address. But I must use ip from dhcp server.
-
Jeter-work almost 8 yearsThat interface name does not look right. Why is it so long? Was that auto assigned by centos or manually based on some organizational standard?
-
qin almost 8 years@Xalorous it's assigned by centos. I just use a VMware Fusion vm.
-
Jeter-work almost 8 yearsOh, ok. I'm still adjusting to the consistent device naming, expecting some other sort of string.
-
-
qin almost 8 yearsOh, I have double check the
ONBOOT
before I ask. However I still left itno
which I thought ason