In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how the UBUNTU virtual machine in VMWARE sets static IP to access the Internet through NAT". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to set static IP in VMWARE to surf the Internet through NAT".
The code is as follows:
Move / delete rules files. (not verified)
Ubuntu creates a new rules file after reboot.
Identify the new network card as eth0 and follow the network configuration of the original eth0.
If the network configuration is to obtain the IP automatically, no further modifications are required.
Sudo mv / etc/udev/rules.d/70-persistent-net.rules / etc/udev/rules.d/70-persistent-net.rules.old
After rebooting, the network is normal.
The next step is to set up static IP. Generally speaking, when connecting with NAT, the virtual system is generally set to DHCP to dynamically obtain the IP address. However, in some cases, we need it to be a static IP, which is convenient for us to manage and operate. Is there any way? Yes, there is!
In the NAT network, the network card equivalent to the virtual machine and the VMware Network Adapter VMnet8 virtual network card of the host are connected to the VMnet8 virtual switch provided by the virtual machine software, so the host communicates through the virtual network card VMware Network Adapter VMnet8, and it can be known that VMware Network Adapter VMnet8 is just a virtual network card used by the host to communicate with the virtual machine. In this network structure, VMware provides a virtual NAT server and a virtual DHCP server (in fact, two services in the host system service) for the virtual machine, and the virtual machine uses these two services to connect to the Internet, so under normal circumstances, the virtual machine system can access the Internet as long as it is set to get IP automatically.
Then look at the properties of the virtual switch VMnet8 in VMware and the NAT properties of the virtual network card VMware Network Adapter VMnet8, and find that VMnet8 is in the 192.168.110.0 subnet, and the GATEWAY of VMware Network Adapter VMnet8 is 192.168.110.2 in VMware (edit- > virtual network editor- > choose VMnet8- > click nat setting to find gateway). After experiments, it is found that the GATEWAY is the same address when the virtual machine uses DHCP. This address should be the address of the virtual NAT server. So at this point, my virtual machine is going to set up static IP, and the gateway is 192.168.110.2.
At the same time, in order to ensure the communication between the virtual machine and the host, the IP of the virtual machine needs to be in the same network segment as the host's VMware Network Adapter VMnet8 network card. The IP of VMware Network Adapter VMnet8 is automatically assigned when installing VMware, and what I see on my computer is 192.168.110.1. Therefore, the IP of the virtual machine is set to 192.168.110.172. DNS is still the DNS server for my host, which is 202.118.192.2 in the school network center.
The setting result is:
Vi / etc/network/interfaces
The code is as follows:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces (5).
# The loopback network interface
Auto lo
Iface lo inet loopback
# The primary network interface
Auto eth0
Iface eth0 inet static
Address 192.168.110.172
Gateway 192.168.110.2
Netmask 255.255.0.0
Restart the network card: / etc/init.d/networking restart
After this setup, the virtual machine can communicate with the host and connect to the Internet. Among them, the communication between the virtual machine and the host is determined by its IP, the IP of the IP is the same as that of the host's virtual network card VMware Network Adapter VMnet8, and the connection to the Internet uses the NAT service provided by VMware to route the virtual switch VMnet8, that is, the gateway is set as the address of the virtual NAT server. Here, because static IP is used, VMware's DHCP service is not used.
In fact, having said so much, the key point is to get information such as gateways. Knowing this is no different from other static IP settings.
The above is all the contents of the article "how to set up static IP to surf the Internet through NAT in the UBUNTU virtual machine in VMWARE". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.