In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to configure IP in VirtualBox Centos. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
If only the virtual machine needs to surf the Internet, it is very simple.
1. Enter the Centos system and view the network configuration.
Enter the command:
Ifconfig-a
two。 Enter the ifcfg-eth0 file.
Enter the command:
Vim / etc/sysconfig/network-scripts/ifcfg-eth0
Note: sudo is required for non-root accounts, otherwise there is no permission to edit, or su can be directly switched to root users.
3. Configure dynamic IP.
Configure ifcfg-eth0 address by modifying IP content
Change ONBOOT=no to ONBOOT=yes to activate the network card.
4. Restart the network service to view the dynamic IP configuration results.
Enter the command:
Service network restart # restart the network service
Note: root users will still be used
OK
If the virtual machine and host are to communicate with each other, you need to configure bridging mode
1. Stop the virtual machine, virtualBox- > General-> Network
Change the connection mode of network card 1 to: bridge network card
two。 Enter the ifcfg-eth0 file.
Enter the command:
Vim / etc/sysconfig/network-scripts/ifcfg-eth0
Note: sudo is required for non-root accounts, otherwise there is no permission to edit, or su can be directly switched to root users.
3. Configure static IP
BOOTPROTO=static static
IPADDR=192.168.1.10 sets the ip address of the virtual machine to be on the same network segment as the host, but the name cannot be repeated.
NETMASK=255.255.255.0 sets subnet mask
GATEWAY=192.168.1.1 Settings Gateway
DNS1=140.207.198.6 sets DNS (same as host)
DEFROUTE=yes
4. Restart the network service to view the dynamic IP configuration results.
Enter command: service network restart (restart network service)
Note: root users will still be used
OK.
This is the end of this article on "how to configure IP in VirtualBox Centos". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.