Skip to content

Instantly share code, notes, and snippets.

@javaguirre
Created March 3, 2013 21:02
Show Gist options
  • Save javaguirre/5078276 to your computer and use it in GitHub Desktop.
Save javaguirre/5078276 to your computer and use it in GitHub Desktop.
Network service Arch
[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-${interface}.device
After=sys-subsystem-net-devices-${interface}.device
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network
ExecStart=/sbin/ip link set dev ${interface} up
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
ExecStart=/sbin/ip route add default via ${gateway}
ExecStop=/sbin/ip addr flush dev ${interface}
ExecStop=/sbin/ip link set dev ${interface} down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment