Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_gui has no control over wired connection, only wireless
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
roytheman
n00b
n00b


Joined: 08 Nov 2009
Posts: 64

PostPosted: Sat Mar 09, 2013 4:28 pm    Post subject: wpa_gui has no control over wired connection, only wireless Reply with quote

Hello Gentoo Forum,

I am using wpa_supplicant (version 0.7.3-r5) with the qt use flag set which then provides wpa-gui. Everything works fine and both interfaces (wired and wireless) are up and working on each system reboot but wpa_gui does not have any control over my wired ethernet connection (eth0) as far as starting and stopping it goes. The wpa_gui DOES have control over the wireless connection, however (wlan0). For example, if I want to stop my wireless connection, all I have to do is click on "disconnect",and it stops, and if I want to start it, I click on "connect". But clicking on these same buttons has no effect on the wired connection when it is active (eth0). If I want to stop eth0, I have to use another method, such as "ifconfig eth0 down" or else kill the dhcpcd process. Eth0 automatically starts fine on each reboot, as does wlan0. The problem is I can't stop or start eth0 by clicking on "disconnect" like I can with wlan0.
I have tried version 2.0 but it does the same thing.
I have searched and searched for a reason for this behavior but I can't find a solution anywhere. I suspect this will be a hard one to solve for that reason.

My config files look like this for wireless (wpa_supplicant.conf1)

Code:


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1

network={
   ssid="Verizon-890L-8F48"
   psk="mypsswd"
   proto=RSN
   key_mgmt=WPA-PSK
   pairwise=CCMP
   auth_alg=OPEN
}

network={
   ssid="MBR1400-a2d"
   psk="mypsswd"
   proto=RSN
   key_mgmt=WPA-PSK
   pairwise=CCMP
   auth_alg=OPEN
   disabled=1
}



Below is for the wired connection (wpa_supplicant.conf)

Code:


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
ap_scan=0
update_config=1

network={
   ssid=""
   key_mgmt=IEEE8021X
   auth_alg=OPEN
   eap=PSK
   eapol_flags=0
}



My startup scrip looks like this in /etc/local.d

Code:


#!bin/sh

wpa_supplicant -B  -D wext -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf  -i wlan0 -N  \
wpa_supplicant -B  -D wired -c /etc/wpa_supplicant/wpa_supplicant-eth0.conf  -i eth0



The above lines allow both interfaces to come up at the same time but the problem still persists if I use each line individually.

In /etc/conf.d/net it looks like this:

Code:


modules_wlan0="-Dwext"
modules_eth0="-Dwired"
config_wlan0="dhcp"
config_eth0="dhcp"



Dhcpcd is started by netmount (it is not in any runlevel) and I have no net.wlan0 or net.eth0 in /etc/init.d. I also have disabled hot plugging in /etc/rc.conf. There is no .net* in any of the runlevels except net.lo. I am using a recent upgrade of Gentoo and I use baselayout 2.

I would rather not use another frontend such as wicd or networkmanager at this time, by the way.

Does anybody have any ideas as to what could be causing this? Help will be most appreciated.

Sincerely,
Roy


Last edited by roytheman on Mon Mar 11, 2013 5:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Sun Mar 10, 2013 7:45 am    Post subject: Reply with quote

Roy ...

Your setup/configuration is wrong on many accounts. Firstly, you should not be running wpa_supplicant from local.d but configure it to start as a result of net.wlan0 and/or net.eth0 starting. Secondly, your trying to pass vars to wpa_supplicant from vars used by net.* (ie: modules_wlan0="-Dwext"). Thirdly, dhcpcd should be started as a result of net.${IFACE} having been started, as it is with wpa_supplicant, and it should not rely on netmount 'need[ing] net' to be brought into play. I suspect the actual issue is the '-N' as this is a switch to wpa_supplicant at which you provide another interface, not another instance of wpa_supplicant.

So, I'd suggest the following: remove wpa_supplicant from local.d and configure net.wlan0 and net.eth0 as in the following (question though, why are both active?).

