Linux Virtual Machine Network configuration

Source: Internet
Author: User

In order for the CentOS virtual function in the VirtualBox to connect to the network, the virtual machine needs to be assigned a NAT-enabled network card:

In order to connect the virtual machine via SSH, a network card is allocated to bridge to a network card of the physical machine. Create a new loopback network card here:

Enter devmgmt.msc in the runtime to open the Device Manager and select "Add Outdated Hardware":

    

Install the hardware I selected manually from the list-network adapter-microsoft-loopback Adapter

This adds a loopback network adapter that mezzanine bridge the virtual machine to the network:

    

  

After the physical connection is complete, you also need to assign an IP address. Assign the 2nd NIC of the virtual machine to the same network segment as the host loopback network card, for example: 192.168.100.0

To configure the/etc/sysconfig/network-scripts/ifcfg-eth1 for a virtual machine:

Device=eth1hwaddr= ,:xx: -: 4e:b1:f0type=Ethernetuuid=d67efa45-ca55-49c2-836d-De6e8e771166onboot=yesnm_controlled=Yesbootproto=staticipaddr=192.168.100.2NETWORK=192.168.100.0NETMASK=255.255.255.0Broadcast=192.168.100.255

To turn off SELinux for a virtual machine:

Vi/etc/selinux/config Change selinux=enforcing to selinux=disabled

To turn off Windows Firewall:

1, if unable to modify the network location, first control Panel-management tools-Local Security policy-network list policy management, the "Unrecognized network" network location changed to private;

2, Firewall-Advanced settings-operation-Properties, status column of the custom, cancel the relevant network card before the tick:

        

Complete, you can now access the system on the virtual machine via SSH

Linux Virtual Machine Network configuration

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.