st31ny / systemd-named-netns

Use named netns with systemd services!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

systemd-named-netns

This project enables you to:

  • Create and delete named netns on the fly like systemd services
  • Start named netns on boot
  • Quickly set up bridging or NAT from netns to host
  • Use named netns in systemd services
    • Enables them to connect to the internet too
    • And you can manually switch to its netns (since they are named)

Installation

Dependencies:

  • Recent version of systemd (newer is better; tested down to v232)
  • iproute2
  • iptables (only if you use default NAT config)
  • /usr/bin/env

For installation, run make install with root privilege.

You ran run make uninstall to remove the systemd units, but the configs located in /etc/default will not be removed.

Quickstart

systemctl start netns-nat@helloworld
chnetns helloworld ip address

Resources

References

About

Use named netns with systemd services!

License:GNU General Public License v3.0


Languages

Language:Shell 53.6%Language:Makefile 46.4%