R&D/OS

KVM/QEMU에서 가상머신 NIC 번호 eth0, eth1, ... 증가 할 때

sunshout 2010. 11. 2. 17:29
KVM/QEMU를 실행하면 부팅할 때마다 nic 번호가 증가하는 문제점이 있다.

이를 때는 가상머신 이미지(리눅스)에서

/etc/udev/rules.d/NN-persistent-net.rules 파일을 삭제하면 eth0로 잡힌다.

Use a specific network interface for kickstart

When your system has more than one network interface anaconda asks you which one you'd like to use for the kickstart process. This decision can be made at boot time by adding the ksdevice paramter and setting it accordingly. To run kickstart via eth0 simply add ksdevice=eth0 to the kernel command line.

A second method is using ksdevice=link. In this case anaconda will use the first interface it finds that has a active link.

A third method works if you are doing PXE based installations. Then you add IPAPPEND 2 to the PXE configuration file and use ksdevice=bootif. In this case anaconda will use the interface that did the PXE boot (this does not necessarily needs to be the first one with a active link).

Within the kickstart config itself you need to define the network interfaces using the network statement. If you are using method 2 or 3 then you don't know which device actually will be used. If you don't specify a device for the network statement anaconda will configure the device used for the kickstart process and set it up according to your network statement.