In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to achieve network configuration after Centos6.9 virtual machine cloning". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to achieve network configuration after Centos6.9 virtual machine cloning".
1. Power on the virtual machine and enter the console.
2. The hostname is usually changed after the virtual machine is cloned. If you do not want to change the hostname, please ignore this step. The virtual machine copied in this example was originally named centoswy01, and its hostname is now changed to centoswy02. For a detailed tutorial on changing the hostname, refer to this article: how to change the hostname for the virtual machine of the Centos system.
The virtual machine was originally named centoswy01
The virtual machine is now named centoswy02
3. Enter: ifconfig-an on the command line to confirm the current network card and mac address. As shown in the following figure: the Mac address of this cloned virtual machine is the corresponding content of HWaddr, that is, 00:0C:29:97:13:F7. This Mac address needs to be written down now and will be used later when changing the configuration file.
4. Type cp / etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-eth2 on the command line to back up the ifcfg-eth0 file. The backup name is ifcfg-eth2.
5. Enter the command on the command line: vi / etc/sysconfig/network-scripts/ifcfg-eth0, and modify the configuration file. The contents of the ifcfg-eth0 source file are shown in the following figure:
6. In the figure above, you can see that the corresponding content of HWaddr is: 00:0C:29:AD:86:F1, while the corresponding content of HWaddr we saw under the ifconfig-a command is: 00:0C:29:97:13:F7. What needs to be done now is to change the content corresponding to HWaddr in ifcfg-eth0 to that of HWaddr in ifconfig-a. Then change the content corresponding to ONBOOT to yes, change the dchp in BOOTPROTO to static, and then add IP, mask, gateway and DNS.
7. The modified ifcfg-eth0 file is shown in the following figure:
8. Enter the command on the command line: vi / etc/udev/rules.d/70-persistent-net.rules, comment out the record of the first network card driver eth0, open the record of the second network card driver eth2, and then: wq, save and exit. As shown in the following figure:
9. Restart the network service: service network restart will read the configuration file that has just been modified. If the configuration file does not take effect, use the source command to make the configuration file take effect.
10. Log in to the virtual machine after reboot. You can view the IP information through ifconfig, and you can also test the network connection of the virtual machine through ping www.baidu.com.
11. If the network is restarted, the situation shown below appears
You can try the following solutions:
1. Modify the HWADDR in the ifcfg-eth0 network configuration file of the Centos virtual machine clone to the MAC address of ifconfig-a, as in this example: HWADDR= "00:0C:29:97:13:f7"
two。 Then delete a file and do the following:
[root@centoswy02 ~] # rm-rf / etc/udev/rules.d/70-persistent-net.rules
[root@ centoswy02 ~] # reboot
In a word, the network configuration of the cloned virtual machine uses the same network card device and MAC address.
These are all the contents of the article "how to achieve network configuration after Centos6.9 virtual machine cloning". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.