인프라

[Linux] CentOS 7에서 enp0s3을 eth0로 변경

JE414 2019. 3. 28. 15:15

enp0s3을 eth0로 변경


 

eth0이 enp0s3로 바뀐 이유


  centos의 경우 6버전 까지는 eth0..eth1... 식으로 이름이 주어졌다. 그러나 이런 방법은 이더넷 인터페이스가 여러 개 있는 경우, 시스템에서 이를 감지하는 순서를 예측하지 못하는 문제가 있다고 한다. 때문에 7버전에서는 enp0s3 등으로 바뀌게 되었다.
  그런데 일부 프로그램 등에서는 eth0 이름으로 정보를 식별하기도 해서, 다시 eth0로 바꾸어 주기도 한다.

 

 

 

 enp0s3 -> eth0 변경

~]# vi /etc/default/grub
	GRUB_CMDLINE_LINUX 부분에 net.ifnames=0 biosdevname=0 추가.

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

~]# shutdown -r now		(지금 즉시 종료 후 재부팅)

~]# mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0 	(enp0s3을 eth0으로 변경)

~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
	DEVICE=eth0		
	BOOTPROTO=dhcp	(ip 할당 방식 = 동적)
   	ONBOOT="yes"	(부팅 시 자동으로 인터페이스 올림)
    
~]#	ifconfig		(확인)

~]# ping 8.8.8.8	(ping 날려서 인터넷 연결 확인)

 

 

 

 

 

 

[참고]

 

 https://zetawiki.com/wiki/CentOS_7_enp0s3_%EB%8C%80%EC%8B%A0_eth0_%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

 

CentOS 7 enp0s3 대신 eth0 사용하기 - 제타위키

다음 문자열 포함...

zetawiki.com

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

 

PredictableNetworkInterfaceNames

Back to systemd Predictable Network Interface Names Starting with v197 systemd/udev will automatically assign predictable, stable network interface names for all local Ethernet, WLAN and WWAN interfaces. This is a departure from the traditional interface n

www.freedesktop.org

https://blog.learningtree.com/new-names-linux-network-interfaces/

 

Do You Know the New Names for Linux Network Interfaces? | Learning Tree Blog

Organizations are finally moving to it or derivatives like CentOS, Oracle Linux, or Scientific Linux. It's time to learn the new names and commands.

blog.learningtree.com