diff options
author | Julien Dessaux | 2025-03-04 13:50:23 +0100 |
---|---|---|
committer | Julien Dessaux | 2025-03-04 13:51:03 +0100 |
commit | 04756bb2e0d2a9b41c2f6aedc3f034b320c96f8c (patch) | |
tree | 8407d1dd8c4f4fe3118eafd9f2e97eb952413508 | |
parent | feat(book): add rhythm of war audiobook (diff) | |
download | www-04756bb2e0d2a9b41c2f6aedc3f034b320c96f8c.tar.gz www-04756bb2e0d2a9b41c2f6aedc3f034b320c96f8c.tar.bz2 www-04756bb2e0d2a9b41c2f6aedc3f034b320c96f8c.zip |
feat(blog): add systemd-networkd article
-rw-r--r-- | content/blog/linux/systemd-networkd.md | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/content/blog/linux/systemd-networkd.md b/content/blog/linux/systemd-networkd.md new file mode 100644 index 0000000..861a928 --- /dev/null +++ b/content/blog/linux/systemd-networkd.md @@ -0,0 +1,54 @@ +--- +title: Static addressing with systemd-networkd +description: Dual IPv4 and IPv6 configuration +date: 2025-03-04 +tags: +- systemd +--- + +## Introduction + +I like to keep up with what established operating systems or Linux distributions +are doing even though I am not using them all everyday. While trying out +OpenSUSE again recently, I gave a first try ever to using `systemd-networkd`. + +## Configuration + +Here is an example of how to configure your network statically with +`systemd-networkd`. The quirk is that there is no way to specify two `Gateway` +attributes in a `Network` block. Since you can have multiple `Address` blocks, +this is an inconsistency that required some reading of the manual before it +clicked. + +Here is what ended up working for my `/etc/systemd/network/20-wired.network`: + +``` ini +[Match] +MACAddress=fa:16:3e:82:71:b7 + +[Network] +Address=37.187.244.19/32 +Address=2001:41d0:401:3100::fd5/64 +DNS=1.1.1.1 + +[Route] +Destination=0.0.0.0/0 +Gateway=37.187.244.1 +GatewayOnLink=yes +Metric=10 + +[Route] +Destination=::/0 +Gateway=2001:41d0:401:3100::1 +Metric=10 +``` + +The `GatewayOnLink` attribute might not be needed for you. I am using it because +this is an OVH box and this provider likes to reduce instances chatter by +issuing `/32` netmasks on DHCP. Though I could use a more standard netmask in +this static configuration, I choose to respect their preference. + +## Conclusion + +In the end `systemd-networkd` works well and I have no complaints other than +this quirkiness. |