summaryrefslogtreecommitdiffstats
path: root/extras/strongswan/vpp_sswan/docker/exposedockernetns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extras/strongswan/vpp_sswan/docker/exposedockernetns.sh')
-rwxr-xr-xextras/strongswan/vpp_sswan/docker/exposedockernetns.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/extras/strongswan/vpp_sswan/docker/exposedockernetns.sh b/extras/strongswan/vpp_sswan/docker/exposedockernetns.sh
new file mode 100755
index 00000000000..ff223ce427a
--- /dev/null
+++ b/extras/strongswan/vpp_sswan/docker/exposedockernetns.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [ "$1" == "" ]; then
+ echo "usage: $0 <container_name>"
+ echo "Exposes the netns of a docker container to the host"
+ exit 1
+fi
+
+ pid=`docker inspect -f '{{.State.Pid}}' $1`
+ ln -s /proc/$pid/ns/net /var/run/netns/$1
+
+ echo "netns of ${1} exposed as /var/run/netns/${1}"
+
+ #echo "try: ip netns exec ${1} ip addr list"