Several minor issues with VMware7 and RHEL6 Internet sharing

Source: Internet
Author: User
Physical Machine: window2003sp2VM version: Listen-203739 Virtual Machine: RHEL6.0 physical machine: 2k3ip: 192.168.20.8netmask: 255.255.255.0gw: 192.168.2.1 Virtual Machine: rhel6ip: 255.255.2550gw: 10.1.10.1 use NAT to connect to N

HOST: window 2003 sp2
VM version: VMware Workstation 7.0.0 build-203739
Virtual Machine: RHEL6.0

Physical Machine: 2k3
Ip: 192.168.20.8
Netmask: 255.255.255.0
Gw: 192.168.2.1

Virtual Machine: rhel6
Ip: 10.1.10.234
Netmask: 255.255.2550
Gw: 10.1.10.1

Use NAT connection
NAT is connected to the default virtual Network card 8: VMware Network Adapter VMnet8
Vnic 8:
Ip: 10.1.10.1
Netmask: 255.255.255.0

The DHCP protocol on vnic 8 has not been enabled at the beginning,
Result In rhel6, the physical ip address of 2k3 can be pinged (192.168.20.8 ),
However, the physical gateway (192.168.2.1) cannot be pinged ),
Therefore, the Internet cannot be accessed.

Later, the DHCP protocol on vnic 8 was enabled,
As a result, you can ping the physical gateway (192.168.2.1,
You can also ping the Internet ip address,
However, an IP address conflict warning will appear on 2k3,
Wait a while and ping the Internet again.

If the DHCP protocol on vnic 8 is enabled,
Set vnic 8 to automatically obtain the ip address,
You can ping the internet.

Try Setting gw of vnic 8 to 10.1.10.1,
When the ip address is set to 10.1.10.2, You can ping the internet.

Later, we found that as long as the gw of vnic 8 is set to 10.1.10.1,
When the ip address of vnic 8 and gw are in the same network segment and are not the same ip address, you can ping the internet,
It doesn't matter if the DHCP service of vnic 8 is enabled or not.

Now the connection is normal,
But still cannot ping the Internet domain name,
So we started to configure the dns of rhel6.

* In the preceding steps, no matter whether the DHCP protocol on vnic 8 is enabled or not, rhel6 always uses static IP.

When rhel6 dns is configured,
This command is used: system-config-network
Then select Device configuration,
Then eth0,
Then a Primary DNS Server is added as 8.8.8.8,
Last save,
After exiting,
We can ping 8.8.8.8 but still cannot ping qq.com,
Cat/etc/resolv. conf and later found that 8.8.8.8 has not been written into the configuration.

Again system-config-network,
Select DNS configuration this time,
Add 8.8.8.8 to Primary DNS,
Save and exit,
You can ping qq.com,
Cat/etc/resolv. conf and later found that 8.8.8.8 is also written into the configuration.

Summary:
To connect a virtual machine to the Internet, the gw of the corresponding virtual network card must be the same as that of the virtual machine, but the ip address of the virtual network card and gw cannot be the same.

The DNS resolution address of RHEL6 needs to be configured in DNS configuration or/etc/resolv. conf.

Related Article

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.