CentOS 8 Network-scripts

Home » CentOS » CentOS 8 Network-scripts
CentOS 31 Comments

I have need to use the old network-scripts and not NetworkManager.

I did yum install network-scripts, I have ifcfg-eth0 set for ONBOOT=yes but it is not starting on boot.

What have I missed ?

Jerry

31 thoughts on - CentOS 8 Network-scripts

  • AT BOOT:
    ● network.service – LSB: Bring up/down networking
    Loaded: loaded (/etc/rc.d/init.d/network; generated)
    Active: inactive (dead)
    Docs: man:systemd-sysv-generator(8)

    After: service network restart
    ● network.service – LSB: Bring up/down networking
    Loaded: loaded (/etc/rc.d/init.d/network; generated)
    Active: active (running) since Thu 2019-10-03 15:12:05 EDT; 7s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 7755 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)
    Tasks: 1 (limit: 24034)
    Memory: 8.7M
    CGroup: /system.slice/network.service
    └─7940 /sbin/dhclient -1 -q -lf
    /var/lib/dhclient/dhclient-6ada23ed-d1ad-4f37-935c-86163fe61e7b-eth0.lease
    -pf /run/dhclient-eth0.pid eth0

    Oct 03 15:12:02 localhost.localdomain network[7755]: WARN : [network]
    ‘network-scripts’ will be removed in one of the next major releases of RHEL. Oct 03 15:12:02 localhost.localdomain network[7755]: WARN : [network]
    It is advised to switch to ‘NetworkManager’ instead for network management. Oct 03 15:12:02 localhost.localdomain network[7755]: [46B blob data]
    Oct 03 15:12:02 localhost.localdomain network[7755]: Bringing up interface eth0:
    Oct 03 15:12:02 localhost.localdomain dhclient[7907]: DHCPREQUEST on eth0
    to 255.255.255.255 port 67 (xid=0x75ae6376)
    Oct 03 15:12:02 localhost.localdomain dhclient[7907]: DHCPACK from 10.0.2.2
    (xid=0x75ae6376)
    Oct 03 15:12:04 localhost.localdomain dhclient[7907]: bound to 10.0.2.15 —
    renewal in 34365 seconds. Oct 03 15:12:04 localhost.localdomain network[7755]: Determining IP
    information for eth0… done. Oct 03 15:12:04 localhost.localdomain network[7755]: [13B blob data]
    Oct 03 15:12:05 localhost.localdomain systemd[1]: Started LSB: Bring up/down networking.

    Contents of ifcfg-eth0
    # Generated by parse-kickstart TYPE=”Ethernet”
    DEVICE=”eth0″
    UUID=”6ada23ed-d1ad-4f37-935c-86163fe61e7b”
    ONBOOT=”yes”
    BOOTPROTO=”dhcp”
    IPV6INIT=”yes”

    Why is it not starting at boot ?
    Thanks,

    Jerry

  • I’d take a look at what NetworkManager thinks about it:

    nmicli connection show eth0 | grep autoconnect:

    If it’s not set to ‘yes’, then you’ll want to do so:

    nmcli connection modify eth0 connection.autoconnect yes

    As to the ‘why,’ I don’t know. Here’s the official explanation:

    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_networking/index#configuring-an-interface-with-static-network-settings-using-ifcfg-files_configuring-ip-networking-with-ifcfg-files


    Paul Heinlein heinlein@madboa.com
    45°38′ N, 122°6′ W

  • In ifcfg-eth0 you need:
    NM_CONTROLED=NO

    and/or to disable NetworkManager:

    systemctl stop NetworkManager.service systemctl disable NetworkManager.service


    Ljubomir Ljubojevic
    (Love is in the Air)
    PL Computers Serbia, Europe

    StarOS, Mikrotik and CentOS/RHEL/Linux consultant

  • On 10/4/19 12:27 PM, Jim Perrin wrote:> Why? I’d like to understand more about the use case where this is a requirement.I’d say for the sake of simplicity…Why complicate things with NM when you only need to set an IP ?The ifconfig files were great.Why is the choice, to use or not to use NM, not left the en end user ?That is the question…

  • One example we have is qemu virtual machine hosts where setting up the bridge in the ifcfg scripts is easier and avoiding NetworkManager messing things up in a non-intuitive way is critical.

    Also, we have 150+ machines with fixed IP addresses, always-on connections, and no wireless. Having NetworkManager do seemingly random things is not desirable.

    FWIW we disable NetworkManager with systemctl in our potinstall kickstart scripts and it seems to do what we want.

  • Almost all use Network Manager because it can be context/network sensitive and is tied to systemd along with Firewald.

    I do not like NM, but it is here to stay.

  • +1

    Bridge for VM’s is main reason I hate NM. I now mess with both NM and br0 controled by network because I use Windows VM on my laptop. As soon as you disconnect LAN cable your eth and bridge connection are gone and stupid KVM can not recover and reconnect to newly activated bridge when you return LAN cable, even only a second later…

  • +1

    My impression is younger generation doesn’t value rules that programmers were following 2-3 decades ago. One of which is:

    Do not make any changes [in the program] unless they are absolutely necessary.

    This rule was helping to not introduce new bugs. Debugging is really expensive process (that is why it often gets abridged in favor of spending effort on yet more “new features” – see, e.g. firefox and friends).

    Yet one more thing is: building superstructure on top of what actually works. NM is one of examples. Printer configuration tool is another
    (whereas CUPS web interface – http://localhost:631 – is same simple, and is even better). I understand potential goal: to give newcomers the way to handle thing (by pointing, clicking and “it works” ;-). But there is a limit to the extent Linux can steal Microsoft’s userbase. At some point having your machine behave as iPad gets so annoying that some Linux folks flee either their DE (Desktop Environment) to something
    “more traditional”, e.g. mate; or some go lengths, and flee their workstations and laptops to one of BSD descendents (my main system on laptop is FreeBSD, though it also boots to MS Windows and Ubuntu Linux).

    I know it sounds like a rant, but I decided against putting rant tags on this one.

    Valeri

  • Hmmmm….. Description :
    This adds a NetworkManager configuration file to make it behave more like the old “network” service. In particular, it stops NetworkManager from automatically running DHCP on unconfigured ethernet devices, and allows connections with static IP addresses to be brought up even on ethernet devices with no carrier.

    This package is intended to be installed by default for server deployments.
    ++++++++++
    Well, learn something new every day…. nice.

  • It is the same evolution you see in other industries. Auto mechanics constantly complain about how the newer generation is ‘dumber’ for not knowing the beauty of a vehicle that the mechanic had when they were in their teens. [Of course they also rail on the fact that their grandparents car was a complete junk that was too simple to work.]
    Most of the tools we had 30 years ago in computers are like working on a Model T era vehicle. They allowed for a lot of configuration choices and fine tuning but they also were limited vastly in other ways. You can’t run a fleet of 1000 Model TT trucks made in 1923 as well as you could 1000 1933 trucks. You ended up losing some of the knowledge of hand-crafting your own gears but you got the ability to go faster, carry heavier loads and better gas mileage without working as hard at getting a mile out of a quart.

    The transmissions of the 1933 were considered ‘automatic’ compared to some 1912 vehicles.. even if you had a clutch because you no longer had to get out and turn something to make it go in reverse. The
    ‘truly’ automatic transmissions of the 1950’s were horrible and it wasn’t until the 1970’s where they became ‘liveable’. Today trying to find a real stick shift is almost impossible as you find out that the most are really talking to a computer which does the shifting when it decides is optimal.

    As that happens the place where a programmer makes changes goes higher and higher. They no longer see a system by itself but see 10,000 nodes sitting in some cloud. They really could care less if 10% of them drop off because there is a tool which is going ot bring 1000 back online when that happens. However they may still be worrying about making a change ‘low’ level to them. It is just light years above where those of us with only 10 or a 100 systems can dream about.

  • It is OK if your KVM host is on LAN cable that never is disconnected or power goes down. But I have a laptop I use first at work where I use LAN and then at home where I use WLAN only, and suspending laptop is same as disconnecting LAN, bridge is disabled and KVM bridged network unhooked, and you can never reinitialize it without at least restarting kvm, and full treatmant is shuting down VM, restarting NM then network then starting VM again… So I just shutdown VM and laptop and boot everey itme I
    move. Maybe I can change this behavior now.


    Ljubomir Ljubojevic
    (Love is in the Air)
    PL Computers Serbia, Europe

    StarOS, Mikrotik and CentOS/RHEL/Linux consultant

  • I have VM in NAT mode mostly these days, but sometimes I need bridged network to recognize some hardware on the network, Mikrotik WiFi routers or printers so I need ability to go to bridge.

    If this with NetworkManager-config-server package works, I can at most times (if I want) plug a LAN to my laptop and be happy. I do not use LUKS so suspend until I get home 10 minutes later is ok.

    I have Dell Vostro 15 with Core i7, 12GB RAM and 512GB SSD + 1TB HDD


    Ljubomir Ljubojevic
    (Love is in the Air)
    PL Computers Serbia, Europe

    StarOS, Mikrotik and CentOS/RHEL/Linux consultant

  • I wonder if it is possible to do what I do on FreeBSD laptop: there I
    created link aggregation interface which includes wired adapter and wireless one (in that priority order), making networking acting “as smart as macintosh does ;-) “. I’m sure one of Linux Experts can point us in right direction (at the moment I just use GUI applet to enable interfaces etc).

    Valeri


    ++++++++++++++++++++++++++++++++++++++++
    Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247
    ++++++++++++++++++++++++++++++++++++++++

  • I’ve kludged together a solution for those times here by using the NAT
    connection, but then running an OpenVPN client on the guest to an OpenVPN server with layer-2 adjacency to those sorts of devices.

  • Don’t run systemctl disable NetworkManager. You need to mask the service to ensure interdependent services are not starting it up for you behind you back. i.e. systemctl mask NetworkManager Also, when you start it ensure it is set to start on boot. e.g. systemctl enable –now network

    Finally, heed the advice in the log. this is going away. I’ve had very few issues with NetworkManager since ~7.4 onward and would suggest giving it a go. I find it much easier to work with in scripts.

    Tris

  • I also have OpenVPN server (on Mikrotik router in our office) and OpenVPN client in Windows VM and I use it in the same maner as you do :-)


    Ljubomir Ljubojevic
    (Love is in the Air)
    PL Computers Serbia, Europe

    StarOS, Mikrotik and CentOS/RHEL/Linux consultant

  • I mention this every time people bash NetworkManager on servers.

    I have NM set up on all our servers. Why? Because the legacy network-scripts service tries to bring up the interface once on boot. We had a power outage to the entire floor of our datacenter and the linux systems booted faster than the network infrastructure. Any linux system not using NM tried to bring up the interface, saw that there was no connection, and gave up. We had to physically reboot those hosts. Systems running NM dynamically brought up their interface when the interface became active.

  • This is a bit orthogonal, though. (Witness the effort to remove systemd requirements from containers.) An engineer is expected to understand the component parts rationally to arrive at some sort of professional conclusion that something is likely to work properly. This is not helped by a switch from imperative and deterministic to declarative and dynamic, which underlies many of the changes we’ve had to deal with in the past decade. There is a time and place for the latter, and it’s good to have options available… but there are many times and places
    (especially in the Enterprise space) where the opposite is necessary, and it’s FAR more reasonable to layer dynamic manipulation on top of a deterministically-configured core than the other way around.

    -jc

  • On the other hand, most of the idea that the old config scripts were deterministic and imperative was built on a large amount of hacks to try and make it so. Having spent more time than I want dealing with systems which seem to be just like everything else but coming up with eth0 being eth4 (I am looking at you 40 Dell, HP and IBM boxes) on a reboot half the time.. I have come to see that a lot of scripts are full of race conditions and slowdowns to try and stop those race conditions from happening. If anything messed up from a kernel change, bios update, a switch update?, etc and you could be completely in the weeds wondering why imperative was failing. It was failing because it was never absolutely true.

    The problem is that as hardware rollouts have grown larger and larger spending time trying to figure out why 400 to 1000 out of 10,000
    systems are weird.. is too much time. You want something which will try to figure it out itself and do the ‘right’ thing.. even if it means that eth4 on those 400 boxes are now the main interface versus the eth0 on the 3600. And yes.. as an non-neurotypical person.. I find that incredibly infuriating.. however I have also realized that most businesses don’t care I and others find it that way. They just want those 10,000 to 100,000 systems to come up and work.

  • And this is where big guys with thousand of boxes win, and us small guys with few dozens of boxes have to learn what works for big guys, and use it on our small scale. And no, this is not a rant, it is just realization of the reality, so I can adjust to it.

    Thanks everybody, this was insightful – for me.

    Valeri

    ++++++++++++++++++++++++++++++++++++++++
    Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247
    ++++++++++++++++++++++++++++++++++++++++

  • Especially with production programs.

    Technically it was never an “upgrade” but a brand new and alternative system.

    With a minimum of 3 tapes; disks had not been invented. Some British universities had a magnetic drum.

    Luxury. Try running on a 32k single processor computer, started with booting the card reader which read cards that booted from a tape.

    No comparison between 50+ years ago with this constantly developing and fascinating New World. However KISS remains valid. If it works smoothly, don’t mess it up.

    Regards.

  • I remember having that happen a few times back in CentOS 4.x days, where eth0 would silently become eth1 after a kernel update and ifcfg-eth0
    would break hard.

  • The automobile was originally billed in many areas as the ‘horseless carriage,’ an upgrade.

    Frontpanel, 256 words (12-bit words), and paper tape.

  • My second machine was 9 bits = 8 + parity. 10 years later I was working on 36 bit words = 4 x 9 bit ACSII = 6 x 6 bit BCD.

    In my later computer life, the best thing I ever did, 10 years ago, was to abandon all m$ and move to C 5.3 which was truly a computer programmer’s dream. Liberating and exhilarating.

    chunk, chunk, chunk, ding, 110 baud terminals, then along came Terminets at a faster 300 baud. Think I can still punch a 80 column card using a hand punch.

    Many now take for granted CentOS without fully appreciating how powerful and empowering it is or the tremendous work done by those creating, maintaining and testing it and others developing extensions and repos. Life without CentOS would be bleak.

    Regards,