Hands-on task
A container's routes via nsenter
tracker stopped reaching api (both are in the ops network): tracker's /call answers 502, and docker exec tracker wget -qO- http://api:8080/ says Network is unreachable. Looks like someone "cleaned up" the routing table in tracker's network namespace.
Put back the routes Docker sets: to the ops network's subnet directly via eth0, and the default route via the ops network's gateway. Don't restart, recreate or reconnect the container to the network: it holds an event queue in memory, and open connections must not be dropped.
The lab has its own Docker with no internet access; the images are already loaded: izzylab/minihttp:1, alpine:3.21, busybox:1.36, nginx:1.27-alpine. izzylab/minihttp is a tiny HTTP service on port 8080: GET / answers <NAME> ok, GET /call itself goes to http://<UPSTREAM>/ and answers <NAME> -> <the neighbor's reply> (or 502), GET /env shows its settings. It is configured with the environment variables NAME, PORT, BIND (the address it listens on) and UPSTREAM.
- nsenter
- ip route
- network namespace
- capabilities