A simple script that returns the network interface name on the host by the container name. Based on https://github.com/cslev/find_veth_docker/blob/master/find_veth_docker.sh
./container_netiface.sh <containername>
veth63443be
A simple script that returns the network interface name on the host by the container name. Based on https://github.com/cslev/find_veth_docker/blob/master/find_veth_docker.sh
./container_netiface.sh <containername>
veth63443be
#!/bin/bash | |
NAME=$1 | |
IFACE=eth0 | |
ip a|grep "if`docker exec ${NAME} ip a|grep ${IFACE}@|cut -d ':' -f 1`"|cut -d ":" -f 2|cut -d '@' -f 1|sed "s/ //g" |