Skip to content

Bash script to create a network namespace on linux

License

Notifications You must be signed in to change notification settings

trentzhou/netns-ctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

netns-ctl - Bash script to create a network namespace on linux

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.

Creating a network namespace

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.

Deleting the network namespace

Run netns-ctl -c.

Launching a shell in the network namespace

Run netns-ctl -s.

Releases

No releases published

Packages

No packages published

Languages