You are not logged in.

#1 2020-01-01 22:28:22

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

SOLVED: netctl vs. systemd-networkd?

I've been happily using netctl for years, but it seems like you can do everything using systemd-networkd these days?  I recently configured a wireless Arch desktop for my daughter and getting wireless working with systemd-networkd was dead simple -- no NetworkManager required.  Given the nature of Arch, I would have assumed a switchover to systemd-networkd by now.

Anybody have any insight here?  I thought there would be some discussion on the netctl and/or systemd-networkd, but didn't see anything.

Last edited by pgoetz (2020-01-01 22:58:47)

Offline

#2 2020-01-01 22:32:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: SOLVED: netctl vs. systemd-networkd?

What do you mean by 'switchover'? Arch doesn't have a preferred method of networking, it's up to the user to decide.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2020-01-01 22:37:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: SOLVED: netctl vs. systemd-networkd?

https://wiki.archlinux.org/index.php/Ne … k_managers

wiki networking article wrote:

Note: There are many solutions to choose from...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2020-01-01 22:55:34

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

Slithery wrote:

What do you mean by 'switchover'? Arch doesn't have a preferred method of networking, it's up to the user to decide.

Previously netctl was included in the base package group, which kind of biases things.  But, my bad; I hadn't been paying sufficient attention to notice that the base package group has been dramatically downsized, as reflected in Installation guide, which I haven't looked at in a long time, either.  Thanks for the heads up.

Offline

#5 2020-01-01 22:59:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

The base group also previously included jfsutils.  This was not an indication that jfs was a preferred or recommended filesystem that arch has "changed over" from to ext{2,3,4}.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2020-01-02 03:05:45

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

Trilby wrote:

The base group also previously included jfsutils.  This was not an indication that jfs was a preferred or recommended filesystem that arch has "changed over" from to ext{2,3,4}.

Not to mention lvm2, reiserfsprogs, and xfsprogs.  But netctl was the only included network management package.

Offline

#7 2020-01-02 03:12:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

Not even that.  There was iproute2 and dhcpcd at least.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2020-01-02 14:16:50

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: SOLVED: netctl vs. systemd-networkd?

iproute2 is still present in base so atleast manually establishing a (wired) connection is possible on any archlinux systems.

As for switching over to systemd-networkd : search for problems with name resolution with systemd-networkd and netctl .
Then decide which you prefer.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#9 2020-01-02 14:39:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

I prefer neither.  It's not even sensical to present those two as lone/primary/whatever alternatives.  It's about on par with saying archers can chose from either gnome or xfce.  Sure, those are two optional DEs that could be used, but phrasing it that way is beyond misleading.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2020-01-02 15:06:52

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

Trilby wrote:

I prefer neither.

What do you use for network configuration?

Offline

#11 2020-01-02 15:16:39

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

Lone_Wolf wrote:

As for switching over to systemd-networkd : search for problems with name resolution with systemd-networkd and netctl .
Then decide which you prefer.

I have to deal with several distros in my day job (mostly Ubuntu and CentOS/Redhat) and ran into the name resolution issues you mention when Ubuntu 18.04 first came out and was using the systemd resolver.  Those problems seem to have worked themselves out?  Name resolution just works in the last 10-12 deployments I've done on systems using systemd for name resolution.

I set my home workstation up 4-5 years ago when netctl was definitely the recommended solution and have just been doing updates since.  Even though I'm using netctl and openresolv, the systemd stuff is installed and available:

[root@frog ~]# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; disabled>
     Active: inactive (dead)
       Docs: man:systemd-networkd.service(8)
[root@frog ~]# systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled>
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             https://www.freedesktop.org/wiki/Software/systemd/resolved
             https://www.freedesktop.org/wiki/Software/systemd/writing-network->
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver>
[root@frog ~]# 

I'm probably going to switch everything over to systemd networking, since this seems to be where things are headed and I'm getting it whether I want it or not anyway.  smile

And as previously mentioned, setting up DHCP wireless on an Arch system with systemd-networkd involves creating a 4 line file and starting the daemons:

 # cat /etc/systemd/network/25-wireless.network

    [Match]
    MACAddress=04:d3:b0:80:53:9a

    [Network]
    DHCP=ipv4


[root@iguana ~]# systemctl enable systemd-networkd
[root@iguana ~]# systemctl enable systemd-resolved
[root@iguana ~]# systemctl start systemd-networkd
[root@iguana ~]# systemctl start systemd-resolved

