Helpers for Setting private network namespace per-user basis. It provides cli helper and example systemd-service file.
sudo ./install.sh
- Run a command inside network namespace ( create if not present )
sudo usenetnsexe "$(whoami)" ifconfig
sudo systemctl start "usernetnstest@$(whoami)".service
journalctl -a --no-pager -u "usernetnstest@$(whoami)".service
makebridge name ipAddress
: Helper for creating bridge interface and setting it upmakeusernetns userName
: Setup namespace for a userusernetnsexe userName command
: Setup namespace if not set up and run a command on namespace of that user. The command is run as root.
-
usernetns-bridge.service
: Sets up bridge for working with user network namespaces -
[email protected]
: Sets up network namespace for per-user Usage: let's say that your username isusername
, to setup network namespace forusername
systemctl start [email protected]
-
[email protected]
: An example service that can be started per-user basis, on that user's network namespace.