/etc/conf.d/net
Code:
modules_wlan0="!plug wpa_supplicant dhcpcd"
config_wlan0="dhcp"
wpa_supplicant_wlan0="-Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf"
wpa_timeout_wlan0="15"
#enable_ipv6_wlan0="false"

modules_eth0="!plug wpa_supplicant dhcpcd"
config_eth0="dhcp"
wpa_supplicant_eth0="-Dwired -c /etc/wpa_supplicant/wpa_supplicant-eth0.conf"
#enable_ipv6_eth0="false"


You would then add your net.${IFACE} to start in the runlevel, though really you should probably use something like sys-apps/ifplugd to manage net.eth0 and have it trigger wpa_supplicant via /etc/ifplugd/ifplugd.action ... you would then only need to connect the ethernet cable for it to become active.

Additionally, for on one interface to be sufficient to 'provide net' then you should add/change /etc/rc.conf and add rc_depend_strict="NO" ... this way both interfaces won't be required for the 'net' depend to be met.

best ... khay
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2138
Location: $TERM

PostPosted: Sun Mar 10, 2013 11:36 am    Post subject: Reply with quote

I was under the impression that wpa supplicant was for wired interface _only_. And looking at the man pages I remain under that impression.
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Sun Mar 10, 2013 11:47 am    Post subject: Reply with quote

dE_logics wrote:
I was under the impression that wpa supplicant was for wired interface _only_. And looking at the man pages I remain under that impression.

dE_logics ... in which case you might might read the very first line of that manpage in which it states "wpa_supplicant - Wi-Fi Protected Access client and IEEE 802.1X supplicant."
Back to top
View user's profile Send private message
roytheman
n00b
n00b


Joined: 08 Nov 2009
Posts: 64

PostPosted: Mon Mar 11, 2013 5:00 pm    Post subject: Reply with quote

Hello khay,

Thanks for taking the time to deal with my problem.

I reconfigred everything suggested in your post but all that shows up in wpa_gui after a system boot are the two wireless entries from wlan0 (which work fine) but the wired portion (eth0) does not show up at all in wpa-gui, only the wireless portion shows up. But the wired eth0 is active at bootup time and it works. It just does not appear in the gui anywhere. Only the wireless does.

Tthis is now what I have:
Code:

modules_wlan0="!plug wpa_supplicant dhcpcd"
config_wlan0="dhcp"
wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf"
wpa_timeout_wlan0="15"
#enable_ipv6_wlan0="false"

modules_eth0="!plug wpa_supplicant dhcpcd"
config_eth0="dhcp"
wpa_supplicant_eth0="-Dwired -c /etc/wpa_supplicant/wpa_supplicant-eth0.conf"
#enable_ipv6_eth0="false"


I changed the driver you provided (-Dnl80211) to -D wext, by the way. I also symlinked net.eth0 and net.wlan0 to .net in /etc/init.d and put both symlinks in the default runlevel "rc-config add net.eth0 default" and "rc-config add net.wlan0 default".

I also noticed that in the two lines for wpa_supplicant (shown above) there has to be a space between the -D and the driver, like this "-D wired" and not like this "-Dwired". When the space is not there, my applications do not launch such as Firefox or Dolphin or a terminal. The apps give a message saying "no proticol specified - cannot open display: :0.0". That makes me think netmount is having trouble starting properly when there is no space between the -D and the driver (-Dwext). Strange, eh? Maybe that only exists on my particular system setup and nobody elses. On a command line, however, it makes no difference if a space is there or not but not so when using /etc/conf.d/net. As long as a space is there in "net", every application opens fine. I also have rc_depend_strict="NO" in rc.conf. I did not use the /etc/ifplugd/ifplugd.action that you mentioned, however.

I also did away with my start-up script altogether.

Here is the message I get during the boot-up process (POST):

Code:

Bringing up interface eth0
starting wpa_supplicant on eth0
starting wpa_cli on eth0
Backgrounding
Warning net.eth0 has started but it is inactive
Warning netmount is scheduled to start when net.eth0, net.wlan0 have started

Bringing up interface wlan0
starting wpa_supplicant on wlan0
starting wpa_cli on wlan0
Backgrounding
Warning net.wlan0 has started but it is inactive
Warning netmount is scheduled to start when net.eth0, net.wlan0 have started


