@markdown
# Linux Network Interface Name
리눅스에서는 `ifconfig` 명령을 통해 현재 컴퓨터의 네트워크 인터페이스의 목록을 확인하고, 각 장치를 관리할 수 있다.
우분투 14.04까지는 네트워크 인터페이스의 이름이
- 유선의 경우 eth0, eth1, eth2 ...
- 무선의 경우 wlan0, wlan1, wlan2 ...
으로 정해져왔다.
_
그러나 우분투 15.04부터는 네트워크 인터페이스의 네이밍 컨벤션이 낯설게 바뀌었다. 예를 들어 내 노트북의 유선 인터페이스는 `enp2s0`으로, 무선 인터페이스는 `wlp1s0`으로 변경되었다.
_
여태까지 쭉 사용되던 네이밍 컨벤션이 변경(새 네이밍 컨벤션은 **PredictableNetworkInterfaceNames** 라고 한다)되는걸 보며, 나는 두가지 의문점이 생겼다.
- 왜 네이밍 컨벤션을 바꾼걸까
- enp2s0 같은 이름은 뭘 의미하는걸까
그래서 찾아봤더니 관련 자료가 조금 있었고, 내가 알아낸 것을 이번 글에서 정리하려한다.
## 네이밍 컨벤션이 바뀐 이유
[freedesktop.org](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/)에 관련한 내용을 자세히 정리한 글에 따르면,
- Stable interface names across reboots
- Stable interface names even when hardware is added or removed, i.e. no re-enumeration takes place (to the level the firmware permits this)
- Stable interface names when kernels or drivers are updated/changed
- Stable interface names even if you have to replace broken ethernet cards by new ones
- The names are automatically determined without user configuration, they just work
- The interface names are fully predictable, i.e. just by looking at lspci you can figure out what the interface is going to be called
- Fully stateless operation, changing the hardware configuration will not result in changes in /etc
- Compatibility with read-only root
- The network interface naming now follows more closely the scheme used for aliasing block device nodes and other device nodes in /dev via symlinks
- Applicability to both x86 and non-x86 machines
- The same on all distributions that adopted systemd/udev
- It's easy to opt out of the scheme (see below)
_
요약하자면, 네트워크 인터페이스가 어떤 이름을 가질지 사용자가 예측 가능하고, 인식 순서나 드라이버 로드 순서에 따라 이름이 바뀌지 않고 항상 같은 이름을 가진다는 점이 장점이 되기 떄문이다.
## 새 네이밍이 의미하는 것
[stackoverflow](http://unix.stackexchange.com/a/311844/222812) 답변에서 그 의미를 찾을 수 있었다.
위의 답변이 너무나도 알아보기 쉽기에 그냥 인용한다.
```
enp0s10:
en -- ethernet
p0 -- bus number (0)
s10 -- slot number (10)
```
'Linux' 카테고리의 다른 글
Linux Network Traffic Control (0) | 2018.01.05 |
---|---|
Boost Productivity with Z and Zsh on Ubuntu (0) | 2017.04.26 |
터미널에서 헥스덤프 만들기 (0) | 2017.02.26 |
리눅스 백업하기 (0) | 2017.02.15 |
ttylinux live USB 만들기 (0) | 2017.02.15 |