Talk:Systemd-networkd
Static IP example for single host
(moved from Talk:Network_configuration#Systemd-networkd)
Now that networkd is maturing and much simpler to configure for VMs, containers, etc should we include a section with an example? —This unsigned comment is by Chetwisniewski (talk) 21:42, 1 January 2015. Please sign your posts with ~~~~!
- There is a whole page on systemd-networkd already, and it is linked from Network_configuration#Configure_the_IP_address. -- Lahwaacz (talk) 21:52, 1 January 2015 (UTC)
- It doesn't include any decent static examples. Perhaps I should post these points to that page? Something with example config, like:
/etc/systemd/network/enp3s0.network
[Match] Name=enp3s0 [Network] DNS=fe80:a3c1::1 DNS=192.168.0.1 Address=192.168.0.10/24 Address=2001:DB8::1/64 Gateway=192.168.0.1
Chetwisniewski (talk) 21:59, 1 January 2015 (UTC)
- Re-opening. That would make sense imo. But we need to take care not to break the existing Systemd-networkd#Static IP network instructions. Maybe it is just necessary to clarify which steps are required to set up static for a single host before leading over to the bridge/container setup (analoguous to the first example in Systemd-networkd#Basic DHCP network). Ok?--Indigo (talk) 23:57, 1 January 2015 (UTC)
- Comparing your example config again to what we have, the only major difference is the IPv6 which is not covered in this article yet. Still the basic instructions for a single host could be made clearer in this article. --Indigo (talk) 18:11, 9 February 2015 (UTC)
- And here's an example for static IP with Metric:
[Match] Name=enp* [Address] Address=192.168.1.10/24 RouteMetric=100 [Route] Gateway=192.168.1.1 Metric=100
Bibi (talk) 00:08, 27 June 2024 (UTC)
standalone vs containers
Yes, I agree with the discussion and the style warning on the main page: we should break this out into two parts to make it clear which are for standalone systems and which are for containers which are likely foreign to some users. Graysky (talk) 12:06, 27 March 2015 (UTC)
- There, I made a pretty major edit to the main article in an attempt to break out "basic" from "complex" usage cases. I don't have inclination or knowledge to comb through the original article targeted mainly at container usage. Graysky (talk) 19:49, 27 March 2015 (UTC)
- Thanks. How about moving the whole container section to a subpage. Relevant parts can be merged back to the main article; as of now, the container section is not very usable anyway. -- Alad (talk) 19:53, 27 March 2015 (UTC)
- Feel free to do it. I'm out of time for now. Graysky (talk) 20:03, 27 March 2015 (UTC)
- Neat edit that was! Good to have the basic examples on top. As for moving the container section to a subpage, sure why not. Yet, I would vote for keeping Systemd-networkd#Configuration files on the main page (to see how it works I moved it like it is now). It would be a strange article ending with a section like that though.? The container section uses some configuration files content as practical examples on the other hand. --Indigo (talk) 20:39, 27 March 2015 (UTC)
Usage with containers -- Static IP network
Not having worked with systemd-networkd before (moving over from the custom systemd script method) this section looks like it has a typo, an omission, or a missing explanation. The list of configuration files uses a .netdev extension on MyBridge, and the example uses a .network extension on MyBridge.
Again, being new to systemd-networkd, I think there is supposed to be both a MyBridge.netdev file with "[NetDev] Name=br0 Kind=bridge" and a MyBridge.bridge file with "[Match] Name=br0 [Network] DNS= Address= Gateway=". Or, maybe I'm using more files than I needed and just one of the extensions needs to be changed. Or maybe I'm totally off, and a clarification would prevent someone else from making the same mistake. Jamespharvey20 (talk) 06:44, 20 July 2015 (UTC)
- My guess is that you need MyBridge.netdev from Systemd-networkd#Bridge_interface, MyEth.network from Systemd-networkd#Bind_ethernet_to_bridge and MyBridge.network from Systemd-networkd#Static_IP_network (this is the change against Systemd-networkd#Bridge_network, hence the only file actually shown in that section). If you manage to get it working, please fix the listing of necessary files accordingly. -- Lahwaacz (talk) 07:39, 20 July 2015 (UTC)
- This is correct. The MyBridge.netdev file is needed to create the virtual device br0 first. This way the device now exists when MyEth.network refers to it with Bridge=br0 and MyBridge.network refers to it with Name=br0. Note: In a DHCP setup, I think it may be important to use file names to specify the order, since in theory a physical adapter needs to be bound to the bridge first before the bridge can request an IP address. Perhaps naming the files 10-MyBridge.netdev, 20-MyEth.network, and 30-MyBridge.network would help clarify the meaning behind these files better? This setup worked well for me. Xerion567 (talk) 09:31, 30 January 2016 (UTC)
More static/DHCP examples
The Wiki mentions as a note "The Metric option is for static routes while the RouteMetric option is for setups not using static routes." While not clear why two different keywords are needed (but let's leave that for upstream to discuss), the Wiki has no example of how "Metric" is used in a static configuration.
I think the reader is left somewhat in a trial&error loop here (at least I am as I intend to keep my configuration I used in another distro: static for wired, DHCP for wireless). While I'll figure it out eventually, I think at least some clues here would have been helpful as I do not think that config is so exotic. (use static wired in home office, DHCP wireless abroad) Unfortunately, I'm still lacking sufficient systemd experience to make the amendments myself Archer666 (talk) 20:48, 2 November 2016 (UTC)
It does have an example with "Metric" now in "Configuring a second static IP with its own MAC address on an existing interface". A "Metric=" goes in a "[Route]" section to set the metric of that route. CarloWood (talk) 13:36, 1 February 2025 (UTC)
Remove "network files" section which just duplicates the related man page
As indicated in the removal notice, Systemd-networkd#network_files just duplicates the related man page: systemd.network(5). Should we remove the content and just give a link to the man page? Ismailarilik (talk) 05:21, 18 February 2025 (UTC)
- Yes I think we should remove those two sections. Cvlc (talk) 11:52, 23 July 2025 (UTC)
- The section was removed, closing. Lahwaacz (talk) 08:45, 6 August 2025 (UTC)
Remove "netdev files" section which just duplicates the related man page
As indicated in the removal notice, Systemd-networkd#netdev_files just duplicates the related man page: systemd.netdev(5). Should we remove the content and just give a link to the man page? Ismailarilik (talk) 05:38, 18 February 2025 (UTC)
- The section was removed, closing. Lahwaacz (talk) 08:46, 6 August 2025 (UTC)
Simplification, ICU layout
I'd like to act on the following two subjects above and take the opportunity to reorganize the page. The goal is to remove duplicate info from the man page, and to simplify configuration for simple setups so that everything needed for a basic setup is in basic usage. So:
- Move the examples from #Configuration files to the existing #Configuration examples section.
- Remove #Configuration files section as it duplicates the man page.
- Move #Configuration examples out of #Basic usage
- Move #systemd example network files to #Basic usage
[edit] Actually, it's probably a good opportunity to bring the traditional ICU layout to the article. So basically something like:
1 Installation 1.1 Required services 1.2 systemd-networkd-wait-online 2 Configuration 2.1 systemd example network files 2.2 Multiple interfaces that are not connected all the time 2.3 Wait until network interfaces have a routable address 3 Usage 3.1 networkctl (currently not covered...) 3.2 Wired adapter using DHCP 3.3 Wired adapter using a static IP 3.4 Wireless adapter 3.5 Wired and wireless adapters on the same machine 3.6 [DHCPServer] 3.7 Containers 4 Tips and tricks 5 See also
instead of the current layout which is:
1 Basic usage 1.1 Required services and setup 1.2 systemd-networkd-wait-online 1.2.1 Multiple interfaces that are not connected all the time 1.2.2 Wait until network interfaces have a routable address 1.3 Configuration examples 1.3.1 systemd example network files 1.3.2 Wired adapter using DHCP 1.3.3 Wired adapter using a static IP 1.3.4 Wireless adapter 1.3.5 Wired and wireless adapters on the same machine 2 Configuration files 3 Usage with containers 4 Tips and tricks 5 See also
-- Cvlc (talk) 19:37, 27 July 2025 (UTC)
- 2.2 and 2.3 might also be better off in 4 Tips and tricks, with a link in 1.2. Thoughts? Cvlc (talk) 19:40, 27 July 2025 (UTC)
- IMO the line separating configuration and usage is quite thin (at least with the current content), and network manager pages are not consistent in their use of the these sections. I do think the suggested layout would be better than the current one, so 👍
- I'd prefer keeping 2.2 and 2.3 in "Configuration" and stuffing less stuff in "Tips and tricks".
- -- nl6720 (talk) 08:07, 28 July 2025 (UTC)
- Ok I implemented the main idea. Most of it is moving stuff around without changing much content. The merged configuration intro, which has things from former "configuration files" and from "basic usage" is now too long and needs some simplification I believe. Cvlc (talk) 08:42, 31 July 2025 (UTC)
Tip for users with multiple docking stations requiring different config
I would like to make a section in a "tip and tricks" explaining how to set up names of eth devices depending to which docking station laptop is connected (my usecase; having 2 dock stations in 2 seperate environments).
I choose enp-dock-home and enp-dock-work, so later in NetworkManager, I can have specific config per "environment".
it will include example file for a .link
files, and interface-name=enp-dock-home
in a NetworkManager config. mdujava (talk) 09:32, 29 July 2025 (UTC)
- Sounds like Network configuration#Change interface name to me. You could either extend that section or add something to Network configuration#Tips and tricks. -- nl6720 (talk) 10:39, 29 July 2025 (UTC)
- Yes, that what I did, not sure why I was not able to find it before. mdujava (talk) 11:45, 29 July 2025 (UTC)