1

I've been using Ubuntu 14.04 LTS for almost one and half years now. This problem hasn't ever happened before. The bar at the top shows that I'm connected to WiFi/ethernet, but when I try to connect to, say Google, I'm unable to get to it. Chrome says "This site can't be reached".

EDIT_0 (some more info, don't know if this is useful; I already mentioned this in a comment to one of the answers): I'm using a dual-boot machine, running Windows 10 and Ubuntu 14.04. Both wired and wireless network connections work absolutely fine on Windows. Also, I've tried two different mobile hotspots, with the same result, i.e. works in Windows but not in Ubuntu.

EDIT: the diagnostics output can be found here (https://pastebin.com/2FSvfwKq)

EDIT2: Diagnostics run as suggested by @David Foerster. Results are as follows [pastebin link is https://pastebin.com/zGseXr1d ]:

jarvis@jarvis-Inspiron-5558:~$ ping -c4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics 
---4 packets transmitted, 0 received, 100% packet loss, time 3024ms

jarvis@jarvis-Inspiron-5558:~$ ping6 -c4 2001:4860:4860::8888
connect: Network is unreachable

jarvis@jarvis-Inspiron-5558:~$ host google.com
;; connection timed out; no servers could be reached
muru
  • 197,895
  • 55
  • 485
  • 740
Arkya
  • 115
  • Welcome to Ask Ubuntu! Could you please run the network diagnostics and [edit] your question to include a link to the result? I know it may seem a bit overwhelming for a novice but your info so far is a bit vague and the diagnostics will likely cover all options that may cause your issue. Thanks. – David Foerster Jun 04 '17 at 00:57
  • @David Foerster: I've attached the output in a pastebin link. Please advise what to do next. – Arkya Jun 05 '17 at 04:45
  • @ArkyaChatterjee The reopen review for this question is almost completed already, and it looks like your question will probably be reopened within a few hours. – karel Jun 05 '17 at 06:06
  • Ok, your network configuration found a route that appears to lead to the internet. Could you please run ping -c4 8.8.8.8, ping6 -c4 2001:4860:4860::8888, and host google.com and [edit] your question to include their output? Thanks. – David Foerster Jun 05 '17 at 07:48
  • I have done the same, kindly have a look. Thanks – Arkya Jun 05 '17 at 10:36
  • According to the first diagnostics, your wifi should be working properly but the second diagnostics says the opposite. Maybe your firewall is blocking outgoing access. Can you post the output of sudo ufw status verbose? If it shows deny (outgoing), then we found your problem, if it says allow then we'll have to keep looking. – Felipe Jun 07 '17 at 23:34
  • @Felipe- It says, "Status: inactive" – Arkya Jun 08 '17 at 04:35
  • Did you try, at least, to reach your router or any other device into your local network. Maybe the problem is related to the router (firewall, etc.) and not your PC. – migrc Jun 08 '17 at 06:42
  • Yes, as I mentioned in one of the comments below (and in the question's already edited version), other devices are being able to connect to the network, without any problem. – Arkya Jun 08 '17 at 08:15
  • You don't need to edit the answer into the question. – muru Jun 13 '17 at 16:01

3 Answers3

3

SOLVED: It turns out the problem was a firewall issue. Hopefully OP will find the specifics and update the original post. For those wanting to understand how online tech support works, the comments show the step by step approach used to identify then solve the problem.


I'd start by removing the Wifi as a possible source of problems. Connect directly to your router using an ethernet cable. Next try and ping the router on its IP (I'd expect this to be something like 192.168.1.1), but "ip addr" will tell you.

I can see that your Wifi is on 192.168.43.146 which seems fairly normal, so you could just try pinging/connecting to the gateway using a web browser http://192.168.43.1.

Either Wifi gateway IP or ethernet gateway IP should bring up your router's web UI.

If that works and you have other devices that connect to the internet via this router (i.e. a phone), then the issue is likely to be firewall type issues e.g. iptables, AppArmor, ufw, etc.

If you can't reach your router's web UI then it is likely that you have some odd DHCP configuration that is not giving out the correct gateway for your PC. Try manually configuring the ethernet interface with an unused IP that is in your subnet e.g. 192.168.1.111. This is also much easier to get right when using a cable rather than wifi. If that works and you are connected, then you could just run with it by making sure that IP is never given out by your router (check you router config), but it would be better to find out why and fix it.

Martin
  • 218
  • I'm sorry, this might be a noob question.. So this is a college wifi, and I can't really connect to the wifi router as such. However there are some ethernet cables lying around which connect to the same network. That should do, right? – Arkya Jun 08 '17 at 04:38
  • Also, I don't have access to the router config, since it's a college network. – Arkya Jun 08 '17 at 08:20
  • I had assumed you were on a home network, and knowing that this works for the same machine running windows makes a huge difference. Can you ping the wifi gateway e.g. ping 192.168.43.1 Also can you ping another device on the subnet e.g. your phone's IP or a server on the network. It seems you are connected to the wifi, but your network route is wrong. In my experience this is usually a problem with your gateway configuration but there are many other possibilities. If you dual boot in windows, what is the output from ipconfig? – Martin Jun 08 '17 at 09:31
  • for example, from my windows PC, when I ping my phone, I'm getting this . on ubuntu, I'm getting this [first set is for the router, the second set for my phone connected to the same network] – Arkya Jun 08 '17 at 09:58
  • So that means there is nothing wrong with your wifi connection. You are definitely connected to the network. So the issue lies in getting a route out, and often more importantly back. On win run "ipconfig /all" then "tracert 8.8.8.8". On linux run "ip addr" then "traceroute 8.8.8.8". As a test (this is NOT a permanent solution), when you have the details from windows, configure the ubuntu wifi IP manually and give it the values from the windows ipconfig output. Instructions here https://help.ubuntu.com/stable/ubuntu-help/net-fixed-ip-address.html – Martin Jun 08 '17 at 11:13
  • This is the output from windows (the first part that you said). On ubuntu I get this. I couldn't install traceroute because I can't connect to the internet. After this, I manually configured the IP, and I still can't get connected. – Arkya Jun 09 '17 at 04:14
  • Try turning off your firewall and removing any iptables rules. https://serverfault.com/questions/129086/how-to-start-stop-iptables-on-ubuntu Pay attention to the iptables-save examples. Again this is a test to see if this is where the problem lies, its not something you want to run with normally. Can you connect with Ubuntu at home i.e. via a router you do have control of, maybe even by cable. Would also allow you to install traceroute – Martin Jun 09 '17 at 09:07
  • No, I can't connect to any network at all. I tried two different mobile hotspots, to the same effect. So I have no way, at present, of installing traceroute directly on my laptop. Regarding the first thing, I didn't understand exactly what to do. Could you kindly explain in some detail? – Arkya Jun 09 '17 at 09:42
  • 2
    sudo iptables-save > /root/firewall.rules; iptables -F; iptables -X; iptables -t nat -F; iptables -t nat -X; iptables -t mangle -F; iptables -t mangle -X; iptables -P INPUT ACCEPT; iptables -P FORWARD ACCEPT; iptables -P OUTPUT ACCEPT; Then do: sudo ufw disable – Martin Jun 09 '17 at 14:13
  • Everything is working now. Thanks a lot! Just fyi, I had to sudo su to get the first command to run. Is there any follow up to do? – Arkya Jun 12 '17 at 07:04
  • Yes. You should not run without a firewall. Linux is safer than windows, but you still need some protection. First I'd re-enabled the ubuntu firewall i.e. sudo ufw enable. If that kills your connection then find out more about configuring that. If not then leave it on and learn about iptables and why that might have caused the issues. It is less important to have iptables rules in place if the firewall is up. You can restore your iptables by using "sudo iptables-restore < /root/firewall.rules", then try emptying each bit to identify what the actual problem is. Again read up on iptables. – Martin Jun 12 '17 at 10:29
  • After sudo ufw enable, my connection is still working fine. I shall try the next part, but could you tell me in short what iptables are and why they are needed? Or if you could give me a relevant link that explains it that would be great! – Arkya Jun 12 '17 at 11:14
  • 1
    Well you learn something new every day! I was wrong, ufw is iptables. A better explanation is https://wiki.ubuntu.com/UncomplicatedFirewall . Because of the "sudo iptables -F" I think that means you currently do not have any firewall even though you've now turned it back on using "sudo ufw enable". Check out the link and configure your iptables using ufw to suit your needs. – Martin Jun 12 '17 at 13:25
  • I configured using the commands under "Basic Usage". Right now, sudo ufw status is giving this as output. Could you please tell me if anything else needs to be done? – Arkya Jun 13 '17 at 04:41
  • Sorry I don't know enough to advise you, I know just enough to do what I need to do at work and at home I use defaults. The ufw page is already more than I knew! – Martin Jun 15 '17 at 22:06
0

Check your Wi-Fi network with other devices if you get internet access on them. Only then can you say that your device has a problem. If you don't get internet on other devices also, then it's the problem with the network.

You can also try to connect to your network router with a lan cable(if possible) and check if your network is culprit.

If you find out that that the problem is with your device, then you can try:

  • Restarting the network manager by typing the following code in terminal and entering the administrator password

    sudo service network-manager restart

  • Restarting your device

  • Forget your Wi-Fi network and connect to it freshly(see the 2nd answer in this https://askubuntu.com/a/284024/574724 )

  • Change your Wi-Fi driver under Additional Drivers in Software and Updates option of settings.

  • Restarting your router

It is more likely to be a problem with your network as you are already connected to your Wi-Fi router.

Yaksha
  • 1,740
  • Tried both restarting device, and network-manager to no avail. How exactly do I check the WiFi driver though? Could you please explain? – Arkya Jun 03 '17 at 09:15
  • I only have NVIDIA driver showing up there. Along with the open source variant of that. I can't see any WiFi driver under "additional drivers". – Arkya Jun 03 '17 at 09:25
  • Since you are already connected to wifi, it is more likely a problem with the network than with the Wi-Fi adapter or your machine. Please check your network or contact your network admin – Yaksha Jun 03 '17 at 09:48
  • the network works perfectly fine on my android smartphone. same for windows on the same laptop (I have a dual boot machine) – Arkya Jun 03 '17 at 09:52
  • So sorry to hear that... Could you add some screenshots on "connected to Wi-Fi"? – Yaksha Jun 03 '17 at 09:59
  • Can you ping some ip address? ping 8.8.8.8 – 2707974 Jun 03 '17 at 10:00
  • @2707974 https://goo.gl/photos/chGfgfpGkibtczqv7 this is what i get – Arkya Jun 03 '17 at 10:36
  • Please also try connecting over lan cable to your router. Then we could pin point the problem to wifi adapter. – Yaksha Jun 03 '17 at 11:32
  • Sorry, I forgot to mention before, ethernet connection is also doing the same. Edited question. – Arkya Jun 03 '17 at 11:51
  • Can you connect and login to your router web page interface? In the worst case, try re-setting your router. You may also want to try connecting to a different Wi-Fi network such as trying to get online using mobile data of your smartphone through the hotspot. – Yaksha Jun 03 '17 at 15:35
  • I tried mobile hotspot. Same problem. – Arkya Jun 05 '17 at 03:48
  • @ArkyaChatterjee Can you tether via USB? – Tim Jun 07 '17 at 15:17
  • @Tim No, I can't. – Arkya Jun 08 '17 at 04:29
  • In reply to your comment on the second answer, I have been to iisc and connected to iisc wlan network that is found in your stats. The network is complicated and has proxy servers. Requires approval and permission from network admins there to do anything on the network. So please better contact the network admin(SERC department) and they will help you out. And the lan cables may not be of the same network.... – Yaksha Jun 08 '17 at 06:08
  • @Yaksha As I probably have mentioned earlier. I have a dual-boot machine running Windows 10 and Ubuntu 14.04. If the problem was with the network, wouldn't I face the same on Windows as well? I'm facing the same issue with two different mobile hotspots besides the ones I have mentioned already. All of these are working fine on Windows. – Arkya Jun 08 '17 at 06:12
  • The proxy configuration steps are different in Windows and Ubuntu. They have given different guides for each OS. If you modified your network settings during fixing, then that settings might be causing problems on other hotspots. – Yaksha Jun 08 '17 at 06:15
  • How do I sort this out? – Arkya Jun 08 '17 at 06:16
  • When i was there, i had to change the proxy every time i get back home to use home Wi-Fi and had to apply it back when i connected to iisc wlan – Yaksha Jun 08 '17 at 06:28
0

I am a little confused as to why your wireless ip address changes (as I'm going through your initial listing to the more recent and windows set-up).

Does your windows installation require some sort of authentication or a special program your school supplied before allowing you access to the network, or even the use of a proxy for internet access?

In any case, forcing a dhcp re-sync may fix your problem, if it is at the local interface level.

First run

ifconfig |grep inet

for your wireless interface

sudo dhclient wlan0

for your wired interface

sudo dhclient eth0

then again

ifconfig |grep inet

and paste your output. Let's see if your network address has changed.

sergtech
  • 503
  • No, there is no special program in windows that needed to be used to get connected. Just needed to manually configure some of the settings (I don't think it involved any proxy settings, but feel free to go through this, especially the "Connecting to the wifi (iiscwlan)" section. – Arkya Jun 12 '17 at 06:54
  • so there is a proxy required for internet access, although that does not explain why you can ping from windows but not linux. Can you provide the results for the commands in my answer please. – sergtech Jun 12 '17 at 08:32
  • sudo dhclient eth0 is not giving any output. The rest can be found here – Arkya Jun 12 '17 at 10:05
  • I can see you're connected to both the wireless and wired network at this point. Have you set up your proxy in your web browser as it says in the guide you linked? Can you ping noauthproxy.serc.iisc.ernet.in? – sergtech Jun 12 '17 at 11:20
  • No, I haven't done any manual proxy setup. Yes, I think I can ping. Here is what I get. – Arkya Jun 12 '17 at 11:29
  • So is your problem resolved now? You appear to to have accepted an answer wrt iptables. – sergtech Jun 12 '17 at 22:39
  • Yes, it is resolved now. Thank you nevertheless :) – Arkya Jun 13 '17 at 04:42