iVPS 가상서버호스팅
iVPS 가상서버호스팅
CentOS 7.x enp0s3 를 eth0 로 변경하는 방법 본문
CentOS 7.x enp0s3 를 eth0 로 변경하는 방법
CentOS 7.x 네트워크장치명 enp0s3 를 eth0 로 변경하는 방법
ifconfig 명령어를 실행해보면 아래화면 처럼 익숙하지 않은 장치명이 보인다.
enp0s3: flags=4163 mtu 1500
inet 192.168.1.250 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe27:d6ca prefixlen 64 scopeid 0x20
ether 08:00:27:27:d6:ca txqueuelen 1000 (Ethernet)
RX packets 251 bytes 22168 (21.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 147 bytes 23767 (23.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
CentOS 6.x 버전에서는 eth0 로 나왔었는데 말이다.
enp0s3 를 eth0로 바꿔주자.
# mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0
우선 장치 파일명 부터 바꾼 다음에
안에 내용을 변경해주자. NAME= 부분과 DEVICE= 부분을 enp0s3 에서 eth0 로 변경하고 저장하면 된다.
GRUB_DISTRIBUTOR=»$(sed ‘s, release .*$,,g’ /etc/system-release)»
GRUB_CMDLINE_LINUX=»crashkernel=auto rd.lvm.lv=centos_virtualbox/root rd.lvm.lv=centos_virtualbox/swap rhgb quiet net.ifnames=0 biosdevname=0«
/etc/default/grub 파일을 열어서 굵은 글씨로 되어 있는 «net.ifnames=0 biosdevname=0» 를 추가하고 저장하자.
그리고 grub2-mkconfig 명령어로 grub.cfg 를 생성해주어야 한다.
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file .
Found linux image: /boot/vmlinuz-3.10.0-327.13.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.13.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-cc29964e94c24c63899315ba5cff468c