Difference between revisions of "Predictable Network Interface Names"
m |
m |
||
Line 30: | Line 30: | ||
v | v | ||
s0 --> slot number (0) | s0 --> slot number (0) | ||
+ | |||
+ | == NetworkManager == | ||
+ | A program for providing detection and configuration for systems to automatically connect to networks. Network management framework (daemon and userspace tools) - A GUI thing. | ||
+ | |||
+ | Network Manager has a command line tool that can be used to see which interfaces it is controlling. Pull up a terminal window and type the following command: | ||
+ | nmcli dev status | ||
+ | sample output: | ||
+ | # nmcli dev status | ||
+ | DEVICE TYPE STATE CONNECTION | ||
+ | enp0s4 ethernet connected Wired connection 1 | ||
+ | |||
+ | For Ubuntu and Mint distributions (recent like 18.3 or 19.2) this is how network interfaces are configured. Network Manager settings are controlled by the configuration file: /etc/NetworkManager/NetworkManager.conf | ||
+ | |||
+ | To disable Network Manager for a specific interface, set parameter “managed=false" in NetworkManager.conf for that interface. | ||
+ | |||
+ | Completely disable Network Manager so it does not control anything, even after reboot: | ||
+ | sudo systemctl stop network-manager | ||
+ | sudo systemctl mask network-manager |
Revision as of 20:42, 17 April 2020
or, why my interfaces are no longer called eth0 and eth1 etc... and I cant ifup and ifdown anymore, nor can I 'service network restart.'
Is this crap actually an improvement?
The classic naming scheme for network interfaces applied by the kernel is to simply assign names beginning with "eth0" and ethX after that. A problem occurs on new distributions with driver probing on every boot. On every boot the darn things do driver probing now to check to see if you made any hardware changes. The driver probing does not always assign interfaces with the same numbers. A system with two nics might have nic 1 as eth0 today and eth1 tomorrow even if you did not make any changes. Rather than trying to figure out why the driver probing is inconsistent, the devs used a band-aide and completely changed the name schema.
systemd - The change can be blamed on systemd. systemd is a new init system and system manager, that was adopted by most of Linux distributions now over the traditional SysVinit manager.
Predictable Network Interface Names - out with the old ethX naming schema and in with this new weird looking names like 'enp3s0' or 'enp0s10'. Now undev assigns names to ethernet devices incorporating Firmware/BIOS provided index numbers, and etc.
If you want to bring down your interface, and you identified it as 'enp3s0' as an example, issue the command:
ifconfig enp3s0 down
Interfaces are named following rules that use information from the firmware and bios if available.
The commands ifdown and ifup read the file /etc/network/interfaces on SysV machines. Either the scripts are not configured or are not compatible with systemd, since distributions like Ubuntu don't bother with them.
assignment name rules
- Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
- Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
- Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
- Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
enp3s0: | | | v | | en| | --> ethernet v | p3| --> bus number (3) v s0 --> slot number (0)
NetworkManager
A program for providing detection and configuration for systems to automatically connect to networks. Network management framework (daemon and userspace tools) - A GUI thing.
Network Manager has a command line tool that can be used to see which interfaces it is controlling. Pull up a terminal window and type the following command:
nmcli dev status
sample output:
# nmcli dev status DEVICE TYPE STATE CONNECTION enp0s4 ethernet connected Wired connection 1
For Ubuntu and Mint distributions (recent like 18.3 or 19.2) this is how network interfaces are configured. Network Manager settings are controlled by the configuration file: /etc/NetworkManager/NetworkManager.conf
To disable Network Manager for a specific interface, set parameter “managed=false" in NetworkManager.conf for that interface.
Completely disable Network Manager so it does not control anything, even after reboot:
sudo systemctl stop network-manager sudo systemctl mask network-manager