Skip to content

Systemd Units and Netns

James Swineson edited this page Nov 2, 2017 · 2 revisions

Put a systemd service to that netns

Assume you want to put bar.service into netns foo, Create a file named /etc/systemd/system/bar.service.d/netns.conf and put the following content in:

[Unit]
[email protected]
[email protected]
[email protected]

[Service]
PrivateNetwork=yes

Do a systemctl daemon-reload afterwards. If you have enabled it, systemctl reenable bar.service too.

If you need automatic bridging or NAT, systemctl enable [email protected] or systemctl enable [email protected].

Clone this wiki locally