Skip to content

Run Service by assigning network namespace for each user

Notifications You must be signed in to change notification settings

mesudip/usernetns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usernetns

Helpers for Setting private network namespace per-user basis. It provides cli helper and example systemd-service file.

Install

    sudo ./install.sh

Quick Start

  1. Run a command inside network namespace ( create if not present )
    sudo usenetnsexe "$(whoami)" ifconfig
  1. Run test-systemd-service
    sudo systemctl start "usernetnstest@$(whoami)".service
    journalctl -a --no-pager  -u "usernetnstest@$(whoami)".service

Commands provided

  • makebridge name ipAddress : Helper for creating bridge interface and setting it up
  • makeusernetns userName : Setup namespace for a user
  • usernetnsexe userName command : Setup namespace if not set up and run a command on namespace of that user. The command is run as root.

Services

  1. usernetns-bridge.service : Sets up bridge for working with user network namespaces

  2. [email protected] : Sets up network namespace for per-user Usage: let's say that your username is username, to setup network namespace for username

    systemctl start [email protected]

  3. [email protected] : An example service that can be started per-user basis, on that user's network namespace.

About

Run Service by assigning network namespace for each user

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages