From The Compiler, 6 Years ago, written in Plain Text.
Embed
  1. ╭─[florian@lupin]──[~]──[13-08-07]──[8:39]────┄
  2. ╰─╼ cat /etc/systemd/system/network.service
  3. [Unit]
  4. Description=Network Connectivity
  5. Wants=network.target
  6. Before=network.target
  7.  
  8. [Service]
  9. Type=oneshot
  10. RemainAfterExit=yes
  11. EnvironmentFile=/etc/conf.d/network
  12. ExecStart=/sbin/ip link set dev ${interface} up
  13. ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
  14. ExecStart=/sbin/ip route add default via ${gateway}
  15. ExecStart=/sbin/ip -6 addr add ${address6}/${netmask6} dev ${interface}
  16. ExecStart=/sbin/ip -6 route del default
  17. ExecStart=/sbin/ip -6 route add default via ${gateway6}
  18. ExecStop=/sbin/ip addr flush dev ${interface}
  19. ExecStop=/sbin/ip -6 addr flush dev ${interface}
  20. ExecStop=/sbin/ip link set dev ${interface} down
  21.  
  22. [Install]
  23. WantedBy=multi-user.target
  24. ╭─[florian@lupin]──[~]──[13-08-07]──[8:41]────┄
  25. ╰─╼ cat /etc/conf.d/network
  26. interface=eth0
  27.  
  28. address=94.23.233.17
  29. netmask=24
  30. broadcast=94.23.233.255
  31. gateway=94.23.233.254
  32.  
  33. address6=2001:41d0:2:6c11::1
  34. netmask6=64
  35. gateway6=2001:41d0:2:6cff:ff:ff:ff:ff
  36.