2

i am having ubuntu 14.04 lts on machine.Though it is showing connected to LAN in network manager but it cant access internet.

8

There are few steps you should follow while debugging internet connectivity I assume you use DHCP and NetworkManager for configuration.

1) Check if you have IP address assigned Open terminal end enter

ifconfig

If you see something like this containing inet addr than it is ok

eth0      Link encap:Ethernet  HWaddr 00:23:74:3d:92:90 
          inet addr:192.168.1.2  Bcast:192.168.1.15  Mask:255.255.255.240

2) Check if you have default gateway assigned. Open terminal and enter

netstat -r

If you see similar output containg line beginning with default than it is ok

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

3) Check if you can ping default gateway. Open terminal and enter

 ping 192.168.1.1

where 192.168.1.1 should be replaced with adress you see in nestat -r output

You should see something like this

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.265 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.235 ms
64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.221 ms

4) Check if you have DNS server assigned. Open terminal and enter

cat /etc/resolv.conf

You should see at least one line containing word nameserver

nameserver 8.8.8.8

5) Check if you can ping DNS server. Open terminal and enter

 ping 8.8.8.8

where 8.8.8.8 should be replaced with address you see in cat /etc/resolv.conf output

You should see something like this

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=25.5 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=26.1 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=24.9 ms

6) Check if you can resolve DNS names. Open terminal and enter

host www.google.pl

You should see something like this

www.google.pl has address 216.58.209.67

If any of the steps fails than it needs further investigation.

1
  • All this worked for me but still no internet connection. DNS is working fine but i cant ping the ip address on this computer. – Philip Rego Feb 21 '20 at 21:32
0

Switch firewall off temporarily. See if that works.

Darek's helpful checklist identified the source of the problem.

Was unable to (3) ping my default gateway.

Because... firewall.

-1

if you got step 6 of @Darek's answer and saw this in your /etc/resolv.conf file has comments like this: (it might be empty without the commments too)

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

generate the DNS contents like this:

Step 1:
Install the resolvconf package, it enables you to make permanent changes to the resolv.conf file sudo apt install resolvconf

Step 2:
Edit /etc/resolvconf/resolv.conf.d/head and add the following:

   # Make edits to /etc/resolvconf/resolv.conf.d/head.
   nameserver 8.8.4.4
   nameserver 8.8.8.8

Step 3:
Restart the resolvconf service.

sudo service resolvconf restart

NB: This problem may arise if you upgraded from a previous version of ubuntu to 18.04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.