LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux Mint (https://www.linuxquestions.org/questions/linux-mint-84/)
-   -   Wifi Connects To Hotspot, But No Internet With Linux Mint 18.3 (https://www.linuxquestions.org/questions/linux-mint-84/wifi-connects-to-hotspot-but-no-internet-with-linux-mint-18-3-a-4175658110/)

Terje 07-26-2019 08:54 PM

Wifi Connects To Hotspot, But No Internet With Linux Mint 18.3
 
Hello.

I've encountered a problem that sounds similar to others I've been reading about for the past two days, in various forums, but I haven't found a solution that works, so now I'll ask before I start rooting around and break something.

I use mobile broadband for internet access. My desktop can access the internet via the hotspot under both Slack64 v14.1 and Win7 using all of the same hardware. My laptop can do the same under Slack64 v14.2 and Win10, but not under Linux Mint 18.3. If I connect (USB) the hotspot to the laptop, then everything works fine. I've gone back and forth comparing all of the various settings that I can find, and everything seems to match between all five. The wifi from both machines connects just fine to the hotspot, but Linux Mint can't even ping anything beyond itself (at the address assigned by the hotspot). I'm guessing there's a setting or a config file or something along those lines that I've missed.

Any help is greatly appreciated.

business_kid 07-27-2019 03:32 PM

Usual things are
  1. Default route is not set correctly. It should be your internet point.
  2. Your search path in /etc/resolv.conf for dns is silly. The common thing is to set the internet point as the search path, which presumes the modem passes dns servers on. The usb connection may not. So put in a few dns servers like opendns.org's ones

frankbell 07-27-2019 09:38 PM

I find this intriguing. I can't think of any really good diagnostic questions to ask, so I'll fall back to basics.

Could you provide more information about this hotspot of which you speak? Is it your mobile phone? If so, does it offer the option of a WiFi hotspot and have you tried using that instead of the USB hotspot?

What is the output of ip addr or ifconfig -a on the Mint install? (Please be sure to surround any terminal output with "code" tags, which become available when you click the "Go Advanced" button beneath the compose post window.)

Could you post the output of the ping you mention?

Also, could you try these commands and post the output?

Code:

ping google.com
ping 8.8.8.8
traceroute google.com
traceroute 8.8.8.8


business_kid 07-28-2019 01:23 PM

Quote:

Originally Posted by frankbell
I find this intriguing. I can't think of any really good diagnostic questions to ask, so I'll fall back to basics.

It's ok, frankbell. I've been down this road. He has to check routing and resolv.conf. I've seen what systemd/networkmanager does to Mint (=99% Ubuntu)

Good diagnostics questions might be:
  1. Explain your hotspot (like frankbell said)
  2. Post the output of "sudo /sbin/route"
  3. Post the output of "cat /etc/resolv.conf"

Terje 07-28-2019 09:34 PM

Quote:

Originally Posted by business_kid (Post 6019316)
<snip>
Good diagnostics questions might be:
  1. Explain your hotspot (like frankbell said)
  2. Post the output of "sudo /sbin/route"
  3. Post the output of "cat /etc/resolv.conf"

1. I use mobile broadband to access the internet. My hotspot is basically a cellphone that makes the connection possible.
2. Output of the route command:
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        192.168.0.1    0.0.0.0        UG    600    0        0 wlp1s0
link-local      *              255.255.0.0    U    1000  0        0 wlp1s0
192.168.0.0    *              255.255.255.0  U    600    0        0 wlp1s0

3. Contents of /etc/resolv.conf
Code:

# 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
nameserver 127.0.0.1

Even though the hotspot clearly shows that a connection has been made, and has assigned an IP address to the laptop, I cannot even ping the gateway (192.168.0.1) much less anything beyond it.

business_kid 07-29-2019 04:25 AM

Quote:

Originally Posted by Terje
# 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
nameserver 127.0.0.1

Hmmmph! That's it. 127.0.0.1 is your own box, when it should be a dns server. You have no dns. To try, Hack it by hand despite what they say. It will be overwritten next reboot, but no matter. Take out 127.0.0.1 and put in
nameserver 208.67.222.222
nameserver 208.67.220.220

which uses opendns.org. See if you have internet then. You could also try
nameserver 192.168.0.1

which uses your phone's dns. Then I would try 'man resolveconf' and/or 'man resolver' and see if you can figure out where to configure this stuff.

I also did a search for 'Ubuntu set dns nameservers' and discovered that half of their users have had this problem.

Terje 07-30-2019 02:30 AM

Quote:

Originally Posted by business_kid (Post 6019466)
<snip>
You could also try
nameserver 192.168.0.1

which uses your phone's dns. Then I would try 'man resolveconf' and/or 'man resolver' and see if you can figure out where to configure this stuff.

I also did a search for 'Ubuntu set dns nameservers' and discovered that half of their users have had this problem.

I managed to find the files that Network Manager uses to determine what gets written into /etc/resolv.conf, and editing one of those files resulted in /etc/resolv.conf consistently reading:
Code:

# 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
###Below this added by me###
nameserver 192.168.0.1
###Above this added by me###
nameserver 127.0.0.1

That being said, I still cannot ping even the gateway, only the machine itself. The information is now there, and I've double-checked that everything is "spelled" correctly, so there is still something wonky elsewhere. The two other OSs on the same machine are able to connect without a hitch, so it is definitely something specific to Linux Mint, but I don't know where else to look for the problem. I think I'm about done with Linux Mint, if it's going to be this much trouble.

business_kid 07-30-2019 04:24 AM

So your gateway isn't passing dns. Instead of 192.168.0.1, put in the 2 opendns servers i gave you in the previous post

michaelk 07-30-2019 04:42 AM

Mint uses dnsmasq as a DNS cache which is why the resolv.conf has 127.0.0.1 instead of an actual DNS server. If you cant ping the IP address of your gateway then something else is wrong. The route table looks ok.

Is dnsmasq running?

Terje 07-30-2019 11:51 AM

Quote:

Originally Posted by michaelk (Post 6019779)
Mint uses dnsmasq as a DNS cache which is why the resolv.conf has 127.0.0.1 instead of an actual DNS server. If you cant ping the IP address of your gateway then something else is wrong. The route table looks ok.

Is dnsmasq running?

Thanx! I'm not used to dnsmasq, so I wasn't even thinking about it. Uncommenting a single line in /etc/dsnmasq.conf seems to have fixed things, because I'm posting this from the Linux Mint side of my laptop. The line I uncommented was:
Code:

server=/localnet/192.168.0.1
I'm going to test drive it for a bit before marking this thread "Solved."

Terje 07-30-2019 04:15 PM

Quote:

Originally Posted by Terje (Post 6019895)
<snip>
I'm going to test drive it for a bit before marking this thread "Solved."

Well, I've been playing with it for the past four hours or so, and the internet connection works, even without any action on my part after a reboot. There have been a couple of hiccups, however. I've had to restart Network Manager three times because I lost connection to the internet. The laptop stayed connected to the hotspot the entire time, but it revert to not being able to ping it again until after restarting Network Manager. I don't know what might've caused the connection to drop. My first thought is that dnsmasq stopped for some reason, but I don't know enough about it to know if that makes sense, much less what to do about if it does. Restarting only dnsmasq doesn't seem to work, but restarting Network Manager does.


All times are GMT -5. The time now is 09:53 PM.