We know linux supports namespaces. A network namespace appears to have a
standalone TCP/IP stack. This project provides a bash script netns-ctl
to simplify the work of creating and deleting a network namespace.
This project is inspired by this page.
Simply run netns-ctl
as root, it creates a new network namespace. Features:
- There is a "lo" interface in this namespace.
- There is a virtual ethernet interface in this namespace.
- Programs in this namespace can access internet as if it's another computer.
For more options, check output of netns-ctl -h
.
Run netns-ctl -c
.
Run netns-ctl -s
.