I'm still trying to figure this thing out and I hope you (or someone) will continue to help me with it.

Thank you for your time,

Sincerely,
Roy

UPDATE UPDATE
I just discovered that I can comment out EVERY LINE in /etc/conf.d/net and nothing changes - I still boot up with the wireless network working fine and can be controlled with wpa_gui and at the same time the wired network is also up and working but it does not show up in wpa_gui.
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Tue Mar 12, 2013 9:53 am    Post subject: Reply with quote

roytheman wrote:
I reconfigred everything suggested in your post but all that shows up in wpa_gui after a system boot are the two wireless entries from wlan0 (which work fine) but the wired portion (eth0) does not show up at all in wpa-gui, only the wireless portion shows up. But the wired eth0 is active at bootup time and it works. It just does not appear in the gui anywhere. Only the wireless does.

roytheman ... I should say that I don't use wpa_gui and so I'm guessing the reason for this is that when wpa_gui is run by default it "choose[s] the first interface found with a control socket in the socket path" (from the wpa_gui manpage). So, although there are two 'ctrl_interface' sockets in /run/wpa_supplicant/ it selects the first unless the '-i ifname' is supplied. I can't say if two ctrl_interfaces can be managed by one wpa_gui instance, its not something I've ever seen or tried. You might try providing two interfaces parameters when starting wpa_gui, ie (untested):

Code:
wpa_gui -i wlan0 -i eth0 -t

roytheman wrote:
I changed the driver you provided (-Dnl80211) to -D wext, by the way. I also symlinked net.eth0 and net.wlan0 to .net in /etc/init.d and put both symlinks in the default runlevel "rc-config add net.eth0 default" and "rc-config add net.wlan0 default".

CFG80211/NL80211 (netlink) replaces WEXT (wireless extentions) and unless you explicitly disabled CFG80211 in the kernel you will be using nl80211 (though through CFG80211_WEXT compatibility layer). So, really you should state '-Dnl80211' ... or you can state a fallback to use if the first isn't available '-Dnl80211,wext'.

You can see if CFG80211, WEXT, etc, is enabled with the following:

Code:
# awk '/(WEXT|(CFG|NL)80211)/' /usr/src/linux/.config

I still have an unanswerd question ... why do both interfaces need to be active? If you want them both in the default runlevel then have ifplugd or netplug manage eth0. The former can then be configured to switch interfaces when a cable is connected in the ethernet socket.

roytheman wrote:
I also noticed that in the two lines for wpa_supplicant (shown above) there has to be a space between the -D and the driver, like this "-D wired" and not like this "-Dwired". When the space is not there, my applications do not launch such as Firefox or Dolphin or a terminal. The apps give a message saying "no proticol specified - cannot open display: :0.0". That makes me think netmount is having trouble starting properly when there is no space between the -D and the driver (-Dwext). Strange, eh? Maybe that only exists on my particular system setup and nobody elses. On a command line, however, it makes no difference if a space is there or not but not so when using /etc/conf.d/net. As long as a space is there in "net", every application opens fine. I also have rc_depend_strict="NO" in rc.conf. I did not use the /etc/ifplugd/ifplugd.action that you mentioned, however.

I'm not sure what to make of your explanation, but I really don't think the issue is connected to the absence of a space. wpa_supplicant will accept '-D<driver>' or '-D <driver>', and if you look at the manpage for wpa_supplicant it uses the former notation. Anyhow, I can't see it having any relation to your "applications not launch[ing]", the error "cannot open display: :0.0" is x11 related, and I suspect some other reason, like the user who's launching the applications not being the user who started the x11 session.

roytheman wrote:
Here is the message I get during the boot-up process (POST):
Code:
Warning net.eth0 has started but it is inactive
Warning netmount is scheduled to start when net.eth0, net.wlan0 have started

This doesn't look like the output of rc to me, as it should state "WARNING" (upper case) I guess you typed this out yourself. Regardless, the "WARNING" is quite normal, it simply states that 'net.${IFACE}' has been started but its not waiting arround to inform you if this was successful or not, and so other services (ie: netmount) are scheduled to start once that network connection has been established.

