systemd-networkd.service 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # SPDX-License-Identifier: LGPL-2.1+
  2. #
  3. # This file is part of systemd.
  4. #
  5. # systemd is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or
  8. # (at your option) any later version.
  9. [Unit]
  10. Description=Network Service
  11. Documentation=man:systemd-networkd.service(8)
  12. ConditionCapability=CAP_NET_ADMIN
  13. DefaultDependencies=no
  14. # systemd-udevd.service can be dropped once tuntap is moved to netlink
  15. After=systemd-udevd.service network-pre.target systemd-sysusers.service systemd-sysctl.service
  16. Before=network.target multi-user.target shutdown.target
  17. Conflicts=shutdown.target
  18. Wants=network.target
  19. [Service]
  20. AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW
  21. CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW
  22. DeviceAllow=char-* rw
  23. ExecStart=!!/lib/systemd/systemd-networkd
  24. LockPersonality=yes
  25. MemoryDenyWriteExecute=yes
  26. NoNewPrivileges=yes
  27. ProtectControlGroups=yes
  28. ProtectHome=yes
  29. ProtectKernelModules=yes
  30. ProtectKernelLogs=yes
  31. ProtectSystem=strict
  32. Restart=on-failure
  33. RestartSec=0
  34. RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 AF_PACKET AF_ALG
  35. RestrictNamespaces=yes
  36. RestrictRealtime=yes
  37. RestrictSUIDSGID=yes
  38. RuntimeDirectory=systemd/netif
  39. RuntimeDirectoryPreserve=yes
  40. SystemCallArchitectures=native
  41. SystemCallErrorNumber=EPERM
  42. SystemCallFilter=@system-service
  43. Type=notify
  44. RestartKillSignal=SIGUSR2
  45. User=systemd-network
  46. WatchdogSec=3min
  47. [Install]
  48. WantedBy=multi-user.target
  49. Also=systemd-networkd.socket
  50. Alias=dbus-org.freedesktop.network1.service
  51. # We want to enable systemd-networkd-wait-online.service whenever this service
  52. # is enabled. systemd-networkd-wait-online.service has
  53. # WantedBy=network-online.target, so enabling it only has an effect if
  54. # network-online.target itself is enabled or pulled in by some other unit.
  55. Also=systemd-networkd-wait-online.service