VM virtual machine configuration bridge network

1. Description

Virtual machine: VMware Workstation 15.5
System: centos 7
Network environment: WIFI (mobile phone hotspot)

2. Virtual network editor

First open the VM and edit it—select the virtual network editor,
insert image description here
grant administrator permissions, and click Change Settings:
insert image description here
Then this page will appear, we select VMnet0 (bridge mode),
insert image description here
at this time we press the shortcut key win+R, enter cmd, and enter the command line Enter ipconfig -all in , find the wireless LAN adapter, and see your own network card: (don’t turn it off, wait for the above information)
insert image description here
and then select this network card:
insert image description here
Then return to the virtual machine page, click on the network adapter, select Custom, select Just configure VMnet0, and start the virtual machine after confirming.
insert image description here

3. Use the command line to modify the network configuration file

Enter the centos terminal, enter the command: cd /etc/sysconfig/network-scripts/
and then use the ls command to list all files, find out your own network card, and use vi to edit:
insert image description here
change BOOTPROTO to static, and then write ip ( Write the same network segment) subnet mask, gateway and DNS, the above data can be viewed in the above windows command line. After saving and exiting, enter systemctl restart network.service
insert image description here
in the terminal to restart the network service. Then we use the ifconfig -a command to see if it takes effect: we find that the ip address is in the same network segment as the physical machine , then we ping Baidu to see if we can connect to the Internet: ping www.baidu.com , we can see that Netcom is connected , we are trying to ping Check the ip of the physical machine: it is also found, indicating that the network configuration is complete this time. Like it if you like it~~

insert image description here



insert image description here


insert image description here

Guess you like

Origin blog.csdn.net/qq_52012511/article/details/117406630