Hi,
This is a discussion I would like to start following my ticket SUP-153396.
Issue. Take a CHR or a real device with RouterOS v7.15 or older. Add any container (e.g. alpine) and start it. Make sure it responds to pings from the host and/or other machines. Then stop it and try to ping it again - you will get responses as if the container was up and running.
Implication. In my view, it’s weird and counter-intuitive to have stopped containers responding to pings. If I ping something and it responds, I normally treat it to be in a running state, definitely not stopped. No ICMP-based container monitoring can be performed this way.
Position of the support. Unfortunately, I didn’t manage to make the support agree this is a problem. They basically think RouterOS container system behaves as expected. Below I’m quoting Olegs’ responses.
Since the VETH interface always is up, and you have assigned an IP address to it, you can ping it. Unless you disable VETH interface and IP address, ping will receive/responses packets. This is how it works.
Comparison to Docker. My understanding is as follows. Both Docker and RouterOS use Linux network/user namespaces, create a pair of veth interfaces and assign IP addresses on two sides. Unlike Docker, RouterOS uses static and always enabled veth interfaces, unless manually disabled by the user. In other words, RouterOS doesn’t remove or disable veth interfaces, even the container side, when the container stops.
We cannot disclose all information about the container implementation in RouterOS. All we can say about the RouterOS container source code is that there is no similarity with Docker. RouterOS container for the most part based on the same Linux features. The biggest difference with standard Docker is that we use user namespace separation. Docker also has this feature, but it is not by default - > https://docs.docker.com/engine/security/userns-remap/
Community, if you use containers, do you think stopped containers should respond to pings? Could such an implementation of the container system, whatever MikroTik has under the hood of RouterOS, be considered acceptable?
Regards,