network.service 601 B

123456789101112131415161718192021
  1. [Unit]
  2. Description=Network Connectivity
  3. Wants=network.target
  4. Before=network.target
  5. [Service]
  6. Type=oneshot
  7. RemainAfterExit=yes
  8. # lo is brought up earlier, which will cause the upcoming "ifup -a" to fail
  9. # with exit code 1, due to an "ip: RTNETLINK answers: File exists" error during
  10. # its "ip addr add ..." command, subsequently causing this unit to fail even
  11. # though it is a benign error. Flushing the lo address with the command below
  12. # before ifup prevents this failure.
  13. ExecStart=/sbin/ip addr flush dev lo
  14. ExecStart=/sbin/ifup -a
  15. ExecStop=/sbin/ifdown -a
  16. [Install]
  17. WantedBy=multi-user.target