network off after reboot

Issues related to configuring your network
Post Reply
ron7000
Posts: 146
Joined: 2019/01/15 20:00:28

network off after reboot

Post by ron7000 » 2020/01/29 16:19:14

CentOS 7.7

My server is on a LAN. It has a simple static IP address setting.
After a reboot, the system comes up fine into graphical.target but the network does not automatically connect, it is off.
I have to manually log in at the console on the server, go to Settings - Network, and turn it on and then it works fine.
In that gui, I do have checked connect automatically but every time after boot the network is off.

I did notice, I think under /etc/sysconfig/network-scripts I am missing the corresponding ifcfg-enps11s0 file which corresponds to the output of ifconfig showing my one active network port.

I did do net.ifnames=0 in /etc/default/grub; grub2-mkconfig -o /boot/efi/efi/centos/grub.cfg to try and go back to using eth0 naming. I also have done *yum remove biosdevname*. On another identical server I am running on eth0 fine connecting automatically after boot.

But this one I am having this problem. What is the process for renewing or recreating what should be under /etc/sysconfig/network-scripts/ and making a typical ethernet connection with static IP start automatically after boot?

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: network off after reboot

Post by TrevorH » 2020/01/29 16:47:38

Both the naming and the off-by-default behaviour are part of the FAQ.

https://wiki.centos.org/FAQ/CentOS7#Why ... able_it.3F and the bullet point directly underneath that one.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

ron7000
Posts: 146
Joined: 2019/01/15 20:00:28

Re: network off after reboot

Post by ron7000 » 2020/01/30 16:45:38

unfortunately that FAQ does not help me at all. Let me explain.

Dell optiplex 7010 pc, running centos7.7
If I do ifconfig it reports my current interface name as eno1 with a valid dchp gotten ipv4 address.
How I got to "eno1" I have no idea.
It originally was "em1" with biosdevname installed and not doing net.ifnames=0 on GRUB_CMDLINE_LINUX
Under /etc/sysconfig/network-scripts/ I do not have an "ifcfg-eno1" but I do have an "ifcfg-em1" which I had copied to "ifcfg-eth0" which at some point had worked giving me eth0. But now for whatever reason I have "eno1". And on this test pc when it boots the network connects automatically.

On a different server, same details except with static PIv4 address it does not connect automatically after boot.
I have to manually log in at the console, go to Settings - Network and under WIRED it will show OFF. As root if I turn it ON then it works fine until the next reboot. If I go in to the cog wheel for WIRED settings, i have checked "connect automatically" and "make available to other users". This connect automatically seems to not be working. Under Identity I have set it to "eth0" or any other corresponding "ifcfg-xxx" file under /etc/sysconfig/network-scripts/. Am I mistaken in thinking this identity name refers to an ifcfg-xxx file?

I was under the assumption that under Application - System - Network that I would be able to fix or reconfigure all that is network related. This seems to not be the case at all.

And per the centos faq for

Code: Select all

[root@example ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=dhcp
NM_CONTROLLED="no"
PERSISTENT_DHCLIENT=1
ONBOOT="yes"
TYPE=Ethernet
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="eth0"
with the exception of bootproto=dhcp I basically have this (for multiple interface names), and it's not working :(
I don't know what to do other than completely reinstall centos, which is more or less ok on my optiplex test pc. But kind of a not gonna happen on my server- which i wanted eth0 naming on for software licensing put it's becoming a pain every time after reboot to have to manually re-enable the static ip network interface. And what seems to be the common denominator is just my server having a static ip not enabling the network automatically after boot. The 2 or 3 other [test] computers all seem to enable the network automatically but they are all dchp, one of which I don't know how I got to an "eno1" interface name.

User avatar
jlehtone
Posts: 2589
Joined: 2007/12/11 08:17:33
Location: Finland

Re: network off after reboot

Post by jlehtone » 2020/01/31 15:24:32

ron7000 wrote:
2020/01/30 16:45:38
i wanted eth0 naming on for software licensing
Isn't that a "must have" rather than "wouldn't it be nice if we had"?
It would be nice, if those taking our money would stay up to date, wouldn't it?

Note: The ifconfig (net-tools) is deprecated, obsoleted by iproute2 utilities (for two decades now?)
Furthermore, CentOS defaults to NetworkManager rather than iproute2.

GUI can be "nice", but it is limiting and hard to explain.
These I would run (first) to see what I have:

Code: Select all

systemctl status network.service
systemctl status NetworkManager.service
ip li
ip -4 ad
ip ro
nmcli
nmcli d s
nmcli c s

ron7000
Posts: 146
Joined: 2019/01/15 20:00:28

Re: network off after reboot

Post by ron7000 » 2020/02/11 22:17:59

they can have ifconfig when they pry it from my cold dead hands 8-)

afewgoodman
Posts: 58
Joined: 2019/12/11 03:51:58

Re: network off after reboot

Post by afewgoodman » 2020/03/03 08:57:58

Hi,

As I know, you should not apply net.ifname = 0 to the command-line parameter when you want ethX-style interface names in multiple NIC environments. If applied, systemd-udev will not swap with the same name as the ethX interface naming during initram-fs boot space. Therefore, some conflicts with the ethX name information in the kernel namespace occurred during the ethX rename process for the user namespace behavior of system-udev (operation by udev utilities and rules in the root filesystem). Will not match the information in. This can happen on every reboot, so you should use a custom naming other than ethX (eg net0, ...) in the net.ifname = 0 environment.

BR.

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: network off after reboot

Post by TrevorH » 2020/03/03 13:20:41

OTOH, it works. And for those of us with differing hardware where you need to boot it once just to find out what the stupid interface names are called today, sticking with the old names is usually quite a lot easier. If you also add HWADDR= to your ifcfg files, that tells it to use the right one for the right interface.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Networking Support”