Systemd/network

From Useful Things
Revision as of 14:15, 21 September 2015 by Milosivanovic (talk | contribs) (Created page with "== Static IP setup == File: <code>/etc/systemd/network/wired.network</code> <pre> [Match] Name=eth0 [Network] DNS=8.8.8.8 Address=192.168.101.2/24 Address=123.123.123.123/32...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Static IP setup

File: /etc/systemd/network/wired.network

[Match]
Name=eth0

[Network]
DNS=8.8.8.8
Address=192.168.101.2/24
Address=123.123.123.123/32

[Route]
Gateway=192.168.101.1

Additional post-up network hooks

File: /etc/systemd/system/my-service.service

[Unit]
Description=Service description
Wants=network.target
After=network.target

[Service]
ExecStart=/usr/local/sbin/executable-to-run

[Install]
WantedBy=multi-user.target