Redhat in virtual machines (bridged, nat, host-only)

Source: Internet
Author: User

 

I. Bridged mode:

Change the Internet access method to bridge

 

#1. Modify/etc/sysconfig/network-scripts/ifcfg-eth0:

#2. Modify/etc/resolv. conf

In fact, this configuration file can also be modified without being changed. Using bridged will automatically detect the configuration file.

#3. test:

 

Ii. nat Mode

Change the Internet access mode to nat mode and share the IP address with the host.

 

#1 set the IP address of VMware Virtual Ethernet Adapter for VMnet8 (Control Panel \ network and Internet \ Network Connection) as follows, and DNS does not need to be set:

 

#2. Modify/etc/sysconfig/network-scripts/ifcfg-eth0:, as shown below

 

How to set the gateway here:

Choose VMware Edit> Virtual Network Editor> VMnet8> NAT Settings, as shown below:


#3. Add DNS domain name resolution

Vi/etc/resolv. conf. My settings are as follows:

 

How to Set nameserver see: http://blog.csdn.net/yueguanghaidao/article/details/7038864

#4. Test

 

Iii. hostonly

Change the Internet access mode to hostonly

To enable the hostonly mode to connect to the Internet, you must use network sharing.

 

#1. Enable network sharing

Here I use the network sharing of local connections (or other networks, such as wireless networks)

Open Control Panel \ network and Internet \ Network Connection

Local Connection-> properties-> share, select VMnet1 for network connection, as shown below

 

Click OK. The following prompt is displayed:

If connection sharing is enabled, the IP address of Vmnet1 will change to 192.168.137.1.

Click OK. The problem is as follows:

 

 

In this case, because a service is not enabled, open the Service (enter services. msc in the running process)

Find Windows Firewall and right-click Start, as shown below:

 

 

Then, perform the preceding operation again. After the operation is complete, check whether the IP address of vmnet1 is 192.168.137.1?

 

#2 .. Modify/etc/sysconfig/network-scripts/ifcfg-eth0:

 

Note: The Gateway is the IP address of vmnet1.

 

#3. Add DNS domain name resolution

Vi/etc/resolv. conf. My settings are as follows:

 

Nameserver will not talk about it again.

 

#4. Test

 

All three Internet access methods have been completed successfully.

 

 

From yihaibobb's column

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.