roytheman wrote:
Thank you for your time

You're welcome ...

roytheman wrote:
UPDATE UPDATE: I just discovered that I can comment out EVERY LINE in /etc/conf.d/net and nothing changes - I still boot up with the wireless network working fine and can be controlled with wpa_gui and at the same time the wired network is also up and working but it does not show up in wpa_gui.

If /etc/conf.d/net is empty then openrc defaults to configuring via dhcp, with wpa_supplicant and dhcp as the default for 'wlan' interfaces if wpa_supplicant is installed. In your case 'wlan0' will be configured that way, and 'eth0' configured without IEEE 802.1X ... the interface will simply be brought up and dhcpcd run (ie: without wpa_supplicant involved). So, I'm not sure what your trying to achieve, as it seems eth0 doesn't need IEEE 802.1X at all.

best ... khay
Back to top
View user's profile Send private message
roytheman
n00b
n00b


Joined: 08 Nov 2009
Posts: 64

PostPosted: Thu Mar 14, 2013 7:57 pm    Post subject: Reply with quote

This Gentoo user (see link) has a problem similar to mine, wpa_gui has no control over the wired interface even though the wired interface is active. Wpa-gui does have control over the wireless interface. I followed the suggestion offered but when booted up, wpa-gui came up empty. In other words, I renamed one of my wpa_supplicant.conf files so each interface would have its socket in a separate directory instead of them being in the same directory in /var/run.

https://forums.gentoo.org/viewtopic-t-933516-start-0.html

I do not need both wired and wireless to be active at the same time (it would be redundant) but I would l would like to be able to disable or enable either interface using wpa_gui but the way it is I can only control the wireless, not the wired.

I think the reason I can't stop or start the wired interface with wpa_gui is because wpa_supplicant does not seem to be starting the wired interface, dhcpcd starts it instead. Since wpa_supplicant did not start the wired interface, it stands to reason it will not be able to control it either.

Code:

14-da-e9-ca-30-72 royroy # /etc/init.d/net.eth0 start
 * Bringing up interface eth0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[13169]: version 5.6.4 starting
dhcpcd[13169]: all: configured as a router, not a host
dhcpcd[13169]: eth0: rebinding lease of 192.168.0.84
dhcpcd[13169]: eth0: acknowledged 192.168.0.84 from 192.168.0.1
dhcpcd[13169]: eth0: checking for 192.168.0.84
dhcpcd[13169]: eth0: leased 192.168.0.84 for 43200 seconds
dhcpcd[13169]: forked to background, child pid 13199                      [ ok ]
 *     received address 192.168.0.84/24                                   [ ok ]
14-da-e9-ca-30-72 royroy # /etc/init.d/net.wlan0 start
 * Bringing up interface wlan0
 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]
 *   Starting wpa_cli on wlan0 ...                                        [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlan0 has started, but is inactive

Sincerely,
Roy
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Fri Mar 15, 2013 10:43 am    Post subject: Reply with quote

roytheman wrote:
This Gentoo user (see link) has a problem similar to mine, wpa_gui has no control over the wired interface even though the wired interface is active. Wpa-gui does have control over the wireless interface. I followed the suggestion offered but when booted up, wpa-gui came up empty. In other words, I renamed one of my wpa_supplicant.conf files so each interface would have its socket in a separate directory instead of them being in the same directory in /var/run. link
.
roytheman ... the issue with the above linked user, and if you haven't changed your configuration, yourself, is that they are using '-D wired' and not '-Dwired' ... the wpa_supplicant.sh used by openrc expects the latter.

/lib/rc/net/wpa_supplicant.sh
Code:
eval opts=\$wpa_supplicant_${IFVAR}
    eval cliopts=\$wpa_cli_${IFVAR}
    [ -z "${cliopts}" ] && cliopts=${wpa_cli}
    case " ${opts} " in
        *" -Dwired "*) wireless=false;;
        *) _is_wireless || return 0;;
    esac

So, '-D wired' doesn't match the expression and so 'wireless=true' and not 'wireless=false'. Not sure to what extent this will effect wpa_gui as I'm still not sure it'll find both control interfaces as again, to quote from the manpage it "choose[s] the first interface found with a control socket in the socket path".

