SSブログ

VMware vSphere ClientでCentOSをコピーしたらeth0が無効になっていた [仮想サーバ]

VMware vSphere Client(5.5.0)を使って、既存CentOSをコピーして新環境を作成した。

ログインできるレベルまではできたものの、eth0が認識されず。

# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


2つのファイルを編集する必要あり。

/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:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:aa:bb:cc:dd:ee", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

【編集後】
# 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:aa:bb:cc:dd:ee", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


※eth1の設定を残して、nameをeth0に変更する。



/etc/sysconfig/network-scripts/ifcfg-eth0
【編集後】
DEVICE=eth0
TYPE=Ethernet
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
# HWADDR=00:11:22:33:44:55
IPADDR=192.168.1.2
PREFIX=24
GATEWAY=192.168.1.254
DNS1=182.168.1.254
DOMAIN=aaa.co.jp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"

※HWADDRをコメントアウトする。


後はOSを再起動するだけ。
しらなきゃできないですねぇ。

タグ:CentOS VMWare
nice!(0)  コメント(0)  トラックバック(0) 

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 0

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。