NAT mode of VMware virtual machine networking settings

Every time you want to use VMware to set up a service and do a test, you have to be tossed by its networking. Ever since, I have this time to write a blog, record it, and provide you with a reference.

VMware's networking ideas

1. First of all, my personal suggestion is not to think about whether some strange configuration or policy modification can connect the virtual machine to the external network. As long as you haven't moved it before, you don't need to consider the modification Places other than virtual machines and network adapters. VMware has been developing for so long, and it should be getting better and better. I didn't try those methods less at the time.

2. If you want the virtual machine to communicate with the external network, in my opinion, you only need to configure this part of the virtual machine to communicate with the external network.

3. When VMware is installed, there will be three more network adapters in the change adapter option of the local network settings. Here we only use VMnet8. Double-click to view the ipv4 address of VMnet8. This is a randomly generated address, as shown in the figure below. Remember this IP on your computer, you need to enter the virtual machine configuration.Insert picture description here

4. Enter the virtual machine, there is an "edit" in the upper left corner of the virtual machine, click to open the virtual network editor, as shown in the figure below, delete VMnet0 and VMnet1, or do not connect and disable. Avoid interference. Insert picture description here
Insert picture description here
Insert picture description here
5. There is a network adapter connection and configuration in the lower right corner of the virtual machine. As shown in Figure
Insert picture description here
Insert picture description here
6, open the terminal of the virtual machine, directly enter nmtui and press Enter to configure ens33 as shown in the figure below, confirm and exit.
Insert picture description here
7. Continue to operate the commands shown in the figure below on the terminal.
Insert picture description here
8. Execute ifdown ifcfg-ens33 and ifup ifcfg-ens33 in turn, and you can see success.

to sum up

1. If you have set up before, if you have not successfully connected to the Internet, restore the default settings in the "Edit" virtual network editor and re-operate.
2. Sometimes pinging local IP will not work. It depends on the status of VMware Virtual Ethernet Adapter for VMnet8. There is no network access permission. This will not affect. As long as you can connect to the external network, ping www.baidu.com will work. That's it, don't worry too much about pinging the local IP.
3. With this setting, even if you change the external network, it can be used normally and can be used after booting.
4. Oh yes, the IP address should be set in the range of 128 to 254.

Guess you like

Origin blog.csdn.net/weixin_48226988/article/details/108581008