2021/3/16 "VMware virtual machine network configuration-bridge mode"

Foreword: Using VMware's bridging mode, you can be in the local area network as if you have another computer with a different operating system. You can also access the Internet, communicate with other machines in the LAN, and even expose the ip and port to the public network, so that other machines or web pages can also access it.

note:我们在配置桥接模式时,1.虚拟机网段一定要和主机处于同一网段! 2.如要联网,网关和DNS服务器地址也要和主机的相同!!!

Configuring the bridge mode is mainly divided into the following steps:

1. Obtain host network configuration information
2. Modify VMware virtual network editor information
3. Modify virtual machine network configuration information

Next we start the network configuration of bridge mode:


1. Obtain the host's network configuration information:

We first check our local network information, here we can enter the command line mode and enter ipconfig, or enter the adapter settings to view.
Insert picture description here

Double-click to open, click on the details.

Insert picture description here
The following is the host network information we obtained:

Host IP address: 192.168 1.111 (标红的1即为主机所在网段)
Host Default Gateway: 192.168.1.1
host DNS server address: 219.146.1.66

2. Modify VMware virtual network editor information

We open vmware, click edit, and then click the virtual network editor.
Insert picture description here
After entering the administrator mode, click Bridge Mode.Insert picture description here

Note : The network card you choose to bridge to must be the same as the one you just viewed!

Finally, click OK to end this step.

3. Modify the virtual machine network configuration information

Open our VMware workstation,
select the virtual machine to be configured, and click Edit virtual machine settings.
Insert picture description here
Click on the network adapter, bridge mode, and then confirm.
Insert picture description here
Open this virtual machine

  • Use the cd command to view the changed directory:
    cd /etc/sysconfig/network-scripts/

Insert picture description here
(The arrow points to the virtual machine network card configuration information)

Next we use the vim editor to modify the information:

  • input the command:
    vim ifcfg-ens33

Insert picture description here
Enter the edit page:
Insert picture description here
Be sure to restart the network card after saving! !

  • OpenEulerOS and centOS8 use the following command to restart:
sudo nmcli c reload     #重新加载网络连接
sudo nmcli c up enp0s3  #重启网卡

Insert picture description here
Next, we ping the external network to test whether the network configuration is successful.
Insert picture description here
The configuration is successful!

Guess you like

Origin blog.csdn.net/qq_47354826/article/details/114888325