반응형

VMware 에서 설치한 CentOS 6.4 네트워크 오류

OS 2013.09.02 11:22

VMware 에서 설치한 CentOS 6.4 를 이미지를 복제한 뒤에, 네트워크를 설정하다보면 다음과 같은 오류가 발생합니다.

 

$ service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Device eth0 does not seem to be present, delaying initialization.
                                                           [FAILED]

이는 가상화 이미지를 복제할 때 ethernet adapter 의 MAC 주소가 바뀌기 때문에 발생하는 것입니다.

CentOS 에서는 이 때 ethernet adapter 를 새로 한개 더 추가해서 eth0 가 아닌 eth1 로 잡습니다.

이는 다음과 같이 확인해 볼 수 있습니다.

$ ls /sys/classs/net
eth1     lo

불필요한 ethernet adapter 를 삭제해주기 위해서, 장치 관리자가 자동으로 생성한 규칙 파일을 편집합니다.

해당 파일은 /etc/udev/rules.d/70-persistent-net.rules 입니다.

$ vi /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:2c:ff:a7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:da:06:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

실제로 가상화 이미지의 ethernet adapter 의 MAC 주소를 확인해보면 00:0c:29:da:06:f2 확인될 것입니다.

위의 파일 내용에서 NAME="eth0" 항목을 삭제하고, NAME="eth1" 의 이름을 "eth0" 으로 바꿉니다.

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:da:06:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

/etc/sysconfig/network-scripts/ifcfg-eth0 를 수정합니다.

여기에 MAC 주소가 이전의 것으로 지정되어 있으므로, 새로운 MAC 주소로 설정합니다.

참고: http://netmaid.tistory.com/91

 

그리고 시스템을 리부팅합니다.

 

참고:

 

출처: <http://netmaid.tistory.com/94>

반응형

+ Recent posts