Network interface name: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Created page with "The Linux kernel assigns names to network interfaces, nowaday there are multiple network interface naming scheme is available and each has pros and cons. == Simple scheme == <code>eth0</code>, <code>eth1</code>, etc were simply assigned by the kernel. There are many possible way to use this scheme, * . reboot with the kernel parameter <code>net.ifnames=0</code>, or made persistent by editing <code>/etc/default/grub</code> and running <code>update-grub</code> * ove...")
 
(Fix: remove --- horizontal lines (7 removed))
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The [[Linux]] kernel assigns names to network interfaces, nowaday there are multiple network interface naming scheme is available and each has pros and cons.
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}


== Simple scheme ==
{{TOC}}
<code>eth0</code>, <code>eth1</code>, etc were simply assigned by the kernel.
 
== Overview ==
 
Network interface name에 대한 기술 문서입니다.
 
=== Summary ===
 
* 무엇인가? - Network interface name
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
 
 
== Purpose ==
 
이 문서가 존재하는 이유
 
* Goal: Network interface name에 대한 기술 정보 제공
* Scope: Network interface name의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
 
 
== Key Concepts ==


There are many possible way to use this scheme,  
{| class="wikitable"
! Concept
! Description
! Related
|-
| Network interface name
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}


* . reboot with the kernel parameter <code>net.ifnames=0</code>, or made persistent by editing <code>/etc/default/grub</code> and running <code>update-grub</code>


* override <code>/lib/systemd/network/99-default.link</code>, with a custom version in <code>/etc/systemd/network/</code>, '''or''' similarly override <code>/lib/udev/rules.d/80-net-setup-link.rules</code>, '''or''' mask the latter by using a <code>/dev/null</code> symlink instead of a custom version, or...
== Detailed Explanation ==


== Persistent names scheme ==
* [[Network]]
The [[Linux]] [[kernel]] assigns names to network interfaces, nowaday there are multiple network interface naming scheme is available and each has pros and cons.
<code>eth0</code>, <code>eth1</code>, etc were simply assigned by the kernel.
Following step would be the simplest way among [https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ many possible way] , <syntaxhighlight lang="bash">
Step 1, Add this to the line below "net.ifnames=0 biosdevname=0"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
Step 2, Update GRUB, depends on your OS.
Debian based Ubuntu/Mint:
update-grub
Centos/RHEL
grub2-mkconfig -o /boot/grub2/grub.cfg
Step 3, Reboot and check
</syntaxhighlight>
<code>udev</code> to identify interfaces by MAC address and assign a fixed interface number to any interface by writing the rules to <code>/etc/udev/rules.d/xxx.rules</code>  
<code>udev</code> to identify interfaces by MAC address and assign a fixed interface number to any interface by writing the rules to <code>/etc/udev/rules.d/xxx.rules</code>  
for example, <syntaxhighlight lang="bash">
for example, <syntaxhighlight lang="bash">
#/etc/udev/rules.d/70-persistent-net.rules
#/etc/udev/rules.d/70-persistent-net.rules
Line 18: Line 62:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:bb:cc:dd:ee:ff", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:bb:cc:dd:ee:ff", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
</syntaxhighlight>
</syntaxhighlight>
[https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ Predictable Network Interface naming] and is part of systemd, to which Ubuntu has been transitioning as of version 15.04. the idea is to set interface name depends on physical location of hardware and can be predicted/guessed by looking at <code>lspci</code> or <code>lshw</code> output.
== Best Practices ==
* 최신 버전 사용 권장
* 공식 문서 참고
* 테스트 환경에서 먼저 검증
== References ==
* [https://wiki.hpcmate.com Network interface name]


== Predictable names scheme ==
== Related Pages ==
Red Hat  Enterprise Linux  uses predictable network interface names. These names are stable across reboots and network adapter replacements<ref>https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-understanding_the_predictable_network_interface_device_names</ref>


== Custome names scheme<ref>https://wiki.debian.org/NetworkInterfaceNames#custom</ref> ==
* [[Linux]]
Using systemd.link <syntaxhighlight lang="bash">
* [[Server]]
#/etc/systemd/network/10-persistent-net.link
* [[Hardware]]
[Match]
* [[Network]]
MACAddress=01:23:45:67:89:ab


[Link]
Name=lan0
</syntaxhighlight>
To verify the new policies to work after a reboot,


* run <code>udev control --reload</code> (or <code>/etc/init.d/udev force-reload</code>, or <code>service udev force-reload</code>)
[[Category:Network]]
* then
== Knowledge Graph ==
** for hotplug NICs,  disconnect and reconnect them (or unload/reload the driver; if your SSH session doesn't go through this NIC...)
** for non-hotplug NICs, run <code>udevadm trigger</code>, ''then'' check the logs (your SSH connection should still be okay even if your <code>.link</code> file was rejected as nonsense), ''then'' restart networking.


It is also possible to reorganize the naming policy by overriding <code>/lib/systemd/network/99-default.link</code>, for instance to insist that all network interfaces are named purely by MAC address: <syntaxhighlight lang="bash">
Related
#/etc/systemd/network/99-default.link
[Match]
OriginalName=*


[Link]
[[Network performance test]]
NamePolicy=mac
→ [[RDMA]]
MACAddressPolicy=persistent
→ [[NIC Bonding]]
</syntaxhighlight>
→ [[Network]]
→ [[IPMI]]
→ [[SDN]]
→ [[NFS]]


== References ==
[[Category:Configuration]]
<references />

Latest revision as of 11:29, 17 July 2026

Template:Status

Template:TOC

Overview

Network interface name에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Network interface name
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


Purpose

이 문서가 존재하는 이유

  • Goal: Network interface name에 대한 기술 정보 제공
  • Scope: Network interface name의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장


Key Concepts

Concept Description Related
Network interface name HPC/서버 환경에서 중요한 기술 개념 Linux, Server


Detailed Explanation

The Linux kernel assigns names to network interfaces, nowaday there are multiple network interface naming scheme is available and each has pros and cons. eth0, eth1, etc were simply assigned by the kernel.

Following step would be the simplest way among many possible way ,

Step 1, Add this to the line below "net.ifnames=0 biosdevname=0"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
Step 2, Update GRUB, depends on your OS.
Debian based Ubuntu/Mint:
update-grub
Centos/RHEL
grub2-mkconfig -o /boot/grub2/grub.cfg
Step 3, Reboot and check

udev to identify interfaces by MAC address and assign a fixed interface number to any interface by writing the rules to /etc/udev/rules.d/xxx.rules

for example,

#/etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x8086:0x100e (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:bb:cc:dd:ee:ff", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Predictable Network Interface naming and is part of systemd, to which Ubuntu has been transitioning as of version 15.04. the idea is to set interface name depends on physical location of hardware and can be predicted/guessed by looking at lspci or lshw output.


Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증


References


Related Pages

Knowledge Graph

Related

Network performance testRDMANIC BondingNetworkIPMISDNNFS