On my Android phone, where I have a Debian system running in userspace (apt, GNU tools, and other software runs in a chroot, accessible through ssh), the routing table seems incomplete.
ip route -all -details show:
unicast 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.108 unicast 192.168.43.0/24 dev p2p-p2p0-0 proto kernel scope link src 192.168.43.1
ip route get 22.214.171.124:
126.96.36.199 via 192.168.2.1 via ??? ??? dev wlan0 src 192.168.2.108 cache
Where does it get
192.168.2.1 from? That is indeed the correct gateway, but the routing table output does not show it. I can also reach external addresses.
Questioning my sanity, I tried another tool, and when that gave me the same output, I found a way to ask the kernel directly:
$ route -v Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.43.0 0.0.0.0 255.255.255.0 U 0 0 0 p2p-p2p0-0 $ cat /proc/net/route Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT wlan0 0002A8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0 p2p-p2p0-0 002BA8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0
The device is operating in "WiFi bridge" mode, where it is connected to a WiFi network and offers a hotspot at the same time; hence the two local networks. The kernel is a:
$ uname -a Linux localhost 4.1.18-g0fcbc9f #1 SMP PREEMPT Thu Dec 28 10:57:06 CST 2017 armv7l GNU/Linux
Where is this magic default route coming from?