Again, I don't use wpa_gui so I have no idea how this might be avoided, it would seem that '-g global ctrl_interface' may be used for this purpose.

roytheman wrote:
I do not need both wired and wireless to be active at the same time (it would be redundant) but I would l would like to be able to disable or enable either interface using wpa_gui but the way it is I can only control the wireless, not the wired.

I think your perhaps going about this the wrong way, if you want to switch to eth0 when its available then use something like ifplugd to do this. You would then set modules_eth0="plug" in /etc/conf.d/net and use something similar to the following in /etc/ifplugd/ifplugd.action:

Code:
case "$2" in
    up)
   if [ "${INITNG}" = "yes" ]
   then
       ARGS="-u net/$1"
   else
       /etc/init.d/net.wlan0 --quiet stop
       ARGS="--quiet start"
   fi
   ;;
    down)
   if [ "${INITNG}" = "yes" ]
   then
       ARGS="-d net/$1"
   else
       ARGS="--quiet stop"
       /etc/init.d/net.wlan0 --quiet start
   fi
   ;;

I'd assumed at the begining that you were using wpa_supplicant to manage eth0 because you needed IEEE 802.1X but I don't think this is the case from the information gleened from the above. So, all the wpa_gui can provide for eth0 is an on/off button, and it would be far simpler to use 'plug' on the interface and have an 'action' that does all thats necessary to enable eth0 and disable wlan0.

roytheman wrote:
I think the reason I can't stop or start the wired interface with wpa_gui is because wpa_supplicant does not seem to be starting the wired interface, dhcpcd starts it instead. Since wpa_supplicant did not start the wired interface, it stands to reason it will not be able to control it either.

Its not that dhcpcd starts it, but dhcpcd is run on it to meet a criteria, but the reason for this is most likely 'wireless=false' is not triggered for '-D wired' and so the script doesn't trigger wpa_supplicant to manage the interface, but anyhow, again I'm not sure this is the best way to go about it.

best ... khay
Back to top
View user's profile Send private message
roytheman
n00b
n00b


Joined: 08 Nov 2009
Posts: 64

PostPosted: Tue Apr 01, 2014 9:54 pm    Post subject: Reply with quote

Hello again Gentoo forum,

It's been a while since I submitted this original post but I did finally figure out how to stop dhcpcd from starting at boot. I had to comment out the last line in /etc/conf.d/netmount where it says rc_need="net" . Then no network service is started at boot.

But I never could get wpa_gui to disconnect either a wired interface or a wireless interface. It can only start them, and even then, it will not start dhcpcd, which is needed to get an ip address, unless you include it in a bash script, shown below.

The man pages for wpa_gui says:

Code:

wpa_gui  supports (almost) all of the interactive status and configura-
       tion features of the command line client, wpa_cli. Refer to the wpa_cli
       manpage for a comprehensive list of the interactive mode features.


The word "almost" is the key to my problem, meaning it apparently will not disconnect an interface even when you click on "disconnect" on the gui. Below is the bash script I mentioned that I use to start wpa_gui:

Code:

#!/bin/sh

sudo /usr/sbin/wpa_supplicant  \
-i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf -B -D wext  -N  \
 -i eth0 -c /etc/wpa_supplicant/wpa_supplicant-eth0.conf -B -D wired
 sleep 3
sudo dhcpcd

sudo /usr/bin/wpa_gui

 


If I am wrong, please let me know.

All the best,
Roy
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Tue Apr 01, 2014 10:46 pm    Post subject: Reply with quote

roytheman wrote:
It's been a while since I submitted this original post but I did finally figure out how to stop dhcpcd from starting at boot. I had to comment out the last line in /etc/conf.d/netmount where it says rc_need="net" . Then no network service is started at boot.

roytheman ... 'netmount' obviously 'need[s] net' as how else would a filesystem be mounted accross the network. Anyhow, the solution is not to edit the rc script but to remove it from the runlevel ...

Code:
# rc-update del netmount default