Not sure how it could get an easier than this.

Last edited by pgoetz (2020-01-02 15:18:22)

Offline

#12 2020-01-02 15:33:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

pgoetz wrote:

What do you use for network configuration?

dhcpcd@.service with the wpa_supplicant hook enabled.  That's it.  When I want to add/modify networks, `vim /etc/wpa_supplicant/wpa_supplicant.conf`.

But there are many options - just as there are DEs/WMs/etc.

Last edited by Trilby (2020-01-02 15:33:36)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2020-01-02 15:35:57

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 412
Website

Re: SOLVED: netctl vs. systemd-networkd?

pgoetz wrote:

Not sure how it could get an easier than this.

Though I agree with your assessment and everything in your post, and not to be "that guy", but I do just want to posit another alternative for strictly wireless setups that may actually be "easier" - you can use IWD and drop the requirement for systemd-networkd altogether.

Let IWD manage the networking side and it interfaces with systemd-resolved as well. You can easily create .psk networks manually if you don't want to fab about with iwctl.

ArchWiki wrote:

A minimal example file to connect to a WPA2/PSK secured network with SSID "spaceship" and passphrase "test1234":

/var/lib/iwd/spaceship.psk
[Security]
PreSharedKey=aafb192ce2da24d8c7805c956136f45dd612103f086034c402ed266355297295

Also,

[root@iguana ~]# systemctl enable systemd-networkd
...
[root@iguana ~]# systemctl start systemd-networkd

can become simply

[root@iguana ~]# systemctl enable --now systemd-networkd

Last edited by CarbonChauvinist (2020-01-02 15:37:29)


"the wind-blown way, wanna win? don't play"

Offline

#14 2020-01-02 16:06:36

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

CarbonChauvinist wrote:

I do just want to posit another alternative for strictly wireless setups that may actually be "easier"

Thanks for those tips, including the --now flag for systemctl enable.  At this point systemd warrants a book; I keep running into new useful tricks.

IWD: The core goal of the project is to optimize resource utilization by not depending on any external libraries and instead utilizing features provided by the Linux Kernel to the maximum extent possible.

I wonder if this results in any performance improvements?  If so, I could be tempted to switch.

Offline

#15 2020-01-03 08:33:41

digitalone
Member
Registered: 2011-08-19
Posts: 328

Re: SOLVED: netctl vs. systemd-networkd?

pgoetz wrote:

I wonder if this results in any performance improvements?  If so, I could be tempted to switch.

No. At least not for me. I switched a couple of months ago and came back to wpa_supplicant. Got random disconnections with iwd: wpa_supplicant is generally more robust with low level signals.

Last edited by digitalone (2020-01-03 08:33:55)

Offline

#16 2020-01-03 13:03:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

And it's trivially easy to configure wpa_supplicant to connect to any available open wireless network if no known network is available.  I don't beleive it is even possible to do this with iwd.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2020-01-03 14:58:19

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 412
Website

Re: SOLVED: netctl vs. systemd-networkd?

All valid points, and I'm not here to put on a cape for IWD. In my personal usage I've never had any performance issues compared to wpa_supplicant. And to Trilby's point re: open wireless networks, I must agree this is a feature I do like in wpa_supplicant and have sometimes missed with IWD (discounting the security implications of auto connecting to open networks in a new location).

The best I could find WRT iwd  handling auto connecting and open networks was the following writeup from doc/automatic-net-selection.txt:

When IWD is searching for a network to connect to automatically, the following factors are taken into account:
- Signal strength level
- Is the network a legacy WPA network, or RSN compliant?  More weight is given to networks that are RSN compliant.
- Is the network Open or requires authentication?  More weight is given to networks that require authentication.
- Does the network support privacy in its Capability Information field?  More weight is given to BSSes that do.
- Maximum rate of the network
- Channel Utilization (from BSS Load) of the network
- Has the network been connected to before and if so, how long ago?  Networks that have not been connected to previously are ignored for auto-connect purposes.

Also IWD is very much a moving target right now, and features will sometimes collide as they are rolled out and worked out. I just think the potential for IWD is through the roof. For example their goals on actively managing network interfaces are really interesting to my uninitiated self.

--Edit: Doesn't look like this feature will be on their roadmap.

@ denkenz: We don’t support such wildcarding.  I’ve never seen any end-user OS do this, and I’m not sure I see the utility
@ denkenz: I would think that connecting to random open networks without asking isn’t desired in the first place.
@ denkenz: If you want to pre-configure a set of open networks, then just drop empty <ssid>.open files into /var/lib/iwd

