網頁

2013年5月24日 星期五

CentOS 6.3 --- Maybe need to configure network setting after creating the differencing disk or clone OS

In virtualization environment as Hyper-V or VMware, if we create a VM disk and its type has a parent-child relationship with another disk, maybe we will find out the original network card will disappear after boot VM next to use /sbin/ifconfig command.ScreenHunter_41
When this scenario happens, we have to realize whether the first or others Ethernet network interface card or NIC exist in the system so that use ls /etc/sysconfig/network-scripts command. (#1)
If it exists           we will go to the next steps to confirm something.ScreenHunter_42If it non-exists   we have to create network interface.ScreenHunter_31                           To create a file by using vi /etc/sysconfig/network-scripts/ifcfg-eth0 command and add some word as follows:ScreenHunter_32                            for getting dynamic IPScreenHunter_33                            for setting static IP (# 1)ScreenHunter_03End if
Of course, we also have to confirm whether the duplicated content in the /etc/udev/rules.d/70-persistent-net.rules file exist the wrong network card mapping to MAC.ScreenHunter_43In general, we just need to delete the first row and change NAME’s value from eth1 to eth0 at the second rowScreenHunter_44The final result is as follows:ScreenHunter_45

By add or modify the content in the /etc/sysconfig/network file, we can specify the network configuration as Networking should be configured, hostname set FQDN, set the network gateway and so on.ScreenHunter_40ScreenHunter_42
By using chkconfig  network on command, we will configure the system to automatically start the network function when the system startup.ScreenHunter_49
Finally, please reboot itScreenHunter_47After log on the system, the network function will be normal now.
ScreenHunter_48
Reference :
(# 1)
 In installing Linux Integration Services on Hyper-V 3.0, we can realize whether the network module is loaded successfully by using lsmod | grep vsc command.
(# 2) About name server setting in CentOS 6.3, we don’t need to add or modify the content in /etc/resolv.conf file because it need to set in the /etc/sysconfig/network-scripts/ifcfg-eth0 file.
         If we still do it in /etc/resolv.conf file, the name server setting will disappear after reboot the system.
         As to PEERDNS=no or PEERDNS=yes in the /etc/sysconfig/network-scripts/ifcfg-eth0 file, it don’t influence anything in my testing lab.
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.