CentOS 7 enp0s3 대신 eth0 사용하기

1 개요[ | ]

CentOS 7 enp0s3 대신 eth0 사용하기

2 문제상황[ | ]

Console
Copy
[root@localhost ~]# ip addr
1: lo <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host 
         valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST<MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
      link/ether 08:00:27:11:e6:3a brd ff:ff:ff:ff:ff:ff
→ eth0은 없고 enp0s3이 있음

3 설정 확인[ | ]

Console
Copy
[root@localhost ~]# ll /etc/sysconfig/network-scripts/ifcfg*
-rw-r--r--. 1 root root 277 Nov 26 06:49 /etc/sysconfig/network-scripts/ifcfg-enp0s3
-rw-r--r--. 1 root root 254 Jan 15  2015 /etc/sysconfig/network-scripts/ifcfg-lo
Console
Copy
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
Console
Copy
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=2748ae08-caff-40e0-b1dc-7fddbd5c5488
DEVICE=enp0s3
ONBOOT=no

4 해결방법[ | ]

Console
Copy
[root@localhost ~]# vi /etc/default/grub
aconf
Copy
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap crashkernel=auto  rd.lvm.lv=centos/root vconsole.font=latarcyrheb-sun16 vconsole.keymap=br-abnt2 rhgb quiet net.ifnames=0 biosdevname=0"
net.ifnames=0 biosdevname=0 추가
Console
Copy
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file
Found linux image: /boot/vmlinuz-3.10.0-121.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-121.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-df30d92ad3eb414583d85bb471003eb4
Found initrd image: /boot/initramfs-0-rescue-df30d92ad3eb414583d85bb471003eb4.img done
Console
Copy
[root@localhost ~]# shutdown -r now
Console
Copy
[root@localhost ~]# mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 ~
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Bash
Copy
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

5 같이 보기[ | ]

6 참고[ | ]