In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to configure a network for a virtual machine on centos 6.7. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Static network configuration
1. Open the virtual machine and enter your account and password to log in.
2. After that, enter vi /etc/sysconfig/network-scripts/ifcfg-eth0, or vim /etc/sysconfig/network-scripts/ifcfg-eth0, which is the same way, depending on personal preference. Enter the network configuration interface, as shown in the figure below.
3, the original ecological network crawler is very simple, including network card devices, Mac address, UUID, etc., but we need to change only two places, but also need to add IP address, gateway, mask and DNS1 and backup DNS2. The specific configuration is shown in the figure below.
Set ONBOOT to yes, BOOTPROTO to static, and then add IP address, gateway, mask, and DNS1 followed by alternate DNS2.
Press Esc when you're done and type:wq!, To save the exit.
If you are unsure whether the modification was successful, you can check it at cat /etc/sysconfig/network-scripts/ifcfg-eth0.
Close the firewall, enter service ip6tables stop, and then the green ok word will appear on the right, indicating that the shutdown is successful.
After restarting the network, enter service network restart on the command line. After the successful restart of the network card will appear on the right green ok words, as shown in the figure below. If red Failed appears, it means that there is a problem with the network configuration. The common error is that IP is unavailable or ONBOOT and BOOTPROTO have not changed.
6. The IP address can be viewed through the ipconfig command, as shown in the following figure.
7. Finally, you can ping www.baidu.com for network ping test. If IP is available, the server will respond, as shown below. If you want to stop running, use Ctrl+C to force exit.
At this point, the virtual machine successfully connects to the Internet.
II. Dynamic network configuration
The procedure is as follows:
1)On the command line type:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
2)After that, you can modify ONBOOT=yes. Other defaults do not need to add any IP, gateway, etc. After modification, save and exit.
3)After that, enter service network restart to restart the network card.
4) Finally, enter the ifconfig command to view the IP address.
Finally, simply say, use dhcp (Dynamic Host Configuration Protocol) to configure IP addresses. At this time, IP addresses are dynamically generated, which is not convenient for building hadoop cluster environments in the future. This is why you need to configure static IP addresses.
Thank you for reading! About "how to configure the network for the virtual machine of centos6.7 system" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
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.