In-company virtual machines install Linux systems and access the extranet in NAT mode

Source: Internet
Author: User

Use VMware to install CentOS in the company and access the extranet in NAT mode. The virtual machine dhclient gets the IP of 192.168.202.128, so the gateway is set to 192.168.202.1, but how can not access the extranet. Can ping through the intranet.

Here's how to fix it:

To view the virtual machine NAT settings:

Vmware-> Edit, virtual network Editor->nat mode->nat settings

In the NAT setup interface, you can view the gateway address as 192.168.202. 2 ; not 192.168.202. 1;

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/83/23/wKiom1drjK7RIrdcAAHYFL6qTsM291.png-wh_500x0-wm_3 -wmp_4-s_3710959127.png "title=" Nat.png "alt=" Wkiom1drjk7rirdcaahyfl6qtsm291.png-wh_50 "/>

To edit a virtual machine configuration:

[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0

hwaddr=00:0c:29:ba:da:6c

Type=ethernet

Uuid=2ece9dcb-bfaf-4b07-ac17-2f4256bd6b43

Onboot=yes

Nm_controlled=yes

Bootproto=static

ipaddr=192.168.202.128

netmask=255.255.255.0

gateway=192.168.202.2

To restart the network card:

Service Network restart

Test:

[[email protected] ~]# Ping www.baidu.com

PING www.a.shifen.com (61.135.169.125) bytes of data.

Bytes from 61.135.169.125:icmp_seq=1 ttl=128 time=2.33 ms

Bytes from 61.135.169.125:icmp_seq=2 ttl=128 time=3.20 ms

Bytes from 61.135.169.125:icmp_seq=3 ttl=128 time=2.41 ms

In-company virtual machines install Linux systems and access the extranet in NAT mode

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.