What are Linux Namespaces
A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource.
There are 7 namespaces in Linux:
- Cgroup: cgroup = control group. Resource limiting, prioritization, accounting and control.
- IPC: Inter-process Communication.
- Network: Network devices, ports, etc.
- Mount: Mount points (of file systems).
- PID: Process IDs.
- User: User and group IDs.
- UTS: UNIX Timesharing System, named after the data structure used to store info returned by
uname
system call. Isolates hostname and NIS domain name.
cgroup
Read more: cgroup
Network Namespaces
Each network namespace has its own localhost and loopback (lo
) device. If loopback device is not up, localhost would not work.
# List network namespaces
$ ip netns list
# Add network namespace
$ ip netns add NAMESPACE