roytheman wrote:
But I never could get wpa_gui to disconnect either a wired interface or a wireless interface. It can only start them, and even then, it will not start dhcpcd, which is needed to get an ip address, unless you include it in a bash script, shown below.

As I understand it wpa_gui uses the first ctrl_interface, so, as I suggested above you probabaly need to use a '-g global ctrl_interface' so that both -Dwired and -Dnl80211/-Dwext can be controled.

roytheman wrote:
The man pages for wpa_gui says:
Code:
wpa_gui  supports (almost) all of the interactive status and configuration features of the command line client, wpa_cli. Refer to the wpa_cli manpage for a comprehensive list of the interactive mode features.

The word "almost" is the key to my problem, meaning it apparently will not disconnect an interface even when you click on "disconnect" on the gui.

No, you're misunderstaning what is stated, "(almost) all of the interactive status and configuration features of the command line client, wpa_cli" means those used to configure the "interface", it doesn't say it'll detect if there are more than one ctrl_interface and have wpa_gui use both, for this you will require a "global" ctrl_interface.

roytheman wrote:
Below is the bash script I mentioned that I use to start wpa_gui:
Code:
#!/bin/sh

sudo /usr/sbin/wpa_supplicant  \
-i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant-wlan0.conf -B -D wext  -N  \
 -i eth0 -c /etc/wpa_supplicant/wpa_supplicant-eth0.conf -B -D wired
 sleep 3
sudo dhcpcd
sudo /usr/bin/wpa_gui

As I stated above, you should not be using a script to do networking, gentoo provides this in the form of netifrc (previously the networking code of openrc). Also, you shouldn't be running wpa_gui as root, its unnecessary as your user can use it as long as the user is in a group defined by wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf
Code:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

Also, its still unclear why both networks are needed, you can simply toggle between them with the use of ifplugged (see above).

best ... khay
Back to top
View user's profile Send private message
roytheman
n00b
n00b


Joined: 08 Nov 2009
Posts: 64

PostPosted: Thu Apr 03, 2014 2:54 pm    Post subject: Reply with quote

Hello khay,

Thanks again for your time and expertise.

I took your advice and used the global control interface method (see bash script below) and it seems to be getting me closer to what I want but wpa_gui still is practically useless as far as controlling the wired interface goes. The script will indeed get me online with both interfaces. It will not stop eth0 (wired) when I click on "disconnect" even though the gui shows it was disconnected. With the wireless interface down, I can still ping an ip address in a terminal even when the wired interface is supposedly down according to wpa_gui. Again, wpa_gui works fine with the wireless interface (stops it and starts it), but not the wired interface. When I start and disconnect the wired interface, I get a log message saying:

Code:

Asssociated with 01:80:c2:00:00:03
ctrl_event-connected - connection to 01:80:c2:00:00:03 completed [idd=0 id_str=]
ctrl_event-disconnected bssd=01:80:c2:00:00:03 reason=3 locally_generated=1


But I can still ping an ip address in a terminal when wpa_gui supposedly has eth0 disabled. And the wireless interface is already down so it can't be from that.

I am suspecting that dhcpcp has me online through another method as well as by using wpa_gui so if that is the case, naturally I will still get a ping when I stop the wired interface in wpa_gui. If that is the case, I need to figure out what else has me online besides wpa_gui. For example, I can get online with the wired interface if I run /etc/init.d/net.eth0. I can get online wirelessly by running /etc/init.d/net.wlp2s0 as well. But those two methods are not active. And lastly, I can also get online wirelessly by running /etc/init.d/wpa_supplicant but that is not active either. I'm sure those three methods of getting online are not active when I test out wpa_gui because they are not in any of the runlevels and further proof of that is that I can not get online at all when I first boot up since I disabled netmount from activating any networks upon boot-up as I mentioned earlier.

If I run the command "wpa_cli -ieth0 status" and "wpa_cli -iwlp2s0 status" after I disconnect both interfaces with wpa_gui it gives this message:

Code:

wpa_cli -ieth0 status
wpa_state=DISCONNECTED
ip_address=192.168.0.83
address=14:da:e9:ca:30:72


wpa_cli -iwlp2s0 status
wpa_state=DISCONNECTED
address=50:46:5d:a5:74:02



