3

I am unable to find eth0 in RHEL 7 after just installation. Even I created the eth0 inside the /etc/sysconfig/network-scripts/ directory. After created eth0 inside the network-scripts, I am unable to restarting network service. I run the command:

service network restart

The following error appears:

Job for network.service failed.
See systemctl status network.service and journalctl -xn for details.

Edit: more detail

After running the command systemctl status network.service, i will get the following error:

network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
   Active: failed (Result: exit-code) since Mon 2014-11-24 00:02:21 IST;
  Process: 626 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Nov 24 00:02:21 htpc.homenet network[626]: Bringing up loopback interface:[Ok]
Nov 24 00:02:21 htpc.homenet network[626]:Bringing up interface eth0 :ERROR[/etc/sysconfig/network-scripts/ifup-eth]Device does not seem to be present,delaying initialization.
Nov 24 00:02:21 htpc.homenet network[626]:network.service:control process exited,code=exited status=1
Nov 24 00:02:21 htpc.homenet network[626]: Failed to start LSB:Bringing Up/down networking
Nov 24 00:02:21 htpc.homenet network[626]:Unit network.service entered failed state
  • Did you in fact try systemctl status network.service and journalctl -xn to see the details? Add the information from that to the question. – wurtel Nov 24 '14 at 10:32
  • After running the command systemctl status network.service, i will get the following error: – Rohit Singh Nov 24 '14 at 11:06
  • 1
    Remove the changes to your network scripts and run ip link. That will show you what interface you have - they are not always labeled eth?. – garethTheRed Nov 24 '14 at 12:05
2

RHEL7 uses a delightfully capricious and arbitrary device name change, to keep things sensible for the non-server or laptop version of its OS which sustain its business (which is really the advertised reason for systemd too, albeit for questionable benefit).

It sets your networking devices like enp132s456 or so, changes them if you shuffle slots with your NIC, and without a quick fix gives anyone using Linux for the last 20 years a wonderful surprise. But they seem to think it's for the good.

grep -q ifnames /etc/sysconfig/grub ||\
sed -i~ '/^GRUB_CMDLINE_LINUX/s/"$/ net.ifnames=0"/' /etc/sysconfig/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
exec init 6

That's the fix, for now.

I hope it will continue to work as a fix, as it's a kernel thing and likely to be a feature of any new kernel we move to, systemd or no.

  • narrator: It was not a kernel thing. github.com/torvalds/linux/blob/master/Documentation/admin-guide/… – sourcejedi Mar 18 at 19:00
  • @sourcejedi - that file is 5000 lines long. If you can narrow it down, it would be more helpful and less like Oracle's software sequirements docs. ;-) – user2066657 Mar 18 at 23:11
  • You'll find this question was about RHEL7, and the net.ifnames is a boot option. Ideally, it will be knowledge portable to whatever we move to to avoid systemd as well. – user2066657 Mar 18 at 23:23
  • Yes, you set it at boot and systemd-udev reads it from /proc/cmdline. Dunno if biosdevname that used to be used in RHEL6 has been modified to understand the new boot option as well - it used to check for biosdevname=0. – sourcejedi Mar 18 at 23:30
  • Thank you for that input, but it's unnecessary; and it's tangential to the question. – user2066657 Mar 19 at 5:55
0

I was able to get the network work after just disabling and restarting the NetworkManager:

systemctl disable NetworkManager
systemctl restart NetworkManager

Worked on Rhel7

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.