Docker: get relation between container and interface veth
The idea is to receive the index of the next interface. # Get veth interface: MY_CONTAINER_NAME=”mysql_server_1″ LINK_INDEX=`docker exec -it $MY_CONTAINER_NAME ip a l eth0 | awk -F “:” ‘{if (NR==1) print $1+1}’` ip link ls | grep “^$LINK_INDEX” | awk -F”:” ‘{ gsub (” “, “”, $2); print $2}’ Now you can easily observe the […]