So it looks like wpa_gui is truly disconnecting the wired interface but something else is keeping me online and I can't for the life of me figure out what it is.



Using the global control method, both sockets for each interface are in the same folder, /var/run/wpa_supplicant, which is where they need to be in order for wpa_gui to see them. Otherwise, the fields will be empty in wpa_gui if the sockets are not there, even back when I used the old methods mentioned earlier in this post.

Below is my script for starting the global control interfaces along with starting dhcpcd and wpa_gui:

Code:

#!/bin/bash

sudo killall /sbin/dhcpcd
sudo killall /usr/sbin/wpa_supplicant

sudo wpa_supplicant -g/var/run/wpa_supplicant-global -B




sudo wpa_cli -g/var/run/wpa_supplicant-global interface_add wlp2s0 \
   "" wext /var/run/wpa_supplicant
   
sudo wpa_cli -iwlp2s0 add_network
sudo wpa_cli -iwlp2s0 set_network 0 ssid '"Verizon-ssid"'
sudo wpa_cli -iwlp2s0 set_network 0 key_mgmt WPA-PSK
sudo wpa_cli -iwlp2s0 set_network 0 psk '"my-password"'
sudo wpa_cli -iwlp2s0 set_network 0 pairwise TKIP CCMP
sudo wpa_cli -iwlp2s0 set_network 0 group TKIP CCMP
sudo wpa_cli -iwlp2s0 set_network 0 proto WPA2
sudo wpa_cli -iwlp2s0 enable_network 0


   
sudo wpa_cli -g/var/run/wpa_supplicant-global interface_add eth0 \
   "" wired /var/run/wpa_supplicant

sudo wpa_cli -ieth0 add_network
sudo wpa_cli -ieth0 set_network 0 ssid '"wired-baby"'
sudo wpa_cli -ieth0 set_network 0 key_mgmt NONE
sudo wpa_cli -ieth0 enable_network 0


sleep 3

sudo /sbin/dhcpcd   eth0 wlp2s0

sudo wpa_gui &



I got the above information from the docs in /usr/share/wpa_supplicant.

I also have to run wpa_gui as root for it to work when using the global control method, which is not a big problem right now.

I have also tried different parameters for dhcpcd such as -b, -k, and -n with no avail. And I can't see any relevant information in the log files.

I do not need both interfaces to be active at the same time but I would like to be able to control each one of them using wpa_gui. So far, the only way I can control each interface is either on the command line or by the use of bash scripts.

I am just about ready to call wpa_gui a lost cause. Maybe it is not designed to control a wired interface.

If I am missing something, please let me know.

Regards,
Roy
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1545

PostPosted: Thu Apr 03, 2014 10:37 pm    Post subject: Reply with quote

roytheman wrote:
Thanks again for your time and expertise.

roy ... again, you're welcome ...

I've re-read the entire thread and I have two comments to make, 1). I really think you're going about this the wrong way, and 2). there are suggestions above that I think will provide what you're looking for, but you need to pay closer attention to the information I provide ... and questions asked.

It seems all you really need is a means to switch networks, there is no 802.1x authentication involved (which is what wpa_supplicant really does, its not really a network management tool), and both interfaces do not need to be active at the same time. You seem to be stuck on the idea that wpa_gui is the tool for this, and I really don't think it is. Similarly, your use of a script to manage this is really unnecessary, right now its getting in the way (see bellow). So, please give some serious consideration to the following ...

roytheman wrote:
I took your advice and used the global control interface method (see bash script below) and it seems to be getting me closer to what I want but wpa_gui still is practically useless as far as controlling the wired interface goes. The script will indeed get me online with both interfaces. It will not stop eth0 (wired) when I click on "disconnect" even though the gui shows it was disconnected. With the wireless interface down, I can still ping an ip address in a terminal even when the wired interface is supposedly down according to wpa_gui. Again, wpa_gui works fine with the wireless interface (stops it and starts it), but not the wired interface.

