Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly configure the IP of VirtualBox Centos

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to quickly configure the IP of VirtualBox Centos". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to quickly configure the IP of VirtualBox Centos" can help you solve your doubts.

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

After reading this, the article "how to quickly configure IP for VirtualBox Centos" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report