docker/containerlab: vtysh traceroute is refused and ping prints ttl=42 for the admin login
@mwinter-osr one more from running the containerlab image (quay.io/frrouting/frr:containerlab-10.7.1). It is separate from #24509.
The image's login is admin, and its shell is vtysh. From that login the two reachability commands vtysh offers do not do what a lab user expects. The peer below is directly connected.
| Command in vtysh | As admin over SSH |
As root (docker exec <node> ping or traceroute) |
|---|---|---|
traceroute 10.0.12.2 |
traceroute: socket(AF_INET,3,1): Operation not permitted |
one hop listed |
ping 10.0.12.2 count 3 |
3 of 3 replies, each printed as ttl=42 |
3 of 3 replies, ttl=64 |
So a user in the router's CLI cannot trace a path at all, and reads a TTL that is not the path's. One of our lab runs read the 42 as a hop count.
What we see on the node. /bin/ping and /usr/bin/traceroute are both links to /bin/busybox. admin is uid 1000. net.ipv4.ping_group_range is 0 2147483647. Our reading is that the applets get no raw socket for that user and ping falls back to a datagram socket. We did not trace this in BusyBox.
What we tried. One image built from the published one with apk add --no-cache iputils-ping traceroute (Alpine 3.22.5), then the same two commands as admin over SSH:
| Command in vtysh | Result with the two packages |
|---|---|
traceroute 10.0.12.2 |
1 10.0.12.2 (10.0.12.2) 0.061 ms 0.007 ms 0.006 ms |
ping 10.0.12.2 count 3 |
ping: -c: Try again |
The traceroute package fixes traceroute. iputils-ping is not a fix for ping, because vtysh's count form stops working with it. The image grew from 203,951,037 to 204,331,954 bytes with both packages.
One run of each case on one host: amd64, containerlab 0.83.0, kernel 7.0.0, FRRouting 10.7.1_git. We are the NetPilot team and we run this image under containerlab's frr kind.
Is a PR that adds traceroute to the apk add line in docker/containerlab/Dockerfile welcome? It can ride with #24509 if that one is. We have no tested change to offer for the ttl=42 line.