Difference between revisions of "Rocky Linux Installation previously CentOS"

m
no edit summary
m
m
Line 97: Line 97:
'''Helpful Tips'''
'''Helpful Tips'''


* Show Physical NICs and match them to their "logical" name;
*Show Physical NICs and match them to their "logical" name;
** lspci
**lspci
** lshw -class network -short (notice the Device name)
**lshw -class network -short (notice the Device name)
** lshw -class network (notice the logical name)
**lshw -class network (notice the logical name)
** ...and for detailed information on as specific adapter: ethtool WhatEverLogicalNameOfAdapter
**...and for detailed information on as specific adapter: ethtool WhatEverLogicalNameOfAdapter


'''NetworkManager (if it is necessary to use it);'''
'''NetworkManager (if it is necessary to use it);'''
Line 121: Line 121:
Because there seem to be so many different fashions (70-persistent-net.rules, udev, HWADDR) in how Linux in general and Rocky Linux 8 and 9 do things, here's a way to things for a server that has several NICs
Because there seem to be so many different fashions (70-persistent-net.rules, udev, HWADDR) in how Linux in general and Rocky Linux 8 and 9 do things, here's a way to things for a server that has several NICs


* Pick a NIC port, assign an 'outlandish' (IE, you're not going to use it in the future) IP Address to it, make sure it works and then WHACK all the other ethernet devices / interfaces , using Webmin (handy if there are a bunch of NICs) or via command line.
*Pick a NIC port, assign an 'outlandish' (IE, you're not going to use it in the future) IP Address to it, make sure it works and then WHACK all the other ethernet devices / interfaces , using Webmin (handy if there are a bunch of NICs) or via command line.
* Rename Interfaces if desired (AKA getting rid of the freaky Rocky8 Network Interface names), see below example where enp2s0 is renamed to eth0;
*Rename Interfaces if desired (AKA getting rid of the freaky Rocky8 Network Interface names), see below example where enp2s0 is renamed to eth0;
** <code>ifdown enp2s0</code>
**<code>ifdown enp2s0</code>
**<code>ip link set enp2s0 name eth0</code>
**<code>ip link set enp2s0 name eth0</code>
**<code>mv /etc/sysconfig/network-scripts/ifcfg-enp2s0 /etc/sysconfig/network-scripts/ifcfg-eth0/</code>
**<code>mv /etc/sysconfig/network-scripts/ifcfg-enp2s0 /etc/sysconfig/network-scripts/ifcfg-eth0/</code>
Line 129: Line 129:
**above is from: https://tekneed.com/how-to-rename-nic-in-linux-centos-rhel-7-8/
**above is from: https://tekneed.com/how-to-rename-nic-in-linux-centos-rhel-7-8/
**...and check with above noted "Hardware Commands": lshw -class network -short
**...and check with above noted "Hardware Commands": lshw -class network -short
*Everything good?  Nope, not finished;
**Gotta make sure Red Hat, err, Rocky Linux (especially 8) doesn't revert to the 'messed up', err, new method of naming interfaces (that don't work well with useful things like Shorewall, Webmin, etc): https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/ch-consistent_network_device_naming
**Make some boot configuration changes (sort of (don't set to stated values here) from https://yallalabs.com/linux/how-to-change-network-interface-name-from-enp0s3-to-eth0-centos-8/)
***Make sure the /etc/default/grub GRUB_CMDLINE_LINUX: "WhatEverIsCurrentlyThere AndAddSpace net.ifnames=1 biosdevname=1" (more information: https://unix.stackexchange.com/questions/637295/linux-kernel-parameters-what-is-the-difference-of-net-ifnames-0-and-biosdevname and https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-consistent_network_device_naming_using_biosdevname)
***Rebuild Grub: See Above Section
**...and still not done because this leaves the naming of interfaces completely up to Linux and the information from the BIOS (or UEFI)
***Cute Story to start things: On a server with two built in NICs and an Intel i350 with 4 NICs on one x4 PCIe card, the names were as follows: eth0, eth1, eth2, eth4 were assigned to the Intel NICs, and eth3 and eth5 were assigned to the built in NICs.  Did you catch that?  Why did one of the built in one's nab eth3 from the Intel card.  Who knows? (Hint: above BIOS setting wasn't correct)
***Solution?  See below...
***Assign Hardware Addresses in /etc/sysconfig/network-scripts to make sure every NIC gets the IP Address it is supposed to get;
****HWADDR=WhatEverMACAddress (use ''lshw -class network -short'' AND ''ip a'' to match things up)


*From Here: https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-networkmanager/amp/
*From Here: https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-networkmanager/amp/