Skip to content

Instantly share code, notes, and snippets.

@gboddin
Last active July 28, 2023 20:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gboddin/abd0cdc704bc7126b17d19f849086d08 to your computer and use it in GitHub Desktop.
Save gboddin/abd0cdc704bc7126b17d19f849086d08 to your computer and use it in GitHub Desktop.
Nebula systemd multinet
# This is a mostly empty service, but allows commands like stop, start, reload
# to propagate to all nebula@ service instances.
[Unit]
Description=Nebula VPN
Documentation=info:nebula
After=network.target
Wants=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/nebula
[Install]
WantedBy=multi-user.target
[Unit]
Description=Nebula net %i
Documentation=info:nebula
PartOf=nebula.service
ReloadPropagatedFrom=nebula.service
After=network.target
Wants=network.target
[Service]
Type=simple
WorkingDirectory=/etc/nebula/%i
ExecStart=/usr/local/bin/nebula -config /etc/nebula/%i/config.yaml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
Restart=on-failure
RestartSec=5
TimeoutStopSec=5
[Install]
WantedBy=nebula.service
@gboddin
Copy link
Author

gboddin commented May 23, 2021

Installation

  • Download nebula and extract in /usr/sbin.
  • Move nebula.service and nebula@.service in /etc/systemd/system
  • Create a folder for your network in /etc/nebula , eg /etc/nebula/net0
  • Drop your ca.crt, host.crt, host.key and config.yaml in /etc/nebula/net0
  • Run systemctl enable nebula
  • Run systemctl enable nebula@net0 to run at boot
  • Run systemctl start nebula@net0 to start the network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment