You are not logged in.
I am finding the instructions on the wiki complex to have netctl connect if a wired cable is plugged in and then automatically go wireless if it is unplugged and then, if I plug in the wired connection, shut down the wireless.
https://wiki.archlinux.org/index.php/Ne … s_failover
Is there a more simple way to do this? It does not have to use netctl.
Offline
You could use NetworkManager.
Offline
I use dhcpcd.service to connect -- it switches automatically to the cable connection.
For the wireless side, you need to set up /etc/wpa_supplicant/wpa_supplicant.conf correctly (backup the original file):
# echo "ctrl_interface=DIR=/run/wpa_supplicant" > /etc/wpa_supplicant/wpa_supplicant.conf
# wpa_passphrase <SSID> <password> >> /etc/wpa_supplicant/wpa_supplicant.conf
Repeat the second step for all needed wireless access points (replace <SSID> with the name of the access point & <password> with the, er, password).
Then disable all other networking related services (check which are enabled using `ls -l /etc/systemd/system/multi-user.target.wants`) and enable dhcpcd:
# systemctl enable dhcpcd.service
This is also the fastest-starting networking service I have ever used with `systemd-analyze` reporting times in tens of milliseconds.
Jin, Jîyan, Azadî
Offline
Thank you for the dhcpcd advice. I have it setup as you instructed but if I unplug the wired connection, the wireless does not come up. Maybe I missed something?
#1) enabled dhcpcd.service
#2) setup /etc/wpa_supplicant/wpa_supplicant.conf
#3) rebooted with wired connection and it works
#4) unplugged the wired connection and the wireless doesn't come up
Offline
Is wpa_supplicant actually running?
pstree|grep wpa
If it is, stop the .service:
# systemctl stop dhcpcd.service
Then see if you can connect to your wireless using:
# wpa_supplicant -B -i <name of interface> -c /etc/wpa_supplicant/wpa_supplicant.conf
# dhcpcd <name of interface>
Post any error messages and the content of /etc/wpa_supplicant/wpa_supplicant.conf if this doesn't connect.
Jin, Jîyan, Azadî
Offline
This is also the fastest-starting networking service I have ever used with `systemd-analyze` reporting times in tens of milliseconds.
I aim to please
But if it's that fast it's probably just forking to the background as all interfaces don't have a carrier yet.
Also, the others probably use something extra like nm-wait-online to force a wait until something has a network connection - dhcpcd-online does the same thing, but it's part of the dhcpcd-ui project and AFAIK not in Arch proper.
But that's really just a band-aid - apps should monitor IP additions and removals if they need a specific IP to bind to.
EDIT: This is of course speculation as I neither use systemd nor Arch.
Last edited by rsmarples (2015-03-21 21:38:05)
Offline
Thank you for the dhcpcd advice. I have it setup as you instructed but if I unplug the wired connection, the wireless does not come up. Maybe I missed something?
dhcpcd never brings up the wireless - that's the job of wpa_supplicant.
dhcpcd will start wpa_supplicant if it's not already running AND wpa_supplicant.conf is configured correctly.
When it's all working, you'll find that both wired and wireless connections are active and the kernel will prefer wired based on what dhcpcd has told it.
When wired is removes, wireless then takes over almost seamlessly.
I can't really help with why the wireless isn't working for you though.
Offline