Not able to connect to internet

Issues related to configuring your network
Post Reply
rmohan
Posts: 1
Joined: 2015/03/04 07:50:27

Not able to connect to internet

Post by rmohan » 2015/03/04 07:59:37

Hello,
I have configured NAT in my CentOS 6.4 VM, but can't connect to internet by giving the site names. For example, I can connect to google by its IP address http://74.125.224.72/ but not via www.google.com. I can also successfully ping outside IP addresses (like 8.8.8.8, 74.125.224.72 etc).
I configured a DNS server in my /etc/sysconfig/network-scripts/ifcfg-Eth0.
I am running this on my Windows 8.1 laptop.
These are the settings I have in my VM
[root@localhost cloudera]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:90:56:0B
inet addr:192.168.135.129 Bcast:192.168.135.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe90:560b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:930 errors:0 dropped:0 overruns:0 frame:0
TX packets:2351 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:352258 (344.0 KiB) TX bytes:188134 (183.7 KiB)

eth1 Link encap:Ethernet HWaddr 00:0C:29:90:56:15
inet addr:192.168.22.129 Bcast:192.168.22.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe90:5615/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:247 errors:0 dropped:0 overruns:0 frame:0
TX packets:269 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:18209 (17.7 KiB) TX bytes:20998 (20.5 KiB)
Interrupt:16 Base address:0x2024

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)

Content of /etc/sysconfig/network-scripts/ifcfg-Eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:90:56:0B"
IPV6INIT="yes"
NM_CONTROLLED="yes"
DNS1="8.8.8.8"
DNS2="8.8.8.8"
ONBOOT="yes"
TYPE="Ethernet"
UUID="cb2f52ec-b5d4-4fc2-bb4f-ec3f49245a2d"


Pls help.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Not able to connect to internet

Post by aks » 2015/03/05 17:13:08

That fact that everything works okay by using IP addresses, suggests the problem lies with DNS. What happens if you use dig to query a DNS server? Try:
dig @8.8.8.8 IN A www.google.com
host www.google.com
Also I think /etc/sysconfig/network-scripts/ifcfg-Eth0 should be /etc/sysconfig/network-scripts/ifcfg-eth0
Also simplify the connection by getting NM out of the way (change NM_CONTROLLED="yes" to NM_CONTROLLED="no" and IPV6INIT="yes" to IPV6INIT="no" - unless you are really using IPv6). Actually thinking about it, it might be the IPv6 thing as the fault. Imagine a scenario where you have a valid IPv6 address, but the router connecting to the Internet (or your ISP) doesn't support IPv6.

Post Reply