Unable to connect CentOS VM to internet (NAT connection)


Gordisk

So, after battling the VMWare networking giant for a day, I decided to give in and ask for help. I'm running a CentOS 6 image on Windows 7 with NAT on VMWare Workstation 8.0.2 build-591240 and for some reason I can no longer connect to the internet with a static IP address. This only seems to work with static, not with DHCP, which tells me this: Either a program on the Windows 7 OS is blocking connections to that IP address, or something strange is happening with the configuration on the CentOS image.

I don't know if this is due to a yum update, so I tried reinstalling VMWare tools. This doesn't seem to solve the problem. I also tried the following:

  1. Make sure the VMnet connection is connected (stupid, but have to check... I can also connect to the internet using DHCP)
  2. Make sure my firewall on Windows allows VMware to connect to the internet
  3. I've seen/read that Windows sometimes blocks ping requests, so I tried accessing www.google.com in Firefox, which got "The server did not find a response"... so I have to do something different with the DNS? ?
  4. I checked the Windows computer's registry and there is only 1 entry for the default gateway

Like I said, this seems to happen suddenly. Images can be connected to the internet without any problems. Does anyone know of a CentOS update that could be causing this issue? I've added my configuration below to save some debugging cycles:

[root@MyCentOS ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:A0:51:BD
          inet addr:192.168.88.128  Bcast:192.168.88.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:683 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:64242 (62.7 KiB)  TX bytes:8055 (7.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1049 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1049 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:68417 (66.8 KiB)  TX bytes:68417 (66.8 KiB)


[root@MyCentOS ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR=192.168.88.128
NETMASK=255.255.255.0
GATEWAY=192.168.88.2
TYPE="Ethernet"

[root@MyCentOS ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=MyCentOS
GATEWAY=192.168.88.2

[root@MyCentOS ~]# service iptables status
iptables: Firewall is not running.
[root@MyCentOS ~]# service ip6tables status
ip6tables: Firewall is not running.
[root@MyCentOS ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@MyCentOS ~]# ping 192.168.88.2
PING 192.168.88.2 (192.168.88.2) 56(84) bytes of data.
64 bytes from 192.168.88.2: icmp_seq=1 ttl=128 time=0.391 ms
64 bytes from 192.168.88.2: icmp_seq=2 ttl=128 time=0.271 ms
^C
--- 192.168.88.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1349ms
rtt min/avg/max/mdev = 0.271/0.331/0.391/0.060 ms

[root@MyCentOS ~]# ping www.google.com
ping: unknown host www.google.com

[root@MyCentOS ~]# uname -a
Linux MyCentOS 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@MyCentOS ~]# vmware-toolbox-cmd -v
8.8.2.10499 (build-590212)
programmer

Your best bet is to have it automatically obtain an IP from DHCP:

dhclient -v

This will make centos get ip automatically.

Related


Ubuntu: Unable to connect to host's internet connection using NAT

username I have Lubuntu installed on Virtualbox. I am using Windows 7 x64. My VM is the 32 bit version. The internet works with a bridged adapter, but I'm trying to use NAT so the VPN works. In Windows' Network and Sharing Center, I see a "VirtualBox host-only

Ubuntu: Unable to connect to host's internet connection using NAT

username I have Lubuntu installed on Virtualbox. I am using Windows 7 x64. My VM is the 32 bit version. The internet works with a bridged adapter, but I'm trying to use NAT so the VPN works. In Windows' Network and Sharing Center, I see a "VirtualBox host-only

Ubuntu: Unable to connect to host's internet connection using NAT

username I have Lubuntu installed on Virtualbox. I am using Windows 7 x64. My VM is the 32 bit version. The internet works with a bridged adapter, but I'm trying to use NAT so the VPN works. In Windows' Network and Sharing Center, I see a "VirtualBox host-only

Ubuntu: Unable to connect to host's internet connection using NAT

username I have Lubuntu installed on Virtualbox. I am using Windows 7 x64. My VM is the 32 bit version. The internet works with a bridged adapter, but I'm trying to use NAT so the VPN works. In Windows' Network and Sharing Center, I see a "VirtualBox host-only

VirtualBox VM cannot connect to internet via NAT

totem I'm trying to figure out why my guests can't connect to the internet when they're connected to a NAT network. I have provided screenshots of the settings below. I only have this problem on lubuntu. My friend and I both work on 2 different linux systems w

VirtualBox VM cannot connect to internet via NAT

totem I'm trying to figure out why my guests can't connect to the internet when they're connected to a NAT network. I have provided screenshots of the settings below. I only have this problem on lubuntu. My friend and I both work on 2 different linux systems w

VirtualBox VM cannot connect to internet via NAT

totem I'm trying to figure out why my guests can't connect to the internet when they're connected to a NAT network. I have provided screenshots of the settings below. I only have this problem on lubuntu. My friend and I both work on 2 different linux systems w

Unable to connect to VirtualBox VM from Kubuntu host using NAT

Gilberts I am using Kubuntu 13 as host and Xubuntu 12 as guest. In the VM network options, I selected NAT, and like 127.0.0.1:23 => 10.0.2.15:22. I can access the internet from the guest, but when I try to SSH to the guest, I get connection refused. Recently I

Eclipse: Unable to connect to remote VM. Connection refused.

Width: Whenever I try to start eclipse debugging (for server side code) I get the following error Cannot connect to remote VM. Connection refused. What could be the problem? I've tried most of the solutions on the web, but none solved my problem. Can anyone he

Eclipse: Unable to connect to remote VM. Connection refused.

Width: Whenever I try to start eclipse debugging (for server side code) I get the following error Cannot connect to remote VM. Connection refused. What could be the problem? I've tried most of the solutions on the web, but none solved my problem. Can anyone he

Eclipse: Unable to connect to remote VM. Connection refused.

Width: Whenever I try to start eclipse debugging (for server side code) I get the following error Cannot connect to remote VM. Connection refused. What could be the problem? I've tried most of the solutions on the web, but none solved my problem. Can anyone he

CentOS loses internet connection

Denis Sablukov I have configured CentOS VM and NetworkManager is disabled. question: When I start the VM, I have internet access, but after a while I lose it. How can I fix this? Farhaz Azimi In the first step you say: When I start the VM, I have internet acce

CentOS loses internet connection

Denis Sablukov I have configured CentOS VM and NetworkManager is disabled. question: When I start the VM, I have internet access, but after a while I lose it. How can I fix this? Farhaz Azimi In the first step you say: When I start the VM, I have internet acce

Unable to connect VM in VirtualBox

jayftw I couldn't find any help anywhere, so I wanted to ask a question here. I have two VirtualBox VMs, one Fedora 23 and one Windows7. I'm trying to get them to communicate via VirtualBox using a virtual network (I hope that's the correct term). I have tried

Unable to connect VM in VirtualBox

jayftw I couldn't find any help anywhere, so I wanted to ask a question here. I have two VirtualBox VMs, one Fedora 23 and one Windows7. I'm trying to get them to communicate via VirtualBox using a virtual network (I hope that's the correct term). I have tried

Unable to connect vm to IPv6 internet via virtual tap interface

uMdRupert I can't connect the vm to the IPv6 internet via the virtual click device on the host . That is, I cannot ping ipv6.google.com or the global primary interface address of a public IPv6 host. predecessor: -bash-4.2$ ping6 ipv6.google.com PING ipv6.g

Unable to connect vm to IPv6 internet via virtual tap interface

uMdRupert I can't connect the vm to the IPv6 internet via the virtual click device on the host . That is, I cannot ping ipv6.google.com or the global primary interface address of a public IPv6 host. predecessor: -bash-4.2$ ping6 ipv6.google.com PING ipv6.g

Unable to connect to wireless connection

bet Take a look at this question in Unix SE . You can let me ask questions in the more appropriate community. However, this is not an easy question for me. When I searched on the internet, I didn't get any relevant solutions. I lost the wireless connection whe

Unable to connect MemoryStore from VM

Dekuji I have created VM instance and MemoryStore instance in the same project but can't connect from VM. # telnet 192.168.1.4 6379 Trying 192.168.1.4... telnet: connect to address 192.168.1.4: Connection timed out The VPC that the VM belongs to is designated

Unable to connect MemoryStore from VM

Dekuji I have created VM instance and MemoryStore instance in the same project but can't connect from VM. # telnet 192.168.1.4 6379 Trying 192.168.1.4... telnet: connect to address 192.168.1.4: Connection timed out The VPC that the VM belongs to is designated

Unable to connect to web server on localhost behind NAT

tears I have Ubuntu as the host. I am running a web server on http://192.168.199.8:80. It's accessible from the local network, but when I try to access it via the external IP, I go to the router's web page. I arranged a port forward of port 80 on my router to