Linux Virtual Machine Setup network

Source: Internet
Author: User

Viewing IP under window is ipconfig

View under Linux is IP is ifconfig

When the window is mounted on a virtual machine, two network cards are virtual Vmnet1 vmnet8

Use the Ipconfig under window


in VMware Workstation, there are 3 virtual switches by default, VMNET0 (using bridged networks) ,VMnet1(Host network only) andVMnet8(Nat network),

Bridged Networking (bridge mode)

  in this mode, the VMware virtual operating system is like a separate host in the LAN, which can access any machine in the network. In bridging mode, you need to manually configure the virtual system with an IP address, subnet mask, and a host machine in the same network segment so that the virtual system can communicate with the host machine. Also, configure the gateway and DNS addresses to enable access to the Internet through a LAN gateway or router.

Network address Translation (NAT mode)

  using NAT mode, the virtual system uses the NAT (network address translation) function to access the public network through the network where the host machine resides . In other words, the use of NAT mode enables access to the Internet in virtual systems. 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 the virtual system cannot communicate with other real hosts on the local area network. The biggest advantage of using NAT mode is that the virtual system access to the Internet is very simple, only the host machine can access the Internet, you do not need to configure the IP address, subnet mask, gateway, but the DNS address should be filled according to the actual situation. Add a DNS address in addition to the network card properties, you can also add it by tapping the Edit button in the Nat tab in the Virtual network editor in the virtual machine.

If you just let the virtual function on the Internet, the two modes can be, with the bridge if you have a legitimate address in the LAN, such as your ADSL cat is the leading way by the function, if it is in the unit, it will be network management to your legitimate IP (now the company is the Mac and IP binding). Now is the host and virtual machine interoperability, if your ADSL led by the function, that shut down the virtual machine DHCP, select Bridge, check whether 2 machine is assigned the same network segment IP, shut down the firewall.

Choose which method to set in the virtual machine-settings-Network adapter-Custom virtual network

How the Linux system changes the network configuration:

1.Setup

Log in as root and use the Setup command

This configuration does not take effect immediately

You must run /etc/rc.d/init.d/network restart to take effect

2. ifconfig eth0 x.x.x.x to configure the NIC

ifconfig eth0 network x.x.x.x Subnet mask configuration

This configuration will take effect immediately,

But only temporarily, log off or shutdown will revert to the original

3. Modify /etc/sysconfig/network-scripts/ifcfg-eth0

This configuration does not take effect immediately

You must run/etc/rc.d/init.d/network restart to take effect

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.