]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-netns.8
ss: simplify code
[mirror_iproute2.git] / man / man8 / ip-netns.8
CommitLineData
2a9721f1
SH
1.TH IP\-NETNS 8 "20 Dec 2011" "iproute2" "Linux"
2.SH NAME
aab2702d 3ip-netns \- process network namespace management
2a9721f1
SH
4.SH SYNOPSIS
5.sp
6.ad l
7.in +8
8.ti -8
9.B ip
10.RI "[ " OPTIONS " ]"
11.B netns
12.RI " { " COMMAND " | "
13.BR help " }"
14.sp
15.ti -8
16.BR "ip netns" " { " list " } "
17
18.ti -8
19.BR "ip netns" " { " add " | " delete " } "
20.I NETNSNAME
21
22.ti -8
23.BR "ip netns exec "
24.I NETNSNAME command ...
25
26.SH DESCRIPTION
27A network namespace is logically another copy of the network stack,
28with it's own routes, firewall rules, and network devices.
29
30By convention a named network namespace is an object at
31.BR "/var/run/netns/" NAME
32that can be opened. The file descriptor resulting from opening
33.BR "/var/run/netns/" NAME
34refers to the specified network namespace. Holding that file
35descriptor open keeps the network namespace alive. The file
36descriptor can be used with the
37.B setns(2)
38system call to change the network namespace associated with a task.
39
40The convention for network namespace aware applications is to look
41for global network configuration files first in
42.BR "/etc/netns/" NAME "/"
43then in
44.BR "/etc/".
45For example, if you want a different version of
46.BR /etc/resolv.conf
47for a network namespace used to isolate your vpn you would name it
48.BR /etc/netns/myvpn/resolv.conf.
49
50.B ip netns exec
51automates handling of this configuration, file convention for network
52namespace unaware applications, by creating a mount namespace and
53bind mounting all of the per network namespace configure files into
54their traditional location in /etc.
55
56.SS ip netns list - show all of the named network namespaces
57.SS ip netns add NAME - create a new named network namespace
58.SS ip netns delete NAME - delete the name of a network namespace
59.SS ip netns exec NAME cmd ... - Run cmd in the named network namespace
60
61.SH EXAMPLES
62
63.SH SEE ALSO
64.br
65.BR ip (8)
66
67.SH AUTHOR
68Original Manpage by Eric W. Biederman