From 0fb190191efce97c03591d8d77724c86f22bab9d Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 24 Jul 2024 19:21:32 +0300 Subject: [PATCH] systemd/network: add drop-ins to expand usefulness --- etc/systemd/network/10-ether.network | 12 +----------- .../network/10-ether.network.d/home-static.conf | 16 ++++++++++++++++ .../network/10-wlan.network.d/example.conf | 7 +++++++ 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 etc/systemd/network/10-ether.network.d/home-static.conf create mode 100644 etc/systemd/network/10-wlan.network.d/example.conf diff --git a/etc/systemd/network/10-ether.network b/etc/systemd/network/10-ether.network index fec1e91b..c2241203 100644 --- a/etc/systemd/network/10-ether.network +++ b/etc/systemd/network/10-ether.network @@ -1,25 +1,15 @@ [Match] -#MACAddress= Type=ether [Link] RequiredForOnline=false -# Takes "ipv4", "ipv6", "both", or "any" (default). -RequiredFamilyForOnline=both # If something else (like NetworkManager) manages network, uncomment #Unmanaged=true -# Always set administrative state to up. Implies RequiredForOnline=true -#ActivationPolicy=always-up # Required for mDNS #Multicast=true [Network] -#DHCP=true -# /24, /16, /8 are the the class C, B, A networks -Address=192.168.0.2/24 -Gateway=192.168.0.1 -IPv6PrivacyExtensions=true -IPv6LinkLocalAddressGenerationMode=stable-privacy +DHCP=true # systemctl enable systemd-resolved && systemctl start systemd-resolved # ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf DNS= diff --git a/etc/systemd/network/10-ether.network.d/home-static.conf b/etc/systemd/network/10-ether.network.d/home-static.conf new file mode 100644 index 00000000..aad7fc01 --- /dev/null +++ b/etc/systemd/network/10-ether.network.d/home-static.conf @@ -0,0 +1,16 @@ +[Match] +# Dock MACAddress here? +MACAddress=ff:ff:ff:ff:ff:ff + +[Link] +RequiredForOnline=true +# Takes "ipv4", "ipv6", "both", or "any" (default). +#RequiredFamilyForOnline=both +ActivationPolicy=always-up + +[Network] +# /24, /16, /8 are the the class C, B, A networks +Address=192.168.0.2/24 +Gateway=192.168.0.1 +IPv6PrivacyExtensions=true +IPv6LinkLocalAddressGenerationMode=stable-privacy diff --git a/etc/systemd/network/10-wlan.network.d/example.conf b/etc/systemd/network/10-wlan.network.d/example.conf new file mode 100644 index 00000000..712275b3 --- /dev/null +++ b/etc/systemd/network/10-wlan.network.d/example.conf @@ -0,0 +1,7 @@ +[Match] +SSID=ExampleSSID_nomap BusinessSSID_nomap + +[Network] +DHCP=false +Address=10.1.2.3/8 +Gateway=10.0.0.1