8

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.

  • unix.stackexchange.com/questions/59789/… Have you tried it this way? – Dylan Rozendom Sep 29 '16 at 9:48
  • @DylanRz No, that way will use static ip address. But I must use ip from dhcp server. – qin Sep 29 '16 at 9:50
  • That interface name does not look right. Why is it so long? Was that auto assigned by centos or manually based on some organizational standard? – Xalorous Sep 30 '16 at 12:47
  • @Xalorous it's assigned by centos. I just use a VMware Fusion vm. – qin Sep 30 '16 at 13:22
  • Oh, ok. I'm still adjusting to the consistent device naming, expecting some other sort of string. – Xalorous Sep 30 '16 at 13:33
10

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.

| improve this answer | |
  • Oh, I have double check the ONBOOT before I ask. However I still left it no which I thought as on – qin Sep 30 '16 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.