Wifi doesn't work on ICE train

Connecting to the WIFI on the ICE train in Germany didn't work for me. I was using Debian GNU/Linux, and Docker was running. It turns out the train's wireless network uses the same subnet as Docker by default. The solution is pretty simple, kill containers, stop docker, purge networks. Yeah, I could also configure docker to use a different subnet, but this is not what I have done while on the train. This script works for me.

Run it and open login.wifionice.de

Raw
#!/usr/bin/env sh

CMD=$1

if [ ! ${EUID} = 0 ]; then
  echo "Your are not root, will try to use sudo.."
  PREFIX=/usr/bin/sudo
else
  PREFIX=
fi

if [ "${CMD}" = "off" ]; then
  echo "Off, starting docker"
  ${PREFIX} systemctl start docker.service
  ${PREFIX} systemctl start docker.socket
elif [ "${CMD}" = "on" ]; then
  echo "On, stopping docker"
  ${PREFIX} docker kill $(docker ps -qa)
  ${PREFIX} docker network prune --force
  ${PREFIX} systemctl stop docker.service
  ${PREFIX} systemctl stop docker.socket
  echo "Connect to the Wifi network now and open https://iceportal.de/"
else
  cat<<EOF

This script solves the problem that you can not connect to the free Wifi in ICE
trains because docker network conflicts with DB network by default. It will
kill all docker containers, delete all networks, and shut down the services

Usage: ./ice_wlan_docker_linux.sh [on|off]

EOF
fi
Published on March 30, 2019 by Nicolas and tagged docker. You can follow the discussion with the comment feed for this post. Feeling generous? Donate!

0 comments

Start a new thread

Cancel reply
Markdown. Syntax highlighting with <code lang="php"><?php echo "Hello, world!"; ?></code> etc.