Ubuntu Ethernet Login Page Not Loading Inside Docker
Debugging why the IITJ ethernet login page refused to load inside Docker containers.
Short answer: if your captive-portal login page never loads and the gateway is unreachable while the interface says Connected, a Docker bridge is probably squatting on the same subnet as the gateway. Linux prefers local routes, so packets go into the virtual bridge and never leave the machine. Confirm with ip route get <gateway-ip>, if it says dev docker0 instead of your ethernet interface, that's it. Move Docker to an uncommon range in /etc/docker/daemon.json:
{ "default-address-pools": [{ "base": "10.200.0.0/16", "size": 24 }] }Then sudo systemctl restart docker. Full diagnosis below.
Symptoms
When connecting to campus ethernet, a login page (e.g. gateway.iitj.ac.in) normally opens for authentication.
On Ubuntu the interface shows Connected, but:
- No websites load (even
google.com) - Login page never appears
- Browser shows
ERR_ADDRESS_UNREACHABLE - Pinging the gateway returns
Destination Host Unreachable
Root Cause
Linux always prefers local routes over default routes. If Docker/VPN creates a bridge using the same subnet as your campus gateway, the OS thinks the gateway is local and sends packets into that virtual bridge instead of the real network.
Result: No packets reach the gateway to captive portal never loads.
Diagnosis
First, check where the gateway IP is being routed:
getent hosts gateway.iitj.ac.in
ip route get <gateway-ip>If the route shows something like:
dev docker0
dev br-xxxx
dev tailscale0instead of your ethernet interface (e.g., enpXsY), then traffic is being captured by a local virtual network instead of the real gateway.
Common Causes
- Docker default bridge (
172.17.0.0/16) - Docker Compose networks
- Old/stale Docker bridges
- VPNs (Tailscale, etc.) adding routing rules
- Any local subnet overlapping the campus network
Example of a broken route:
172.17.0.3 dev docker0 src 172.17.0.1Solution: Move Docker Away from Common Private Ranges
Step 1: Edit Docker daemon config
sudo nano /etc/docker/daemon.jsonUse a safe, uncommon subnet:
{
"default-address-pools": [
{
"base": "10.200.0.0/16",
"size": 24
}
]
}Step 2: Restart Docker
sudo systemctl restart dockerStep 3: Recreate Compose networks (important)
Old networks keep old subnets. Remove them:
docker compose down
docker network prune -fThen start again:
docker compose up -dStep 4: Delete any stale bridges (if still present)
ip a | grep br-
sudo ip link delete br-xxxxVerification
Check that the route now points to your ethernet interface:
ip route get <gateway-ip>It should now show:
via <ethernet-gateway> dev enpXsYTakeaway
If an intranet/login page shows unreachable on Ubuntu:
- Resolve the gateway IP
- Run
ip route get <ip> - Check for Docker/VPN/bridge conflicts
Comments