Talk about network problems in VMware virtual machines

Source: Internet
Author: User

Introduction: With a few years of virtual machines, more or less will encounter some network problems, here to summarize a few years in the virtual machine encountered some network problems (mainly for Linux) ...

I. VMware-related Basics

1.bridged (bridging mode, VMnet0)
Equivalent to a separate host, if the LAN network (the IP address of the virtual machine is set to the same network segment, subnet, gateway, DNS and the same computer). If dial-up internet access (to establish a broadband connection in the virtual machine system, dial-up Internet).

2.NAT (network address translation mode, VMNET8)
is to let the virtual system use NAT (Network address translation) function to access the public network through the network where the host machine resides. The TCP/IP configuration information for a virtual system in NAT mode is provided by the DHCP server of the VMNET8 (NAT) virtual network and cannot be modified manually, so a virtual system with NAT mode will not be able to communicate with other real hosts on the local area network.

3.host-only (host mode, VMNET1)
In host-only mode, all virtual systems can communicate with each other, but virtual systems and real networks are isolated, and VMware virtual machines do not have access to the Internet. (Virtual systems and host machine systems can communicate with each other, equivalent to the two machines connected by twisted pair)

Two. Linux-related Basics

1. Configure the temporary IP
Ifconfig eth0 192.168.23.128 netmask 255.255.255.0

2. Configure static IP
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Type=ethernet
Device= "Eth0"
onboot= ' yes '
ipaddr=192.168.23.129
netmask=255.255.255.0
gateway=192.168.23.2
dns1=192.168.23.2
Bootproto=static
/etc/init.d/network Reload #重新导入ifcfg-eth0 Network configuration file, use after modifying the Ifcfg-eth0 profile

3. NIC configuration file
/etc/resolv.conf #DNS配置文件
/etc/sysconfig/network #centos系列配置网关
/etc/sysconfig/network-scripts/ifcfg-eth0 #centos系列配置ip地址
/etc/network/interfaces #ubuntu系列IP地址配置文件
/bin/hostname #ubuntu系列主机名称配置文件

4. Nic interface shutdown and activation
Ifdown eth0 #关闭网络
Ifup eth0 #启动网络

5. Network card Stop/start/restart:
* The following are CentOS series, if the Ubuntu series to change network to networking
/etc/init.d/network stop
/etc/init.d/network start
/etc/init.d/network restart
Or:
Service Network Stop
Service Network start
Service Network restart

Three. What happened to you

1.VMware The default network configuration is NAT mode (because it is the easiest ^_^ for beginners), but many novice users often encounter the installation of the virtual machine why not even the internet? (not a good deal without any manual configuration can directly access the Internet >_<). In fact, the biggest possibility is that your physical machine does not start VMware DHCP service and VMware NAT Service, direct computer right-click---> Management---> Services start ...

2. Firewall issues: often due to CentOS (iptables), Ubuntu (UFW) and cause a number of problems. For example, like to use Xshell classmate even their own virtual machine is often not connected, check for various reasons without the effect of iptables, perhaps there is an unexpected harvest. There is sometimes encounter can ping the IP but Ping does not pass the domain name, this also may be iptables in mischief Oh!

3. Can ping the IP but Ping does not pass the domain name is the most common is the DNS problem Oh, the simplest way to join dns1=8.8.8.8 directly in the above ifcfg-eth0, preferably with their own gateway or 114.114.114.114 ( Because I'm not a 8.8.8.8. Of course, you can also configure NameServer xx.xx.xx.xx in/etc/resolv.conf, but note that you need to add Peerdns=no in Ifcfg-eth0, or restart the NIC, it will be automatically cleared.

4. In fact, this large and small network problems still have a lot, to remember all of a sudden can not remember it ... Another great way to solve the problem is in VMware: Edit---> Virtual network editor---> Restore default settings. The combination of the above poses can be basically solved. Do not underestimate this approach, at that time I encountered a problem: virtual machine can access the external network, and can also ping the physical machine, but the physical machine is ping virtual machine, all kinds of methods have tried all over the internet has not solved the problem, finally I directly restore the default settings, then with the IP ... Oh, the problem is so easy to solve!!!

Talk about network problems in VMware virtual machines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.