Linux-network connection-(VMware and CentOS), linux-centos

Source: Internet
Author: User

Linux-network connection-(VMware and CentOS), linux-centos

Install CentOS in the vmwarevm to establish a network connection in two steps: intranet connection and internet connection.

Prerequisites:

After you install VMware correctly, the network adapter adds two new NICs: (you can view them in Device Manager> network adapter)

Step 1: intranet connection started when CentOS was installed

Click [custom hardware], network adapter-> Custom [VMnet8 (NAT mode)]. Of course, you can modify it after the installation is complete.

After the installation is complete, run [ip a] to view the current Nic.

Step 2: configure the NIC based on the selected VMnet8. The NIC configuration file naming rule is ifcfg-eno [number ].

[Root @ localhost ~] # Cd/etc/sysconfig/network-scripts/enter the configuration file directory

[Root @ localhost network-scripts] # ls-l you can easily find our Nic configuration file based on the configuration file name

[Root @ localhost network-scripts] # vi ifcfg-eno [number] modify the configuration file

 

In Control Panel \ network and Internet \ network connection, view the selected IPv4 address of VMnet8. The first three IP addresses of IPADDR must be the same as that of VMnet8, And the last IP address must be 0.

DEVICE = eno [number] // This is the NAME of the NIC = NAME = eno [number] ONBOOT = yes // do you want to start BOOTPROTO = static/static with startup, dhcp indicates random acquisition of ipIPADDR = ***. ***. ***. 150 // manually set the fixed IP address NETMASK = 255.255.255.0 // mask address, which is the mask

Of course, when you open the configuration file, you will see a lot of attributes, except the above attributes, can be deleted.

The NIC configuration file has been modified. Of course, you need to restart the NIC service.

[Root @ localhost network-scripts] # service network restart the network service

Step 3: How can I test whether the intranet connection is successful?

Method: 1. In windows cmd, ping the IPADDR you set. If the message is sent successfully, the message is successful.

2. In CentOS, ping the IPv4 address of VMnet8. If the message is sent successfully, the message is successful.

The above intranet connection is complete!

Step 4: add another ENI. The network connection is in the Bridging Mode: directly connecting to the physical network]

The virtual machine restarts automatically. In this way, the Internet connection is successful.

Test: ping www.baidu.com to access the Internet. Of course, you can also run the command ip address a to view the current Nic. The static ip address we set appears here.

 

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.