You are not logged in.

#1 2014-03-22 20:01:45

Niourf
Member
Registered: 2014-03-18
Posts: 13

[SOLVED] how to use netctl-auto ?

Hi guys,

My first question is : I regularly connect to two different wifi networks, one at home and one at work. Is there a way to say to netctl to connect automatically on startup to the one that is available?

I read the man, but I think I am a little confused about how I can achieve it. For example I have some error when I try to launch netctl-auto :

~ » systemctl status netctl-auto@wlan0.service                 nico@cotier
netctl-auto@wlan0.service - Automatic wireless network connection using netctl profiles
   Loaded: loaded (/usr/lib/systemd/system/netctl-auto@.service; disabled)
   Active: failed (Result: exit-code) since sam. 2014-03-22 19:53:53 GMT; 2min 26s ago
     Docs: man:netctl.special(7)
  Process: 13880 ExecStart=/usr/bin/netctl-auto start %I (code=exited, status=1/FAILURE)
~ » sudo journalctl -xn                                                                                                                    nico@cotier
-- Logs begin at sam. 2013-06-01 01:02:53 BST, end at sam. 2014-03-22 19:57:23 GMT. --
mars 22 19:54:56 cotier dhcpcd[1210]: wlan0: adding route to 192.168.0.0/24
mars 22 19:54:56 cotier dhcpcd[1210]: wlan0: adding default route via 192.168.0.1
mars 22 19:56:49 cotier sudo[14132]: nico : TTY=pts/1 ; PWD=/home/nico ; USER=root ; COMMAND=/usr/bin/journalctl -xn
mars 22 19:56:49 cotier sudo[14132]: pam_unix(sudo:session): session opened for user root by nico(uid=0)
mars 22 19:56:57 cotier sudo[14132]: pam_unix(sudo:session): session closed for user root
mars 22 19:56:59 cotier sudo[14139]: nico : TTY=pts/1 ; PWD=/home/nico ; USER=root ; COMMAND=/usr/bin/journalctl -xn
mars 22 19:56:59 cotier sudo[14139]: pam_unix(sudo:session): session opened for user root by nico(uid=0)
mars 22 19:57:00 cotier sudo[14139]: pam_unix(sudo:session): session closed for user root
mars 22 19:57:23 cotier sudo[14153]: nico : TTY=pts/1 ; PWD=/home/nico ; USER=root ; COMMAND=/usr/bin/journalctl -xn
mars 22 19:57:23 cotier sudo[14153]: pam_unix(sudo:session): session opened for user root by nico(uid=0)
~ » sudo systemctl start netctl-auto@wlan0.service             nico@cotier
[sudo] password for nico: 
Job for netctl-auto@wlan0.service failed. See 'systemctl status netctl-auto@wlan0.service' and 'journalctl -xn' for details.

Thanks!

Last edited by Niourf (2014-03-22 23:58:15)

Offline

#2 2014-03-22 20:59:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: [SOLVED] how to use netctl-auto ?

First, please verify the name of your wireless network interface.  Are you certain it is wlan0?  Check with ip link
Second, ensure that all other netctl services are not enabled or running.    In other words, make certain the individual services for the access points are not running if you are trying to use netctl-auto.
Third, make sure the dhcpcd service is not running.
Also, I assume you don't have wicd or NetworkManger, but make sure they are disabled if you have them installed.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-03-22 21:30:53

Niourf
Member
Registered: 2014-03-18
Posts: 13

Re: [SOLVED] how to use netctl-auto ?

Hi,

You mean if I try to run sudo systemctl start netctl-auto@wlan0.service when connected to the wifi network (with netctl) it cannot work in any case ?
I tried rebooting to be sure none of the services where running, I have the same error. Sorry I did not mentioned, wlan0 is indeed the name of my interface.

Thanks

Offline

#4 2014-03-22 21:42:28

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] how to use netctl-auto ?

Did you install wpa_actiond?

Offline

#5 2014-03-22 22:10:03

Niourf
Member
Registered: 2014-03-18
Posts: 13

Re: [SOLVED] how to use netctl-auto ?

I did not, do I need to ?

Offline

#6 2014-03-22 22:44:19

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,920
Website

Re: [SOLVED] how to use netctl-auto ?

According to netctl wiki page you do...


Mr Green I like Landuke!

Offline

#7 2014-03-22 22:55:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] how to use netctl-auto ?

Without even looking at the wiki page, the output of pacman told you this on install (though it is understandable that this may have been missed since it is part of the 'base' group).  But you can also see in the output of pacman -Qi netctl that it is an option dependency for the use of netctl-auto's wireless functionality.

Offline

#8 2014-03-22 23:57:56

Niourf
Member
Registered: 2014-03-18
Posts: 13

Re: [SOLVED] how to use netctl-auto ?

thanks guys I got it working. Just needed to install wpa_actiond.
I should have took a better look at the wiki page, I thought I would do just fine only with the man.

Thanks a lot

Offline

#9 2014-03-23 00:01:27

frank604
Member
From: BC, Canada
Registered: 2011-04-20
Posts: 1,218

Re: [SOLVED] how to use netctl-auto ?

https://wiki.archlinux.org/index.php/netctl

Give it a good read.  It isn't too long to read.  Also, learn netctl-auto commands by

man netctl-auto

When I use netctl-auto, I have aliases/scripts that help me switch router connections.  I live right next to work so both routers are picked up.  Sometimes when I'm at home I get automatically connected on the work wifi and vice versa so I do somethng like

netctl-auto switch-to workwifiprofilename

Also, profiles are stored in /etc/netctl

Offline

Board footer

Powered by FluxBB