Skip to content

Instantly share code, notes, and snippets.

@dinhanhhuy
Last active July 20, 2023 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dinhanhhuy/45c7cfae4b197237cc372dc3dea0f534 to your computer and use it in GitHub Desktop.
Save dinhanhhuy/45c7cfae4b197237cc372dc3dea0f534 to your computer and use it in GitHub Desktop.
# create meta data file for network namespace
$ pid=$(docker inspect -f '{{.State.Pid}}' ${container_id})
$ mkdir -p /var/run/netns/
$ ln -sfT /proc/$pid/ns/net /var/run/netns/[container_id]
# list all the network namespace on host
$ ip netns ls
c84ad4878642 (id: 77)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment