DEV Community

Discussion on: Creating a Captive Page to Sign into any Public Network

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer • Edited

If you still can't connect using German railway Deutsche Bahn's WiFi on ICE network from a Ubuntu / Linux system, the reason might be that you're a dev an using Docker with the standard configuration which has an address conflict with WIFIonICE at 172.18.0.0/16. Thanks to German UbuntuUsers forum: Probleme mit dem WIFIonICE for pointing out!

A quick workaround, unless you actually have to use Docker while working on a train (of course you do), you can stop Docker, optionally also prune its networks and try to explicitly clear 172.18.0.0/16 using the br- address that you can find out using the ifconfig command. Thus:

ip a to check if you are actually connected to any network.

ip a | grep docker to check if Docker is a potential problem and find out its name to use for shutting it down.

$ ip a | grep docker
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
$ sudo ifconfig docker0 down
$ docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
Deleted Networks:
...
Enter fullscreen mode Exit fullscreen mode

Last but not least, if needed, use ifconfig to find out the conflicting broadcast address.

$ ifconfig -a | grep br
br-2abd62f2e2aa: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
br-7eeffe1d5437: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.20.0.1  netmask 255.255.0.0  broadcast 172.20.255.255
br-a5a3fb8bd4be: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.19.0.1  netmask 255.255.0.0  broadcast 172.19.255.255
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet 172.18.105.167  netmask 255.255.0.0  broadcast 172.18.255.255
$ sudo ip -4 addr del 172.18.0.0/16 dev br-2abd62f2e2aa
RTNETLINK answers: Cannot assign requested address
Enter fullscreen mode Exit fullscreen mode

Then reload the captive page or iceportal.de/

See the forum post (or any other helpful documentation) on how to permanently reconfigure Docker to use an alternative network address, for example this post on ServerFault: Configuring Docker to not use the 172.17.0.0 range:

Edit or create /etc/docker/daemon.json config file for docker daemon
using the alternate address pool suggested in the comments to avoid another address collision conflict

{
  "default-address-pools":
  [
   {"base":"192.168.0.0/16","size":24}
  ]
}
Enter fullscreen mode Exit fullscreen mode

Restart dockerd:
service docker restart