I'm using the portable hotspot of my Xiaomi Redmi Note 8T.
I have 2 Linux machines - one is Ubuntu and the other is Fedora - connected and from both I can find the internal IP through ifconfig
. If I ping
their IP they respond one another.
Now, on Ubuntu I've setup a Nginx site that should be visible through the internal network but the HTTP connection is timing out on Fedora without any reply: notice that I'm using the internal network IP on the Fedora laptop to avoid issue with the hostname/DNS. On the same Ubuntu I can see the http site when I use the internal IP.
I've tried also with the public IP (getting it from tracemyip.org) but it doesn't work even on the same Ubuntu PC (and sudo ufw status
is inactive
) and neither the ping works.
Is it due to the mobile carrier or what am I missing? Can you suggest what to do to enable the HTTP connection at least across the internal network?
Further testing
I've tried also the other way around: Setting up the site on Fedora laptop instead of the Ubuntu machine and with a trivial python3 -m http.server
instead of a more elaborate Nginx uwsgi flask... The intranet seems to work locally on the same machine, but the connection is not reachable from the other, even if they are under the same Android router.
I guess the private intranet is prevented by the mobile Android router, but I'm still seeking a technical confirmation.
Replies to comment about nmap
I've installed nmap
.
Let's say that Ubuntu machine, where the http server is running has internal IP (from ifconfig
) 192.168.43.236.
I run the following command on the same Ubuntu machine.
nmap 192.168.43.236 -p 8080
Nmap scan report for myubuntu (192.168.43.236)
Host is up (0.00018s latency)
PORT STATE SERVICE
8080/tcp open http-proxy
On the other Fedora machine
nmap 192.168.43.236 -p 8080
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-25 23:59 CEST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.04 seconds
But
ping 192.168.43.236
PING 192.168.43.236 (192.168.43.236) 56(84) bytes of data.
64 bytes from 192.168.43.236: icmp_seq=1 ttl=64 time=161 ms
64 bytes from 192.168.43.236: icmp_seq=2 ttl=64 time=186 ms
Tried also
nmap 192.168.43.236 -Pn -p 8080
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-26 00:04 CEST
Nmap scan report for home (192.168.43.236)
Host is up.
PORT STATE SERVICE
8080/tcp filtered http-proxy
Nmap done: 1 IP address (1 host up) scanned in 2.05 seconds
Replies to comment about netstat
To simplify, let me use Fedora as server and I can do just
python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
There I see
netstat -an|grep 8000
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN
But from Ubuntu the state of nmap
looking at Fedora port 8000 with option -Pn is filtered
(on the other hand, leaving all the rest invariant, the state of nmap
is open
when I check it on the same machine).
Conclusion
I connect a machine to my phone wifi router. I see the ip assigned from ifconfig
. I start a http server on a port (e.g. python on 8000 or nginx on 8080) and - on the same machine - I check the above said ip and port with nmap or netstat or with firefox and it is all ok.
On another machine connected to the same wifi router, the ip is filtered out, not reachable. I suspect it is a "security" feature of my Xiami Mi maybe against wifi probes... or something like that, I don't think it depends on the Linux machine config.
I have to try with another model of phone asap. I have tested with other phones and all works fine so the issue is with the above said phone
Routing tables
This is the command to show the routing tables of my phone:
ip route show dev wlan0 table all
192.168.43.0/24 table 97 proto static scope link
192.168.43.0/24 proto kernel scope link src 192.168.43.1
broadcast 192.168.43.0 table local proto kernel scope link src 192.168.43.1
local 192.168.43.1 table local proto kernel scope host src 192.168.43.1
broadcast 192.168.43.255 table local proto kernel scope link src 192.168.43.1
fe80::/64 table 1029 proto kernel metric 256 pref medium
anycast fe80:: table local proto kernel metric 0 pref medium
local fe80::a64b:d5ff:fe06:1bd7 table local proto kernel metric 0 pref medium
ff00::/8 table local metric 256 pref medium