Network interface name: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
({{Status}}/{{TOC}} 템플릿 제거)
 
(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.
== Overview ==


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


There are many possible way to use this scheme,
== Key Concepts ==


* . 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>
{| class="wikitable"
! Concept
! Description
! Related
|-
| Network interface name
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}


* 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 50:
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 ==


== Predictable names scheme ==
* 최신 버전 사용 권장
[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.
* 공식 문서 참고
* 테스트 환경에서 먼저 검증


There are 3 ways how interface name is assigned, [https://major.io/2015/08/21/understanding-systemds-predictable-network-device-names/ Refer here for more]
== References ==


# based on [[BIOS]]/Firmware for onboard cards
* [https://wiki.hpcmate.com Network interface name]
# based on PCI information
# based on MAC address of the interface


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


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


* 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 13:25, 2 October 2026

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 test → RDMA → NIC Bonding → Network → IPMI → SDN → NFS