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 1. Maven Dependency 2. Menu rel...
Background Recently, when writing SQL statements,...
When Docker creates a container, it uses the brid...
Table of contents 1. Control the display and hidi...
Overview: I drew lessons from several timetable s...
This article shares with you the installation of ...
ContentsHyperledger fabric1.4 environment setup u...
Preface The project requirement is to determine w...
Deploy the MySQL environment locally (192.168.1.1...
1. Write a Mysql link setting page first package ...
1. Install openssh-server yum install -y openssl ...
This article uses examples to explain the knowled...
Table of contents Preface What are constructible ...
1: nginx server solution, modify the .conf config...
This article example shares the specific code of ...