Last edited by CarbonChauvinist (2020-01-03 17:29:37)


"the wind-blown way, wanna win? don't play"

Offline

#18 2020-01-05 19:54:36

linux-mate
Banned
Registered: 2018-06-28
Posts: 78

Re: SOLVED: netctl vs. systemd-networkd?

"Message" is a required field in this form.

Mod comment:   Post blanked by the author.  Author has been banned

Last edited by ewaller (2020-01-05 22:17:58)

Offline

#19 2020-01-06 03:31:05

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: SOLVED: netctl vs. systemd-networkd?

pgoetz wrote:

I've been happily using netctl for years, but it seems like you can do everything using systemd-networkd these days?

I don't see these dhcpcd features in systemd-networkd:

ARPing host to select profile
Scriptable hooks
per SSID profile
IP address sharing across interfaces
automatically preferring wired over wireless

Likewise, dhcpcd does not support some features found in other products such as:
bridge setup
VPN setup

wireless setup is handled by dhcpcd-ui

Is this list inconclusive? Probably.

Can you do everthing with any product? No. Mainly because they have different scopes.
But when it comes down to nuts and bolts, there is practically nothing you cannot do with dhcpcd.
One of the killer features people are discovering of late is the ability to start and stop a VPN to your home network based on the profile selected for your network.
This does require some scripting, but it's possible and dynamic. Once setup, It Just Works.

Offline

#20 2020-01-06 03:36:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: SOLVED: netctl vs. systemd-networkd?

Of course you're not biased or anything though tongue


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#21 2020-01-06 03:55:05

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: SOLVED: netctl vs. systemd-networkd?

Trilby wrote:

Of course you're not biased or anything though tongue

Oh, I'm *very* biased - let us make no bones about it smile

I just enjoy "modern" software catching up to where I was over 10 years ago AND STILL lacking features that a lot of my users describe as "basic requirement".

Offline

#22 2020-01-11 11:08:00

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

Lone_Wolf wrote:

As for switching over to systemd-networkd : search for problems with name resolution with systemd-networkd and netctl .
Then decide which you prefer.

I'm going to have to partially retract my previous comment.  I've now run into a situation with systemd-resolved which I was unable to resolve, forcing me to disable the service.  Briefly, I could not get name resolution to work when iptables SNAT/masquerading is in use.  If I include this line in my iptables configuration:

iptables -t nat -A POSTROUTING -j SNAT --to-source 128.128.129.14

systemd-resolved name resolution stops working, and no iptables incantation that I could some up (e.g. adding ! -s 127.0.0.1/8 to the SNAT line) fixed this.  systemd-resolved cleverly uses a localhost stub connection (127.0.0.53) to redirect name resolution requests to actual name servers.  My understanding is the utility of this is to facilitate things like having different VMs/containers query different name servers, however there's something about this configuration which doesn't play nicely with SNAT/masquerading.

You'd think someone else would have already run into this (this occurred with an Ubuntu 18.04 server VM), but a half day spent googling didn't turn up anything useful.

Offline

#23 2020-01-11 11:09:34

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: SOLVED: netctl vs. systemd-networkd?

rsmarples wrote:

I don't see these dhcpcd features in systemd-networkd:

Thanks for posting this -- that was interesting and informative.  Question: is any of this documented anywhere?  The problem with these things is always lack of documentation (which systemd is just as guilty of as anyone else I might add; perhaps even more so).

Last edited by pgoetz (2020-01-11 11:10:08)

Offline

#24 2020-01-11 12:19:08

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: SOLVED: netctl vs. systemd-networkd?

pgoetz wrote:
rsmarples wrote:

I don't see these dhcpcd features in systemd-networkd:

Thanks for posting this -- that was interesting and informative.  Question: is any of this documented anywhere?  The problem with these things is always lack of documentation (which systemd is just as guilty of as anyone else I might add; perhaps even more so).

I've not documented IP address sharing because how it works varies from OS to OS.
But it's pretty reliable so I migth do in the future.

The other features listed ARE documented in the dhcpcd(8) man page.
A more inclusive list of just features is documented here:
https://roy.marples.name/projects/dhcpcd/features

Up and coming features include priviledge separation and anonymous profiles (one feature I admit systemd-networkd has which dhcpcd doesn't).

Offline

Board footer

Powered by FluxBB