Hyper-VゲストOSのCentOS6.1のVHDXファイルを別Hyper-Vホストに移し立ち上げるとeth0が消滅して外部との通信が出来なくなる対処メモ。
対処後のスクショメイン
ゲストOS ネットワークアダプタ→高度な機能→MACアドレス
ココロ 新Hyper-VホストでVMを作るとMACアドレスが振られる。CentOS側のネットワーク設定においてMACアドレスを所持しておりこれらが不一致のためeth0が見えなくなる(と思う)
ゲストOS側
1 2 |
# cat /etc/redhat-release CentOS release 6.10 (Final) |
local loopbackのみが見える
1 2 3 4 5 6 7 8 9 |
# 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) |
70-persistent-net.rules編集
"00:15:5d:01:38:00"(上記Hyper-VのMACアドレスと合致させる)
"eth0"とする
不要行は削除
1 2 3 4 5 6 7 8 9 |
# cat /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. # net device () (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:01:38:00", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" |
ifcfg-eth0編集
HWADDR=00:15:5D:01:38:00とする。(上記Hyper-VのMACアドレスと合致させる)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet UUID=1e7f8661-e891-4ae6-be2d-defa74afc34d ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none #HWADDR=00:15:5D:01:54:0C #HWADDR=00:15:5D:01:4E:0B HWADDR=00:15:5D:01:38:00 IPADDR=192.168.1.17 PREFIX=24 GATEWAY=192.168.1.100 DNS1=192.168.1.219 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" |
OS再起動
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# ifconfig eth0 Link encap:Ethernet HWaddr 00:15:5D:01:38:00 inet addr:192.168.1.17 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: 2408:a5:7fff:614:215:5dff:fe01:3800/64 Scope:Global inet6 addr: fe80::215:5dff:fe01:3800/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:848 errors:0 dropped:0 overruns:0 frame:0 TX packets:163 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:101535 (99.1 KiB) TX bytes:20547 (20.0 KiB) 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) |
コメント