Yes, because you're using a script and not the networking provided by net-misc/netifrc. In your script you start dhcpcd and as wpa_supplicant is not doing anything other than authentication dhcpcd is not informed to do anything as and when you select "disconnect" in wpa_gui. As far as dhcpcd is concerned the interface is active. All wpa_supplicant is doing (or, in fact. not doing) in this arrangement is 802.1x authentication it is dhcpcd which is "managing" the connection.

You're thinking of wpa_gui/wpa_supplicant as a manager, when it isn't really, it merely establishes the "supplication" part of the equation (the authentication and, in the case of WPA, link layer encryption). The idea of wpa_supplicant is that other network management requirements can be provided by other tools. As an example, this is what /etc/wpa_supplicant/wpa_cli.sh does in terms of wpa_cli connecting, disconnecting, etc ....

Code:
EXEC="/etc/init.d/net.${INTERFACE} --quiet"
[...]
case ${ACTION} in
  CONNECTED)
    EXEC="${EXEC} start"
    ;;
  DISCONNECTED)
    # Deactivated, since stopping /etc/init.d/net.wlanX
    # stops the network completly.
    EXEC="false ${EXEC} stop"
    ;;
[...]

... what this does is provide a basic script run by wpa_cli that on receiving 'CONNECTED' or 'DISCONNECTED' starts and stops net.{IFACE} (and so dhcpcd, or whatever else is configured via netifrc). In your case this doesn't happen because the relation between wpa_supplicant and dhcpcd isn't there. I'm providing this simply to show you what happens when wpa_supplicant is run via /etc/init.d/net.${IFACE) and to show how your use of wpa_supplicant, specifically wpa_supplicant/dhcpcd via a script, is not the best approach to your problem.

roytheman wrote:
[...] I can still ping an ip address in a terminal when wpa_gui supposedly has eth0 disabled. And the wireless interface is already down so it can't be from that.

Yes, for reasons explained above, dhcpcd is still active and it is dhcpcd which is managing the actual connection not wpa_supplicant.

roytheman wrote:
If I run the command "wpa_cli -ieth0 status" and "wpa_cli -iwlp2s0 status" after I disconnect both interfaces with wpa_gui it gives this message:

Code:
wpa_cli -ieth0 status
wpa_state=DISCONNECTED
ip_address=192.168.0.83
address=14:da:e9:ca:30:72

wpa_cli -iwlp2s0 status
wpa_state=DISCONNECTED
address=50:46:5d:a5:74:02

This is perfectly consistent with what wpa_supplicant does, its a "Wi-Fi Protected Access client and IEEE 802.1X supplicant" not a network manager. On eth0 it actually isn't doing anything because your not authenticating via 802.1x (at least that is what your above wpa_supplicant.conf leads me to believe). So, that said, it may in fact be possible to have wpa_gui provide an interface where you can enable/disable the network (I don't know because I haven't tried), but really you probably don't need it in the way that you think as there are better ways to approach this (ie, via ifplugd). If you really must have wpa_gui do this then I strongly suggest you use netifrc and not the script you provided above.

roytheman wrote:
So it looks like wpa_gui is truly disconnecting the wired interface but something else is keeping me online and I can't for the life of me figure out what it is.

No, actually it isn't "disconnecting" you in the way you think. As no 802.1x is in use wpa_supplicant hardly enters the equation, its dhcpcd that's actually providing the basic aspects of the network connection (making the interface active and requesting a lease).

roytheman wrote:
I am just about ready to call wpa_gui a lost cause. Maybe it is not designed to control a wired interface.

As in the wpa_cli.sh excerpt above wpa_supplicant is perfectly capable of managing interfaces, but its not really what its designed to do (again, its a wpa client and 802.1x supplicant).

So, give it some thought, I'd probably not use wpa_gui for eth0 at all, you can 'plug' eth0 and have it activated when a cable is connected and at the same time iwlp2s0 is brought down by this action. Similarly, when activating via wpa_gui eth0 is brought down ... or something of that nature. If you want to keep on with wpa_gui and using it to switch then that I can also probably help you figure out exactly how to configure netifrc to do this (with the proviso that I'm not entirely certain of the outcome ... but it should be doable). Again, give it some thought as right now I think your approaching the problem in the wrong way ... once you have some idea of what it is that is actually needed I'll provide some idea of how to go about it.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum