Test work-101-Solve the networking problem of VMware virtual machine Centos 7

Foreword:

    In the process of learning software testing, we will definitely use the Linux system. Generally, we will install the virtual machine VMware on our computer. After installation, the first thing to do is to solve the networking problem of the virtual machine Linux. I refer to major blogs and do it myself. Summarized a solution. Pro-test email

Note: The virtual machine installation process will not be repeated

Two problems with virtual machine networking:

       1. The local Windows network is automatically obtained       

       2. The local Windows network is manually set ip, gateway, DNS

My strategy is applicable to the above two situations

1. View ip from the command line on Windows

After the installation is complete, first enter the command line on your own Windows to check the ip situation, as shown in the figure below for details

ipconfig

 

 

Under normal circumstances, VMware will virtualize multiple Ethernet adapters. We only leave the ones with VMnet8. How to delete the others? as follows

Two, modify the pseudo-network editor

Open your own VMware virtual machine, click Edit to view the virtual network editor, as shown below,

 

 

We can delete everything except vmnet8, and then check the gateway settings and DNS in the NAT settings, and then remember the following 

Subnet ip, subnet mask, DNS seems to be 8.8.8.9 (do you not know the general purpose)

Note: Use the local DHCP server IP address to assign to the virtual machine. This option can be left unchecked. If the following test fails, then come back and check it again, and test it.

Three, open Linux configuration ip address

Open Linux, use the terminal, enter the command

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33



//备注:1、if-cfg-ens33这个文件不同的centos版本,文件名不同,
//     2、network-scripts目录一般不变
//     3、根据情况到目录下自己查找

note:

BOOTPROTO=static static IP

BOOTPROTO=dhcp dynamic IP

BOOTPROTO=none None (do not specify)
Usually it is dhcp or static. The address is obtained by specifying the method. If it is not specified, there may be problems.

 

 Pay attention to the two points shown in the red box above, save and exit after modification.

Then execute the command ping baidu.com in the terminal, if it works, it means no problem. The network configuration is successful.

Remarks:

(1) If the various network configurations of the virtual machine are messed up, you can restore the default settings as shown below

In general, if the native Windows and Linux both obtain ip addresses automatically, there will be no problems with the network, but if the native ip addresses are manually configured as needed, problems will occur on the network virtual machine. The above strategy should be able to solve.

If you have any questions, you can leave a message: you must reply when you see it.

Guess you like

Origin blog.csdn.net/u013521274/article/details/107931551