Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Thu, 29 Mar 2007 22:20:21 -0700, Daevid Vincent wrote: > Please tell me there is some way to tweak my /etc/conf.d/wireless (or > anything for that matter), so that I can tell it, "hey, when connecting > to 'MATRIX', always use 802.11b and/or a certain channel range > (presumably in the 'b' range)". You can do this globally for the interface, with channel_ath0. You could probably use the preassociate() function to do it on a per-essid basis. See wireless.example. > Furthermore, it would REALLY be great if I could do something whereby, > if I have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, else > try net.ath0. Right now I have net.ath0 disabled by default because I > hate when it starts up when I'm plugged in at work, as my traffic seems > to go over the "slower" ath0 rather than the faster eth0 port. ?! I > have ifplugd installed, but I don't think it can manage this kind of > (seemingly obvious and intelligent) decision. ifplugd's task is to signal when eth0's cable is connected or disconnected, not make decisions about other interfaces for you. Use the pre-up function in /etc/conf.d/net. preup() { if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status then return 1 fi } This will prevent ath0 starting if eth0 is connected. -- Neil Bothwick Is that "woof" feed me; "woof" walk me; "woof" there's a burglar? What?? signature.asc Description: PGP signature
Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Friday 30 March 2007 1:11 am, Neil Bothwick wrote: > On Thu, 29 Mar 2007 22:20:21 -0700, Daevid Vincent wrote: > > > Please tell me there is some way to tweak my /etc/conf.d/wireless (or > > anything for that matter), so that I can tell it, "hey, when connecting > > to 'MATRIX', always use 802.11b and/or a certain channel range > > (presumably in the 'b' range)". > > You can do this globally for the interface, with channel_ath0. You could > probably use the preassociate() function to do it on a per-essid basis. > See wireless.example. > > > Furthermore, it would REALLY be great if I could do something whereby, > > if I have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, else > > try net.ath0. Right now I have net.ath0 disabled by default because I > > hate when it starts up when I'm plugged in at work, as my traffic seems > > to go over the "slower" ath0 rather than the faster eth0 port. ?! I > > have ifplugd installed, but I don't think it can manage this kind of > > (seemingly obvious and intelligent) decision. > > ifplugd's task is to signal when eth0's cable is connected or > disconnected, not make decisions about other interfaces for you. > > Use the pre-up function in /etc/conf.d/net. > > preup() { > if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status > then > return 1 > fi > } > > This will prevent ath0 starting if eth0 is connected. Thanks Neil for the help, unfortunately it didn't seem to work for me... locutus conf.d # /etc/init.d/net.ath0 start * Starting ath0 * Running preup function /etc/conf.d/net: line 10: if: command not found /etc/conf.d/net: line 11: then: command not found /etc/conf.d/net: line 12: return: command not found /etc/conf.d/net: line 13: fi: command not found * preup ath0 failed [ !! ] locutus conf.d # cat /etc/conf.d/net # This blank configuration will automatically use DHCP for any net.* # scripts in /etc/init.d. To create a more complete configuration, # please review /etc/conf.d/net.example and save your configuration # in /etc/conf.d/net (this file :]!). dhcpcd_eth0="-t 10" dhcpcd_ath0="-t 30" dhcpcd_wlan0="-t 20" preup() { if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status then return 1 fi } -- gentoo-user@gentoo.org mailing list
RE: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Friday 30 March 2007 1:11 am, Neil Bothwick wrote: > On Thu, 29 Mar 2007 22:20:21 -0700, Daevid Vincent wrote: > > > Please tell me there is some way to tweak my /etc/conf.d/wireless (or > > anything for that matter), so that I can tell it, "hey, when connecting > > to 'MATRIX', always use 802.11b and/or a certain channel range > > (presumably in the 'b' range)". > > You can do this globally for the interface, with channel_ath0. You could > probably use the preassociate() function to do it on a per-essid basis. > See wireless.example. > > > Furthermore, it would REALLY be great if I could do something whereby, > > if I have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, else > > try net.ath0. Right now I have net.ath0 disabled by default because I > > hate when it starts up when I'm plugged in at work, as my traffic seems > > to go over the "slower" ath0 rather than the faster eth0 port. ?! I > > have ifplugd installed, but I don't think it can manage this kind of > > (seemingly obvious and intelligent) decision. > > ifplugd's task is to signal when eth0's cable is connected or > disconnected, not make decisions about other interfaces for you. > > Use the pre-up function in /etc/conf.d/net. > > preup() { > if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status > then > return 1 > fi > } > > This will prevent ath0 starting if eth0 is connected. Thanks Neil for the help, unfortunately it didn't seem to work for me... locutus conf.d # /etc/init.d/net.ath0 start * Starting ath0 * Running preup function /etc/conf.d/net: line 10: if: command not found /etc/conf.d/net: line 11: then: command not found /etc/conf.d/net: line 12: return: command not found /etc/conf.d/net: line 13: fi: command not found * preup ath0 failed [ !! ] locutus conf.d # cat /etc/conf.d/net # This blank configuration will automatically use DHCP for any net.* # scripts in /etc/init.d. To create a more complete configuration, # please review /etc/conf.d/net.example and save your configuration # in /etc/conf.d/net (this file :]!). dhcpcd_eth0="-t 10" dhcpcd_ath0="-t 30" dhcpcd_wlan0="-t 20" preup() { if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status then return 1 fi } -- gentoo-user@gentoo.org mailing list
RE: [gentoo-user] How can I force net.ath0 to use a certain channel?
Am I the dick? http://bugs.gentoo.org/show_bug.cgi?id=172766 > -Original Message- > From: Daevid Vincent [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 29, 2007 10:20 PM > To: gentoo-user@lists.gentoo.org > Subject: [gentoo-user] How can I force net.ath0 to use a > certain channel? > > I have an atheros (mad-wifi) internal mini-pci 802.11 a/b/g > card in my Dell > i8200 notebook running Gentoo. I also have an Engenius hostap 802.11b > card/antenna in my Gentoo server. What is frustrating, is that it's a > crap-shoot when my ath0 will (or won't) start properly. I > have no control > over what channel (either numeric like 6, or alpha such as b > vs. g) to > connect to my AP ("MATRIX"). > > Please tell me there is some way to tweak my > /etc/conf.d/wireless (or anything > for that matter), so that I can tell it, "hey, when > connecting to 'MATRIX', > always use 802.11b and/or a certain channel range (presumably > in the 'b' > range)". > > Furthermore, it would REALLY be great if I could do something > whereby, if I > have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, > else try net.ath0. > Right now I have net.ath0 disabled by default because I hate > when it starts > up when I'm plugged in at work, as my traffic seems to go > over the "slower" > ath0 rather than the faster eth0 port. ?! I have ifplugd > installed, but I > don't think it can manage this kind of (seemingly obvious and > intelligent) > decision. > > locutus ~ # /etc/init.d/net.ath0 start > * Starting ath0 > * Configuring wireless network for ath0 > * ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00 > * in managed mode on channel 52 (WEP disabled) > * Configuration not set for ath0 - assuming DHCP > * Bringing up ath0 > * dhcp > * Running dhcpcd ... > Error, timed out waiting for a valid DHCP server response > > > [ !! ] > locutus ~ # /etc/init.d/net.ath0 start > * Starting ath0 > * Configuring wireless network for ath0 > * ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00 > * in managed mode on channel 7 (WEP disabled) > * Configuration not set for ath0 - assuming DHCP > * Bringing up ath0 > * dhcp > * Running dhcpcd ... > Error, timed out waiting for a valid DHCP server response > > > [ !! ] > locutus ~ # /etc/init.d/net.ath0 start > * Starting ath0 > * Configuring wireless network for ath0 > * ath0 connected to ESSID "MATRIX" at 00:02:6F:09:B2:B4 > * in managed mode on channel 6 (WEP disabled) > * Configuration not set for ath0 - assuming DHCP > * Bringing up ath0 > * dhcp > * Running dhcpcd ... > > > [ ok ] > * ath0 received address 10.10.10.69/24 > locutus ~ # > -- > gentoo-user@gentoo.org mailing list > > -- gentoo-user@gentoo.org mailing list
RE: [gentoo-user] How can I force net.ath0 to use a certain channel?
No Jakub is known for closing bugs without actually reading or understanding them; he's closed several of mine; which were legit. Well stated comments, although some of this should/could have been left on the forums. ie - breaking up a feature request, and a problem deface On Fri, 2007-03-30 at 17:24 -0700, Daevid Vincent wrote: > Am I the dick? > > http://bugs.gentoo.org/show_bug.cgi?id=172766 > > > -Original Message- > > From: Daevid Vincent [mailto:[EMAIL PROTECTED] > > Sent: Thursday, March 29, 2007 10:20 PM > > To: gentoo-user@lists.gentoo.org > > Subject: [gentoo-user] How can I force net.ath0 to use a > > certain channel? > > > > I have an atheros (mad-wifi) internal mini-pci 802.11 a/b/g > > card in my Dell > > i8200 notebook running Gentoo. I also have an Engenius hostap 802.11b > > card/antenna in my Gentoo server. What is frustrating, is that it's a > > crap-shoot when my ath0 will (or won't) start properly. I > > have no control > > over what channel (either numeric like 6, or alpha such as b > > vs. g) to > > connect to my AP ("MATRIX"). > > > > Please tell me there is some way to tweak my > > /etc/conf.d/wireless (or anything > > for that matter), so that I can tell it, "hey, when > > connecting to 'MATRIX', > > always use 802.11b and/or a certain channel range (presumably > > in the 'b' > > range)". > > > > Furthermore, it would REALLY be great if I could do something > > whereby, if I > > have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, > > else try net.ath0. > > Right now I have net.ath0 disabled by default because I hate > > when it starts > > up when I'm plugged in at work, as my traffic seems to go > > over the "slower" > > ath0 rather than the faster eth0 port. ?! I have ifplugd > > installed, but I > > don't think it can manage this kind of (seemingly obvious and > > intelligent) > > decision. > > > > locutus ~ # /etc/init.d/net.ath0 start > > * Starting ath0 > > * Configuring wireless network for ath0 > > * ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00 > > * in managed mode on channel 52 (WEP disabled) > > * Configuration not set for ath0 - assuming DHCP > > * Bringing up ath0 > > * dhcp > > * Running dhcpcd ... > > Error, timed out waiting for a valid DHCP server response > > > > > > [ !! ] > > locutus ~ # /etc/init.d/net.ath0 start > > * Starting ath0 > > * Configuring wireless network for ath0 > > * ath0 connected to ESSID "MATRIX" at 00:00:00:00:00:00 > > * in managed mode on channel 7 (WEP disabled) > > * Configuration not set for ath0 - assuming DHCP > > * Bringing up ath0 > > * dhcp > > * Running dhcpcd ... > > Error, timed out waiting for a valid DHCP server response > > > > > > [ !! ] > > locutus ~ # /etc/init.d/net.ath0 start > > * Starting ath0 > > * Configuring wireless network for ath0 > > * ath0 connected to ESSID "MATRIX" at 00:02:6F:09:B2:B4 > > * in managed mode on channel 6 (WEP disabled) > > * Configuration not set for ath0 - assuming DHCP > > * Bringing up ath0 > > * dhcp > > * Running dhcpcd ... > > > > > > [ ok ] > > * ath0 received address 10.10.10.69/24 > > locutus ~ # > > -- > > gentoo-user@gentoo.org mailing list > > > > >
Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Fri, 30 Mar 2007 17:24:01 -0700, Daevid Vincent wrote: > Am I the dick? > > http://bugs.gentoo.org/show_bug.cgi?id=172766 Jakub can be a little "terse" at times. -- Neil Bothwick The Borg assimilated my race & all I got was this T shirt. signature.asc Description: PGP signature
Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Fri, 30 Mar 2007 14:38:34 -0700, Daevid Vincent wrote: > > preup() { > > if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet > > status then > > return 1 > > fi > > } > > > > This will prevent ath0 starting if eth0 is connected. > > Thanks Neil for the help, unfortunately it didn't seem to work for me... > > locutus conf.d # /etc/init.d/net.ath0 start > * Starting ath0 > * Running preup function > /etc/conf.d/net: line 10: if: command not found > /etc/conf.d/net: line 11: then: command not found > /etc/conf.d/net: line 12: return: command not found > /etc/conf.d/net: line 13: fi: command not found > * preup ath0 failed That's got me. I use a variation of this all the time, and a postdown entry for eth0 to switch to wireless when I pull the cable. There is an error on that there should be a return 0 after the fi line, but you're not even getting that far. -- Neil Bothwick Gravity isn't easy, but it's the law. signature.asc Description: PGP signature
Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Friday 30 March 2007 22:38, Daevid Vincent wrote: > Thanks Neil for the help, unfortunately it didn't seem to work for me... > > locutus conf.d # /etc/init.d/net.ath0 start > * Starting ath0 > * Running preup function > /etc/conf.d/net: line 10: if: command not found > /etc/conf.d/net: line 11: then: command not found > /etc/conf.d/net: line 12: return: command not found > /etc/conf.d/net: line 13: fi: command not found > * preup ath0 failed > > [ !! ] What happens if you put all of Neil's suggestion into a script file, make it executable and then call this from the pre-up section of /etc/conf.d/net? -- Regards, Mick pgpEg2P4wKM2V.pgp Description: PGP signature
Re: [gentoo-user] How can I force net.ath0 to use a certain channel?
On Friday 30 March 2007 23:38:34 Daevid Vincent wrote: > Thanks Neil for the help, unfortunately it didn't seem to work for me... > > locutus conf.d # /etc/init.d/net.ath0 start > * Starting ath0 > * Running preup function > /etc/conf.d/net: line 10: if: command not found > /etc/conf.d/net: line 11: then: command not found > /etc/conf.d/net: line 12: return: command not found > /etc/conf.d/net: line 13: fi: command not found > * preup ath0 failed > > [ !! ] > locutus conf.d # cat /etc/conf.d/net [SNIP] > preup() { > if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status > then > return 1 > fi > } emerge --info ? etc-update ? What if you put `type if` and `type [` in the beginning of the preup function? Does `/etc/init.d/net.ath0 --debug start` reveal anything? `equery check bash` ? ... :) As a side note '[[ ${IFACE} == ath0 ]]' or '[ ath0 = "${IFACE}" ]' would both be better syntactically.. In practice that shouldn't matter though as runscript.sh does require bash and IFACE should never be empty... It also isn't what those error messages are complaining about. Also as a comment to Mick's suggestion. While IFACE is before preup() is called I don't think it gets exported.. -- Bo Andresen pgpocwZ7E42Ji.pgp Description: PGP signature