From 1b99fedf6b85341a95d7c0d66a4bb0a7a51c3ec9 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 23 Dec 2023 20:14:03 -0700 Subject: [PATCH] Add systemd-networkd config templates --- systemd/network/template.10-myonlyether.link | 6 ++++ systemd/network/template.20-wired.network | 8 +++++ systemd/resolved.conf | 36 +++++++++++++++++++ .../wait-for-only-ethernet.conf | 3 ++ 4 files changed, 53 insertions(+) create mode 100644 systemd/network/template.10-myonlyether.link create mode 100644 systemd/network/template.20-wired.network create mode 100644 systemd/resolved.conf create mode 100644 systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-ethernet.conf diff --git a/systemd/network/template.10-myonlyether.link b/systemd/network/template.10-myonlyether.link new file mode 100644 index 0000000..a9cd500 --- /dev/null +++ b/systemd/network/template.10-myonlyether.link @@ -0,0 +1,6 @@ +[Match] +MACAddress = 00:11:22:33:44:55 + +[Link] +Name = myonlyether +Description = My only ethernet port on this computer diff --git a/systemd/network/template.20-wired.network b/systemd/network/template.20-wired.network new file mode 100644 index 0000000..793b226 --- /dev/null +++ b/systemd/network/template.20-wired.network @@ -0,0 +1,8 @@ +[Match] +Name = myonlyether + +[Network] +Address = 192.168.0.98/24 +Gateway = 192.168.0.1 +# Cloudflare dns +DNS = 1.1.1.1 diff --git a/systemd/resolved.conf b/systemd/resolved.conf new file mode 100644 index 0000000..bfd1d90 --- /dev/null +++ b/systemd/resolved.conf @@ -0,0 +1,36 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file, or by creating "drop-ins" in +# the resolved.conf.d/ subdirectory. The latter is generally recommended. +# Defaults can be restored by simply deleting this file and all drop-ins. +# +# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. +# +# See resolved.conf(5) for details. + +[Resolve] +DNS = 1.1.1.1 +FallbackDNS = 1.0.0.1 +# Some examples of DNS servers which may be used for DNS= and FallbackDNS=: +# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com +# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google +# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net +#DNS= +#FallbackDNS=1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google +#Domains= +#DNSSEC=no +#DNSOverTLS=no +#MulticastDNS=yes +#LLMNR=yes +#Cache=yes +#CacheFromLocalhost=no +#DNSStubListener=yes +#DNSStubListenerExtra= +#ReadEtcHosts=yes +#ResolveUnicastSingleLabel=no diff --git a/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-ethernet.conf b/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-ethernet.conf new file mode 100644 index 0000000..34ad288 --- /dev/null +++ b/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-ethernet.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart = +ExecStart = /usr/lib/systemd/systemd-networkd-wait-online -i enp4s0