I can connect to my internet modem via WiFi without any issues. Works perfectly.
However, if I try to connect to a mobile hotspot on my Samsung phone, the initial WiFi connection works but I cannot then access any external IP.
I get “no route to host” .
The phone assigns 192.168.x.x.
If I connect to the same hotspot with another phone, it works as expected. It is just my Rocky box that has issues.
When you say in your first sentence “I can connect” are you referring to “Rocky can connect”?
it might help everyone understand your setup better, if you can show Rocky’s output of the commands “ifconfig” and “ip route” and “cat /etc/resolv.conf” so that we have a better idea of Rocky’s networking setup.
And those commands, for comparison purposes, should be done both BEFORE AND AFTER you switch to the hotspot.
Tony
OK. First sentence could say Rocky can connect.
Modem connection info:
ifconfig:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 66 bytes 6318 (6.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 66 bytes 6318 (6.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 203.2.199.101 netmask 255.255.255.0 broadcast 203.2.199.255
inet6 fe80::5568:6499:61e0:1406 prefixlen 64 scopeid 0x20
ether 50:5a:65:90:ae:fb txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ip route:
default via 203.2.199.97 dev wlp1s0 proto static metric 600
203.2.199.0/24 dev wlp1s0 proto kernel scope link src 203.2.199.101 metric 600
resolv.conf:
Generated by NetworkManager
search sdc.com.au
nameserver 203.2.199.97
nameserver 15.197.224.50
nameserver 15.197.215.15
NOTE: the libc resolver may not support more than 3 nameservers.
The nameservers listed below may not be recognized.
nameserver 203.215.29.191
Phone connection:
ifconfig:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 66 bytes 6318 (6.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 66 bytes 6318 (6.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.119.72 netmask 255.255.255.0 broadcast 192.168.119.255
inet6 fe80::8a2f:e7b6:f431:62b3 prefixlen 64 scopeid 0x20
ether 50:5a:65:90:ae:fb txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 2 overruns 0 carrier 0 collisions 0
ip route:
default via 192.168.237.198 dev wlp1s0 proto static metric 600
192.168.119.0/24 dev wlp1s0 proto kernel scope link src 192.168.119.72 metric 600
192.168.237.0/24 via 192.168.237.198 dev wlp1s0 proto static metric 600
192.168.237.198 dev wlp1s0 proto static scope link metric 600
resolv.conf:
Generated by NetworkManager
search sdc.com.au
nameserver 192.168.119.107
in the first half of your answers, you have Rocky setup with IP address 203.2.199.101 and your default routing is via 203.2.199.97 (which is also your primary DNS) and those are both in the same /24 subnet 255.255.255.0
in other words, the first three octets all match.
but in the configuration when you are using your phone hotspot, you show your default route via 192.168.237.198 which is OUTSIDE the IP address in wlp1s0 set to inet 192.168.119.72 netmask 255.255.255.0
in other words, the first three octets do NOT match. I think this is the problem.
the “ip route” when you are setup for the phone hotspot seems to be a mixture of both 192.168.237.x and 192.168.119.x all with exactly the same “metric 600” priority.
also when you are using your phone hotspot, your primary DNS changes to 192.168.119.107, you don’t identify what that address corresponds to (on your LAN)?
Tony
I fixed the IP mix up by deleting the /etc/Networkmanager/system-connections file for the phone then reconnecting.
All IP addesses are now 192.168.119.x. All assigned by the phone.
The DNS is still 192.168.119.107 which must be a name server on the phone company’s net as there is nothing on my network with a 192.168 address except the Rocky box.
However, I cannot connect to anything by name unless it is in my /etc/hosts file. Connections by IP address work but connections by name give “no servers could be reached”.
Problem solved.
The Rocky box is my laptop.
The name server issue was down to my firewall. Before connection to the phone hot spot, I need to kill my firewall (set up at boot time) so that the 192.168 network is open.
So happy to read that your networking problems are resolved!
If my reply yesterday was helpful, please “Like” it.
Rocky is awesome!
Tony
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.