-
-
Notifications
You must be signed in to change notification settings - Fork 33
Create and Delete Netns
James Swineson edited this page Nov 2, 2017
·
1 revision
Assume you want to create a netns named foo
. (Note: do not use -
, space or other strange characters in netns name!)
This is just a netns; there is only an lo
interface inside it. No external network access.
systemctl start netns@foo
In this case, a veth pair will be set up automatically to tunnel packets between netns and host. Note that [email protected]
will be started too.
systemctl start netns-bridge@foo
(For the default config, it will bridge to br0
. You should create the bridge first. See wiki/bridging)
systemctl start netns-nat@foo
Just systemctl enable
it.
Use this even if you started using preconfigured method:
systemctl stop netns@foo