본문 바로가기
OS-OE Knowledge/Linux-Unix KB

RHEL7/NIC interface ethx 사용 (NIC Naming Convention)

by 스쳐가는인연 2015. 5. 16.

RHEL7에서 NIC 장치의 명명 규칙이 변화를 갖었다.


RHEL 7 the names have two character prefixes based on the type of interface:

en for Ethernet,

sl for serial line IP (slip),

wl for wireless LAN (WLAN),

ww for wireless wide area network (WWAN).



과거의 ethx 로 장치명을 사용하기 위해

1. MAC Address  확인

[root@RH71 ~]# ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000

    link/ether 00:0c:29:ed:ac:b5 brd ff:ff:ff:ff:ff:ff

3: eno33554992: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000

    link/ether 00:0c:29:ed:ac:bf brd ff:ff:ff:ff:ff:ff

4: eno50332216: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000

    link/ether 00:0c:29:ed:ac:c9 brd ff:ff:ff:ff:ff:ff

5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT 

    link/ether 52:54:00:2c:27:4b brd ff:ff:ff:ff:ff:ff

6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500

    link/ether 52:54:00:2c:27:4b brd ff:ff:ff:ff:ff:ff


2. grub 파일을 편집

# vim /etc/default/grub

## add "net.ifnames=0 biosdevname=0" at the end of the "GRUB_CMDLINE_LINUX"


[root@RH71 ~]# cat /etc/default/grub

GRUB_TIMEOUT=5

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel_rh71/swap rd.lvm.lv=rhel_rh71/root crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"

GRUB_DISABLE_RECOVERY="true"


# grub2-mkconfig -o /boot/grub2/grub.cfg


3. ifcfg 파일을 원하는 파일 명으로 변경.

# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-enoeth0

# vim ifcfg-enoeth0


4. 명명 규칙 변경

[root@RH71 ~]# vim /etc/udev/rules.d/70-persistent-net.rules

--------------------------

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:ed:ac:b5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eno16777736", NAME="eth0"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:ed:ac:bf", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eno33554992", NAME="eth1"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:ed:ac:c9", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eno50332216", NAME="eth2"

--------------------------


5. 리부팅하여 상태 확인

# systemctl reboot


참고자료

http://ask.xmodulo.com/change-network-interface-name-centos7.html


반응형