Page 1 of 1

No Internet Connection on VMware CentOS 6.5

Posted: 2017/05/13 14:18:40
by sandeep5041
I am facing a similar issue. As I don't have much knowledge on network admin part, i am unable to fix this issue.
Any help on this is greatly appreciated.
[Moderator: post was split away from an old dead thread: viewtopic.php?f=16&t=56639 ]

I have setup Centos 6.5 in Wndows 7 on VMWare workstation 11.0.
Using "Bridged" network connection in network adapter settings.
Using WIFI at home.

Below is the setting in Centos VMWare workstation.

[root@ ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
ONBOOT="yes"
NM_CONTROLLED="no"
TYPE=Ethernet
IPADDR="192.168.56.10"
NETMASK="255.255.255.0"
BOOTPROTO=static
DNS1=192.168.1.1

[root@ ~]# cat /etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.8.8

Below is the IP config output from my local windows:

C:\Users\>ipconfig

Windows IP Configuration


Ethernet adapter Bluetooth Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Wireless Network Connection:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::5904:e4a:64a6:5c23%15
IPv4 Address. . . . . . . . . . . : 192.168.1.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Local Area Connection 3:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::19dc:a10c:ce43:c2da%32
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::b493:66c:d1f6:716f%40
IPv4 Address. . . . . . . . . . . : 192.168.37.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::289e:9f66:aaf:4176%41
IPv4 Address. . . . . . . . . . . : 192.168.83.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :


I am able to connect to VMware from putty using "192.168.56.10" IP address. But when i execute any command which needs internet connection , it fails. An example is provided below.

[root@ ~]# yum install createrepo
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6 ... 64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

Re: No Internet Connection on VMware CentOS 6.5

Posted: 2017/05/14 10:33:22
by TrevorH
First off: don't use 6.5. It's old, unmaintained and out of date and has severe security vulnerabilities. Make sure you run yum update as soon as you can once you have a network connection so that you are running 6.9. Running 6.5 is crazy.

You have no GATEWAY= line in your ifcfg file. If you don't have one in /etc/sysconfig/network then you will have no default route and nothing outside your own LAN addresses will be reachable.

You also appear to have both VirtualBox and VMWare installed and running at the same time as your Windows ipconfig output shows virtual adapters with addresses of 192.168.56.1 (vbox) and 192.168.37.1 (VMWare) and 192.168.83.1 (also VMWare). Since 192.168.56 belongs to VirtualBox and not VMWare I suspect that you shouldn'r be using those addresses at all but picking one of 192.168.37 or .81. However, since you say you're using bridged mode networking, both of those are probably wrong and you should really be using an ip address in the same subnet as your host - 192.168.1.x.

So, my thoughts are: first pick ONE of VirtualBox OR VMWare and stick to it. Don't try to run both at the same time. If you use bridged mode networking then you should probably be using an ip address within the same subnet as your host machine and using the same gateway ip that that uses. If you want to use a 192.168 address that isn't in 192.168.1.0/24 then you should probably be using a NAT network mode not bridged.