1. Virtual machine network settings, Linux network settings:
In the configuration of virtual machines, there are 3 kinds of network configuration we often need to choose, namely: Bridge mode, Nat mode, Host only mode. As shown in the following:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8A/2E/wKiom1gp183SnHQvAAB3r0lYXK0063.png-wh_500x0-wm_3 -wmp_4-s_3527058006.png "title=" 004.png "alt=" Wkiom1gp183snhqvaab3r0lyxk0063.png-wh_50 "/>
If bridge mode is selected, the virtual machine is using a native real network card. This is the Wired network card (Ethernet) and wireless network card (WLAN) in the NIC. The advantage of using bridging mode is that the configuration is simple, as long as the virtual machine is set up with the IP address of the same network segment as the Windows host, you can communicate with the Windows host. At the same time, the virtual machine can also communicate with the real host in the same network segment of other hosts, while using the NAT and host only mode, you can only communicate with the native.
But the disadvantage is that the virtual opportunity occupies a host network segment of the IP (if in the same network segment many people use this way to configure, may occur IP is not enough, and an IP conflict occurs).
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8A/2B/wKioL1gp2onBLrJxAACvwtoAVaE425.png-wh_500x0-wm_3 -wmp_4-s_563701212.png "title=" 005.png "alt=" Wkiol1gp2onblrjxaacvwtoavae425.png-wh_50 "/>
After the virtual machine is installed, two virtual network cards are generated, respectively VMnet1 and VMnet8 (as shown).
If NAT mode is used, virtual network card VMnet8 is used to communicate with the host. In host only mode, virtual network card VMnet1 is used to communicate with the host.
The difference between NAT and host only is that the host only mode can communicate with hosts, but when using NAT mode, the NAT mode virtual machine can also access the Internet, in addition to communicating with the host, if the host can access the Internet.
1.1 Host Only mode experiment:
Virtual Machine Network Configuration Select "Host only mode" and log on to the Linux virtual machine.
The direct input command "ifconfig" does not add parameters, is to query network card information:
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8A/2E/wKiom1gp3fLzOIGqAAAcmii29Rw875.png-wh_500x0-wm_3 -wmp_4-s_2299931256.png "title=" 006.png "alt=" Wkiom1gp3flzoigqaaacmii29rw875.png-wh_50 "/>
At this point, you can see that there is only one Nic Lo, which is the "native loopback network card". All operating systems have this NIC, which is used primarily for local communication and testing.
If you assign NICs in Linux, the names are eth0, eth1、...
The following command ifconfig eth0 192.168.119.2来 sets the first NIC information. At this point, the input ifconfig command will be able to see the network card we have just configured eth0.
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8A/2B/wKioL1gp4D6T5wmBAAAxYPhuiHc585.png-wh_500x0-wm_3 -wmp_4-s_2127488549.png "title=" 007.png "alt=" Wkiol1gp4d6t5wmbaaaxyphuihc585.png-wh_50 "/>
At this point, if we set up the IP information of our VMNET1 network card, and the IP of the Linux eth0 network card in the same network segment, the Windows host can communicate with the Linux virtual machine (in Windows, the IP address of the Linux eth0 network card is ping).
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/2B/wKioL1gp4U6Tyn3lAAB40d706ZQ580.png-wh_500x0-wm_3 -wmp_4-s_3079174378.png "title=" 008.png "alt=" Wkiol1gp4u6tyn3laab40d706zq580.png-wh_50 "/>
1.2 Bridging Mode:
If bridging mode is used, the network card of the physical machine is used directly. Direct connection, note that the Linux network card IP address as long as the actual use of the IP card in the same network segment can communicate.
1.3 Virtual Machine "virtual Network editor"
In the virtual machine Software "edit"-"Virtual network editor", VMnet0 is used for bridging, you can choose which network card to bridge (the default is automatic, if the host uses a wired connection select the wired network card, otherwise select the wireless network card).
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/2F/wKiom1gp7p6x6cWbAABnwyQjgpM222.png-wh_500x0-wm_3 -wmp_4-s_2112234700.png "title=" 009.png "alt=" Wkiom1gp7p6x6cwbaabnwyqjgpm222.png-wh_50 "/>
If there is a problem with bridging, you can try modifying the bridge to option. If you still have a problem, try "restore default settings."
This article is from the "Snowflake" blog, make sure to keep this source http://6216083.blog.51cto.com/6206083/1872841
Linux Learning Record