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

Dynamic and static IP configuration of CentOS virtual machine on Virtualbox to achieve connectivity with hosts and access to the external network

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Dynamic IP mode

1) first, obtain the network IP information of the host (WIN7) as follows:

2) the IP of the virtual network card generated after installing Virtualbox needs to be modified to IP with the same network segment as the host's IP address. This is changed to 192.168.1.110.

2) the IP of the virtual network card generated after installing Virtualbox needs to be modified to IP with the same network segment as the host's IP address. I will change it to 192.168.1.110.

3) then create a new virtual machine on Virtualbox5.2, configure the virtual machine Nic information and record the MAC address by "bridging", as shown in the following figure:

4) to install CentOS7 on the virtual machine, the process is slightly.

5) start CentOS, open and edit ifcfg-enp0s3 with vim (vi) (some versions of the system are not necessarily the same name).

6) after configuration, test whether it is connected to the host and whether it can be connected to the external network.

The Ping host is accessible:

Wget command:

Static IP mode

(1) same as above

(2) same as above

(3) same as above

(4) same as above

(5) configure the Nic configuration file. The first / etc/sysconfig/network file is as follows:

Note: this must be the gateway address of the host, not the virtual network card gateway.

Then configure / etc/sysconfig/network-scripts/ ifcfg-enp0s3

The above two methods can realize the interworking with the host and the external network.

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

Servers

Wechat

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

12
Report