logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 09-11-2021 07:12:57

anonyme
Invité

Mettre en service sur debian systemd-networkd et systemd-resolved

Bonjour

ps: testé sur une debian sid avec Mate .

état du système
pour networkd


systemctl status systemd-networkd.service
 



○ systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ○ systemd-networkd.socket
       Docs: man:systemd-networkd.service(8
 



pour resolved (dns)


systemctl status systemd-resolved.service
 



○ systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 


le status de systemd-resolved


resolvectl status
 



Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.
 


les deux services sont présent sur la machine mais inactif

configurer networkd ici en dhcp sur une livebox
ps:voir les options possibles sur la documentation
un fichier a créer


nano /etc/systemd/network/20-wired.network
 


a mettre dedans (selon votre configuration a modifier)


[Match]
Name=enp2s0

[Network]
DHCP=yes
 



nota: le fichier /etc/systemd/networkd.conf peut être ignoré

désactiver le fichier "interfaces"
stoper le service


systemctl stop networking.service
 


désactiver le service


systemctl disable networking.service
 


se placer dans le répertoire


cd /etc/network/
 


renommer le fichier "interfaces" en "interfaces.save"


mv interfaces /etc/network/interfaces.save
 



activer systemd-networkd


systemctl enable systemd-networkd.service
 


démarrer le service


systemctl start systemd-networkd.service
 


vérifier le status du service (si tout est correct)


systemctl status systemd-networkd.service
 


retour


● systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-11-09 06:57:39 CET; 12min ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 8398 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 19042)
     Memory: 2.5M
        CPU: 150ms
     CGroup: /system.slice/systemd-networkd.service
             └─8398 /lib/systemd/systemd-networkd

nov. 09 06:57:39 debian2 systemd[1]: Starting Network Configuration...
nov. 09 06:57:39 debian2 systemd-networkd[8398]: lo: Link UP
nov. 09 06:57:39 debian2 systemd-networkd[8398]: lo: Gained carrier
nov. 09 06:57:39 debian2 systemd-networkd[8398]: Enumeration completed
nov. 09 06:57:39 debian2 systemd[1]: Started Network Configuration.
nov. 09 06:57:40 debian2 systemd-networkd[8398]: enp2s0: Link UP
nov. 09 06:57:42 debian2 systemd-networkd[8398]: enp2s0: Gained carrier
nov. 09 06:57:43 debian2 systemd-networkd[8398]: enp2s0: DHCPv4 address 192.168.1.99/24 via 192.168.1.1
nov. 09 06:57:44 debian2 systemd-networkd[8398]: enp2s0: Gained IPv6LL
 


effectuer un ping (en ipv4 ou ipv6) par défaut je suis en ipv6 sur la box


ping -v4 -c4 google.fr
 



un reboot de la machine ou passer directement a la suite

Mise en place du service "systemd-resolved"

créer le dossier /etc/systemd/resolved.conf.d/


mkdir /etc/systemd/resolved.conf.d
 


créer le fichier dns_servers.conf


nano /etc/systemd/resolved.conf.d/dns_servers.conf
 



et copier ce contenue (a adapter a votre configuration)
j'utilise le DNS interne de la box et j'utilise le domaine local "home"
par defaut le domain est comme ceci "Domains=~."


[Resolve]
DNS=192.168.1.1
#Domains=~.
Domains=home
 



créer le lien ci dessous (resolv.conf sera mit a jour par systemd-resolved)


ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
 



vérifier le status de systemd-resolved


systemctl status systemd-resolved.service
 


activer le


systemctl enable systemd-resolved.service
Created symlink /etc/systemd/system/dbus-org.freedesktop.resolve1.service → /lib/systemd/system/systemd-resolved.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /lib/systemd/system/systemd-resolved.service.
 


démarrer le


systemctl start systemd-resolved.service
 


vérifier a nouveau son status


systemctl status systemd-resolved.service
 



● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-11-09 07:45:19 CET; 5s ago
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
   Main PID: 10041 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 19042)
     Memory: 4.3M
        CPU: 130ms
     CGroup: /system.slice/systemd-resolved.service
             └─10041 /lib/systemd/systemd-resolved

nov. 09 07:45:19 debian2 systemd[1]: Starting Network Name Resolution...
nov. 09 07:45:19 debian2 systemd-resolved[10041]: Positive Trust Anchors:
nov. 09 07:45:19 debian2 systemd-resolved[10041]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
nov. 09 07:45:19 debian2 systemd-resolved[10041]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 1>
nov. 09 07:45:19 debian2 systemd-resolved[10041]: Using system hostname 'debian2'.
nov. 09 07:45:19 debian2 systemd[1]: Started Network Name Resolution.
 


et maintenant


resolvectl status
Global
       Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
     DNS Servers: 192.168.1.1
      DNS Domain: home

Link 2 (enp2s0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
     Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
   DNS Servers: 192.168.1.1 2a01:cb1c:dce:900:a63e:51ff:fe5b:f91b
 


le contenu de mon /etc/resolv.conf  maintenant


# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search home
 



et un reboot de la machine pour confirmer que tout est correct

les erreurs


journalctl -b -r -p err
-- Journal begins at Sun 2021-10-03 22:50:19 CEST, ends at Tue 2021-11-09 08:10:23 CET. --
nov. 09 07:58:01 debian2 pulseaudio[859]: Error opening PCM device iec958:0: Aucun fichier ou dossier de ce type
nov. 09 07:55:14 debian2 kernel: Error: Driver 'pcspkr' is already registered, aborting...
nov. 09 07:55:14 debian2 kernel: nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 3e6684 [ PRIVRING ]
 



Remarque:
de la même manière que networkd.conf , le fichier /etc/systemd/resolved.conf  peut être ignoré

Dernière modification par anonyme (09-11-2021 08:17:25)

Pied de page des forums