You are not logged in.
I'm new to Arch and I'm confused how to manage automatic network connections. Of course I've read all of wiki pages regarding to the topic, but it seems to me they're a little over-complicated due to too many ways/tools of doing the same. So I would be grateful if someone explain me how things are related to each other.
So here is what I did after installation:
ip link #I get PNIC/interface name
systemctl start dhcpcd@enp0s25.serviceAfter, when there was no wire connection, I run:
wifi-menu #using dialog I successfully configured the connectionI've noticed the wifi-menu generated config file at /etc/netctl (as I figured it's a profile used by netctl tool). Now, as far as I understand both of wireless and wire connections established automatically if available. But I have no idea how things work and how to manage them, eg:
- how to disable manually wifi, if I use wireless and vice versa
- how netctl start PROFILE and systemctl start dhcpcd@enp0s25.service are related to each other
- etc
Sometimes I face with some commands like these:
systemctl enable netctl-auto@wlp3s0
systemctl enable netctl-ifplugd@enp2s0in order to manage automatic connections. But why do I need them if Arch already establish connection on both interface.
I hope you got the idea of my confusion.
Last edited by timfayz (2016-02-08 10:12:12)
Offline
Systemd-networkd can do it. Seethe wiki.
Offline
- how to disable manually wifi, if I use wireless and vice versa
# ip l set $INTERFACE downWorks for me ![]()
- how netctl start PROFILE and systemctl start dhcpcd@enp0s25.service are related to each other
They are not related and are completely separate .services
netctl uses `systemctl` to enable the needed .services but abstracts this away from the user (surprisingly, considering it is an Arch-native tool).
I agree that this can be confusing but you should *only* use the `netctl` command to manage the connections.
For automatic switchover between wired & wireless, I would recommend either dhcpcd.service (the non-interface-specific version) with the wpa_supplicant hook added or systemd-networkd using the dhcp RouteMetric to handle the switch, as outlined here:
https://wiki.archlinux.org/index.php/Sy … me_machine
Jin, Jîyan, Azadî
Offline
Systemd-networkd can do it. Seethe wiki.
Please could you be more descriptive. Messages like this give no clue to how things work
.
The next question how systemd-networkd and netctl tools are related to each other?
Offline
how systemd-networkd and netctl tools are related to each other?
They're not.
They are completely separate tools.
Jin, Jîyan, Azadî
Offline
I agree that this can be confusing but you should *only* use the `netctl` command to manage the connections.
For automatic switchover between wired & wireless, I would recommend either dhcpcd.service (the non-interface-specific version) with the wpa_supplicant hook added or systemd-networkd using the dhcp RouteMetric to handle the switch, as outlined here:
https://wiki.archlinux.org/index.php/Sy … me_machine
So I didn't get the idea. It seems they have very similar purpose. May be I can stick with one tool? For example, use only systemd-networkd service to manage wire/wireless connections? Previously, you said
> you should *only* use the `netctl`... to manage the connections.
But then recommend to use `systemd-networkd using the dhcp RouteMetric to handle the switch`.
Offline
May be I can stick with one tool? For example, use only systemd-networkd service to manage wire/wireless connections? Previously, you said
> you should *only* use the `netctl`... to manage the connections.
But then recommend to use `systemd-networkd using the dhcp RouteMetric to handle the switch`.
Yes, sorry, now I am being unclear ![]()
I meant that *if* you use netctl to manage your connections then you shoud not attempt to use `systemctl` to control the netctl-related .services directly.
Personally, I prefer to use systemd-networkd because of the lack of abstraction.
Jin, Jîyan, Azadî
Offline
netctl is a network-manager that works with systemd (but it is not the part of systemd)
systemd-networkd is a systemd component that can manage network connections. So you can use either of it.
Dhcpcd is dhcp client for dynamic ip address resolution, it can work directly on ethernet interface if password is not required. Netctl uses dhcpcd for connecting to ethernet. (as far as I understand, I may be wrong also)
Arch is home!
https://github.com/Docbroke
Offline
So can I use *only* systemd-networkd and leave the netctl?
My brain become overwhelmed when there are too many tools do the same thing and no one (especially wiki pages) do not recommend what to chose/stick with leaving newbies on their own ![]()
Offline
So can I use *only* systemd-networkd and leave the netctl?
That is your decision, both tools should work but I don't have much experience with netctl
If you wait a bit, I'm sure other users will disagree with me.
My brain become overwhelmed when there are too many tools do the same thing and no one (especially wiki pages) do not recommend what to chose/stick with leaving newbies on their own
Welcome to Arch, isn't it epic?![]()
Jin, Jîyan, Azadî
Offline
That is your decision, both tools should work but I don't have much experience with netctl
Ok, let's assume I stick with systemd-networkd. Do I need to: `disable dhcpcd@interface.service` prior to `systemctl start systemd-networkd`? What about netctl? Do I need to "disable" something relating to netctl?
I also didn't figure out what the service responsible for automatic connections of my wifi interface.
Welcome to Arch, isn't it epic?
If "epic" means "next to fail" then maybe...I think so:) If you mean "unusually large, powerful or wonderful" - absolutely not. There are too much mess, tons of command (interchangeably) related to each other, each (even bundled or "built-in" commands) have its own ideology, too mach different syntaxes and config files. I think this is why Plan 9 was created, but it was too late:(
Last edited by timfayz (2016-02-08 11:14:29)
Offline
Ok, let's assume I stick with systemd-networkd. Do I need to: `disable dhcpcd@interface.service` prior to `systemctl start systemd-networkd`? What about netctl? Do I need to "disable" something relating to netctl?
Yes, you should disable all other networking programs and .services
You should only have one networking program active for each interface to prevent conflicts.
Check for enabled .services (and .sockets & .targets) with:
systectl list-unit-files|grep enabledFor example, I use systemd-networkd for both wired and wireless and I have this output:
empty@Arch ~ % systemctl list-unit-files|grep enabled
autovt@.service enabled
dbus-org.freedesktop.network1.service enabled
dbus-org.freedesktop.resolve1.service enabled
getty@.service enabled
nftables.service enabled
systemd-networkd.service enabled
systemd-resolved.service enabled
wpa_supplicant@.service enabled
systemd-networkd.socket enabled
default.target enabled
multi-user.target enabled
fstrim.timer enabled The wpa_supplicant@.service is needed to authenticate the wireless connection but no other networking .services are enabled ![]()
If you mean "unusually large, powerful or wonderful" - absolutely not. There are too much mess, tons of command (interchangeably) related to each other, each (even bundled or "built-in" commands) have its own ideology, too mach different syntaxes and config files.
Perhaps you should switch to Ubuntu instead...![]()
Jin, Jîyan, Azadî
Offline
graysky wrote:Systemd-networkd can do it. Seethe wiki.
Please could you be more descriptive. Messages like this give no clue to how things work
.
The next question how systemd-networkd and netctl tools are related to each other?
Typing from my phone. Our wiki is really good and the tool I mentioned can do what you asked. I tried with netctl a while ago and could not get a reliable switch over. Search on my name and wireless to find those threads if you are so inclined.
Offline
Yes, you should disable all other networking programs and .services
Good, I will try!
Perhaps you should switch to Ubuntu instead...:P
It's not about Arch or Ubuntu or whatever (BTW, I moved from Ubuntu
, because I have no idea what's going on under the hood). It's about Linux world as a whole
I know, this is just how things was done historically and there is absolutely no one to blame.
Typing from my phone. Our wiki is really good and the tool I mentioned can do what you asked. I tried with netctl a while ago and could not get a reliable switch over. Search on my name and wireless to find those threads if you are so inclined.
Got it, thank you!
Last edited by timfayz (2016-02-08 11:36:45)
Offline
... but it seems to me they're a little over-complicated due to too many ways/tools of doing the same.
I completely agree. I feel pretty confident in my ability to help people diagnose, understand, and fix network-connection related issues. But lately all such threads start with struggles with all these tools that I've never used. When someone post struggling with wifi-radar, wifi-menu, netctl, etc etc, I first have to look up that tool to figure out what it's really doing and where the problem may lie. And generally I just give up, as many of these tools just seem absurdly complex ways of doing something that is just as absurdly simple.
When I put my own tastes for stark minimalism and CLI only tools, I can appreciate the goals of something like Network Manager with it's various gui "applets". This is a complex tool, but it does provide a lot more than the simple tools. But netctl and some of the other cli methods just seem to add enormous complexity without actually adding any features (sorry if this is just my ignorance of them, but I'm a reasonably capable person and I just can't see what these tools are supposed to be adding).
So I just use dhcpcd@.service. That's it. I couldn't imagine it possibly being easier - and all these other tools add complexity to only make it harder.
As of a recent update I had to add the wpa_supplicant hook to dhcpcd which had previously been active by default, but otherwise it "Just Works".
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yes, you should disable all other networking programs and .services
You should only have one networking program active for each interface to prevent conflicts.
It is a noob question, but do I need to reboot after disabling services? For example, I expect when I did systemctl disable dhcpcd@interface.service and systemctl disable netctl@wlp10s0b1\x2dHangglide.service the interfaces should be inactive (like if I do: ip link interface down), but the networks are still work. What is the trick? Or services do nothing when I disable them.
So I just use dhcpcd@.service. That's it. I couldn't imagine it possibly being easier - and all these other tools add complexity to only make it harder.
It would be great if so!
But, please, could you give a simple example (I know there is a whole wiki page about it) how to configure simple dhcp wire connection?
Offline
It is a noob question, but do I need to reboot after disabling services?
Not if you use:
# systemctl disable foo.service --now![]()
EDIT: Do yourself a favour and read `man systemctl`
Last edited by Head_on_a_Stick (2016-02-08 15:23:06)
Jin, Jîyan, Azadî
Offline
It would be great if so!
But, please, could you give a simple example (I know there is a whole wiki page about it) how to configure simple dhcp wire connection?
I already gave the example, that's it. For a wired connection there is really absolutely nothing else required:
systemctl enable dhcpcd@enp0s25I ran that once and never have to think about it again (enp0s25 is my interface name, get yours from `ip a` output).
For wireless you just also need to make sure you have proper entries in wpa_supplicant.conf (even for "open" networks, just use key_mgmt=NONE). And as of a recent update to dhcpcd, you'd also need to add the wpa_supplicant hook from /usr/share/dhcpcd/hooks to /usr/lib/dhcpcd/dhcpcd-hooks.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hm...that's intersting! Big thank you!
And there are 2 consequential questions:
- What is the most "low level" tool to configure my network interfaces? ip command?
- Do the dhcpcd, systemd-networkd and netctl use in any ways the ip command underneath (hence iproute2 package)?
Offline
Well, the most low level would be a charged pin, a good magnifying glass, and a very steady hand. The most low level that remains practical is most likely dhcpcd for wired and dhcpcd + wpa_supplicant for wireless. And these can be automated with their respective systemd service files.
I would not get rid of iproute2 as it has many useful utilites, but as far as I know dhcpcd does not depend on it.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Well, the most low level would be a charged pin, a good magnifying glass, and a very steady hand
I can tell you're not an EMACS user ![]()
@OP: You can use ip(8) to assign the addresses manually and do without dhcpcd (or any other dhcp client) if you want your system as slim as possible.
See https://github.com/Head-on-a-Stick/conf … 40.service for an example (that is for wireless but the ip(8) lines would be the same for an ethernet connection) ![]()
Jin, Jîyan, Azadî
Offline
No, I'm Vim user
. Thank you for explanations, guys - it becomes a little clearer now..
Offline