Difference between revisions of "Systemd/network"

From Useful Things
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 14:15, 21 September 2015

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