Detailed explanation of Centos 7 system virtual machine bridging mode

Foreword

This article mainly introduces you to the relevant content of the Centos 7 system virtual machine bridging mode, and share it for your reference and study. I won't say much below, let's take a look at the detailed introduction.

**The host cannot ping through the ip of the virtual machine centos7 system for the following reasons: **

1、 The host corresponds to the centos7ip segment (the key is that the gateway and the dns server have a one-to-one correspondence, see the following for specific operations)

2、 If the correspondence still fails, you can turn off the host and cenos7 firewall. The default firewall of centos7 is firewall, which is different from centos6

Related commands:

systemctl stop firewalld.service #Stop firewall

systemctl disable firewalld.service #Prohibit firewall startup

3、 After all the above settings are still not working, you can enter arp -a in the cmd of the host to check whether the mac ip bound to the gateway is the same as the ip you set in the virtual machine. Modify the ip address in the virtual machine to ping

The configuration of connecting to the external network in the virtual machine centos7

1. First, set the virtual machine connection method to bridge

Open the virtual machine, click "Edit"-"Virtual Network Editor" and click "Change Settings" to see the bridge mode. There are several options for bridge mode. Here you can choose between Ethernet-based or wireless LAN. The ip address of the virtual machine must correspond to the ip segment of the Ethernet or wireless network you selected (ie: the first three parts of the ip address must be consistent).

Click "Virtual Machine"-"Settings" and select "Bridge Mode" in "Network Adapter".

2. Enter the centos7 system of the virtual machine and modify the ip of centos7

1、 cd /etc/sysconfig/network-scripts/

2、 ls Ifcfg-ens33 appears here, it may be different for different machines.

3、 vi ifcfg-ens33

Host: ip: 192.168.111.46 Gateway: 192.168.111.1

4、: wq save and exit

5、 systemctl restart network.service restart network

6、 At this time, you can test whether the host can ping the virtual machine and the virtual machine can ping the external network.

3. If the above is not connected to the Internet, please configure dns

1、 nmcli connection show displays the currently connected network

If it is not displayed, it means that there is no network connection currently, and ens33 needs to be activated up

2、 Modify the DNS server corresponding to the current network connection, where the network connection can be identified by name or UUID

nmcli con mod ens33 ipv4.dns "114.114.114.114 8.8.8.8" here 114.114.114.114 and 8.8.8.8 are commonly used in China, but if it is a corporate LAN dns may be different, you can open the "Network Sharing Center" in the host ,

Click on the connected Ethernet or wireless network, open "Detailed Information", there will be "IPv4 DNS Server" and replace the copy in the above command

114.114.114.114 and 8.8.8.8

3、 Take DNS configuration into effect nmcli con up ens33

4、 systemctl restart network.service restart network

Then you can connect to the external network.

to sum up

The above is the entire content of this article. I hope that the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message and exchange. Thank you for your support to ZaLou.Cn.

Recommended Posts

Detailed explanation of Centos 7 system virtual machine bridging mode
Detailed installation steps of CentOS6.4 system in virtual machine
Tutorial diagram of installing CentOS 8 (1905) system on VMware virtual machine
Download of VM virtual machine and install centos7
Detailed explanation of building Hadoop environment on CentOS 6.5
Detailed explanation of static DNS configuration under Ubuntu system
Equal Insurance Evaluation: Detailed Explanation of Centos Timeout Exit
Detailed explanation of CentOS7 network setting tutorial in vmware
Linux CentOS 7 virtual machine clone
VMwareWorkstation10.0 install CentOS7.0 virtual machine
CentOS 6.8 virtual machine installation details
How to install Centos operating system on VMware virtual machine
Detailed explanation of Spark installation and configuration tutorial under centOS7
Detailed method of installing Kernel 5.x kernel version on CentOS 8 system
Detailed explanation of python backtracking template
Detailed explanation of python sequence types
Detailed explanation of ubuntu using gpg2
CentOS 8 installation of MariaDB detailed tutorial
Detailed use of nmcli in CentOS8
Detailed examples of Centos6 network configuration
Centos 7 RAID 5 detailed explanation and configuration
001. Installation of enterprise-level CentOS7.6 operating system
Detailed explanation of Python IO port multiplexing
Install CentOS7 virtual machine, configure docker suite
Detailed usage of Python virtual environment venv
Detailed explanation of -u parameter of python command
Detailed explanation of Python guessing algorithm problems
Centos7 installation and deployment of Airflow detailed
Analysis on the method of CentOS8 virtual machine to access Windows10 host folder
CentOS7 fully automatic installation CD production detailed explanation
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
Installation and configuration of JDK in CentOS 7 system
Detailed explanation of the principle of Python super() method
Summarize the knowledge points of Centos7 system reinforcement
Some basic optimizations of Centos6.9 system (updated on 2018/04/19)
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Detailed explanation of python standard library OS module
Centos7 installation of PHP and Nginx tutorial detailed
Use Ubuntu and windows system in virtual machine
Detailed explanation of the usage of Python decimal module
Detailed explanation of how python supports concurrent methods
Detailed explanation of data types based on Python
CentOS7 Docker Nginx deployment and operation detailed explanation
CentOS 7 install KVM and create a virtual machine
Detailed tutorial of installing nginx on centos8 (graphic)