Skip to content

Instantly share code, notes, and snippets.

Created April 25, 2013 06:01
Show Gist options
  • Save anonymous/5457815 to your computer and use it in GitHub Desktop.
Save anonymous/5457815 to your computer and use it in GitHub Desktop.
/etc/systemd/system/network.service
[Unit]
Description=Wireless Static IP Connectivity
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-devices-eth0.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set dev eth0 up
ExecStart=/sbin/ip addr add 10.0.1.111/24 dev eth0
ExecStart=/sbin/ip route add default via 10.0.1.1
ExecStop=/sbin/ip addr flush dev eth0
ExecStop=/sbin/ip link set dev eth0 down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment