Install CentOS 7 after installing VirtualBox. I won’t go into details here. There are many tutorials online. Shut down the virtual machine first and configure the network as follows We need to use dual network cards here. We turn on the second network card as shown below Then start the virtual machine and perform the following operations # Enter the directory where the network card is located cd /etc/sysconfig/network-scripts/ # Back up network card information cp -rp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s3.bak # Edit vi /etc/sysconfig/network-scripts/ifcfg-enp0s3, as follows TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="dhcp" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="enp0s3" UUID="ee340a0f-1557-49c7-a927-5069c4e2ab88" DEVICE="enp0s3" ONBOOT="yes" The above configuration is the information of the network card 1 we added. We will copy and modify it to the information of network card 2. cp -rp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s8 TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="static" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="enp0s8" UUID="cb7e712d-c2db-4dee-8950-37f9d8a780e9" DEVICE="enp0s8" ONBOOT="yes" IPADDR="172.21.208.200" NETMASK="255.255.252.0" GATEWAY="172.21.208.1" DNS1="8.8.8.8" Note: UUID should be replaced with your own. You can use the uuidgen command to generate it. Note that IPADDR, NETMASK, and GATEWAY in enp0s8 are not random. Since our network card 2 is in bridge mode, that is, it is equivalent to connecting the virtual machine and the host to the same network environment, you need to check the configuration of the host. Use WIN+R, type cmd+Enter to open the dos command line, and enter ipconfig /all to view the network configuration in the host, as shown below Look carefully, the network segment configured in network card 2 is consistent with the network segment on the host. Use xshell to connect to the ip in network card 2. Summarize The above is the method and precautions for setting static IP in VirtualBox6 and CentOS7. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Installation and configuration of mysql 8.0.15 under Centos7
>>: Vue.js implements music player
Table of contents Preface VMware clone virtual ma...
mysqladmin is an official mysql client program th...
This article mainly introduces an example of impl...
Preface Yesterday, there was a project that requi...
Basic network configuration Although Docker can &...
1. The error information reported when running th...
This article lists the most commonly used image c...
Find two test machines: [root@docker1 centos_zabb...
Table of contents 1. The role of index 2. Creatin...
This article is the second article about objects ...
Table of contents jQuery's $.ajax The beginni...
Recently, the Vue project needs to refresh the da...
Install CentOS 7 after installing VirtualBox. I w...
Introduction The Docker-Compose project is an off...
1. Download MySQL Community Server 5.6.35 Downloa...