Skip to content

Instantly share code, notes, and snippets.

@moesoha
Last active February 18, 2021 08:37
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 moesoha/458c6f07cded8a66e0cc0170cad966f9 to your computer and use it in GitHub Desktop.
Save moesoha/458c6f07cded8a66e0cc0170cad966f9 to your computer and use it in GitHub Desktop.
`ip` in `iproute2` wrapper for `ifupdown`
#!/bin/sh
set -e
if [ -n "$IF_NETNS" ]; then
if [ "$1" = "exec" ]; then
shift 1
ip netns exec "$IF_NETNS" $@
else
ip -n "$IF_NETNS" $@
fi
else
ip $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment