View previous topic :: View next topic |
Author |
Message |
oisch Tux's lil' helper
Joined: 17 Jul 2002 Posts: 130
|
Posted: Wed Jun 23, 2004 4:12 pm Post subject: |
|
|
Hi
Great work. This script really saves me a lot of work.
Nevertheless I would need some sort of post-associate function where I can run my own script (a vpn client in this case).
Is something like this possible? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Wed Jun 23, 2004 5:02 pm Post subject: |
|
|
oisch wrote: | Hi
Great work. This script really saves me a lot of work.
Nevertheless I would need some sort of post-associate function where I can run my own script (a vpn client in this case).
Is something like this possible? |
Doesn't the VPN client need to be run after the network is brought up? If so, then my wireless script can do nothing about that.
There's a postup() and postdown() functions that you can build into /etc/conf.d/net that the net.eth0 script will use.
Do you want to launch the VPN depending on which ESSID you connect to? _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
sog Guru
Joined: 04 Apr 2004 Posts: 356
|
Posted: Wed Jun 23, 2004 5:54 pm Post subject: |
|
|
I know this is going to be something ridiculous, but after some false starts, a few issues here and there, i got the script to run - i think.
basically, the process i followed was as follows:
1. setting up net.eth1 (which is what iwconfig told me my wirless was) as specified in the Gentoo networking docs
2. following install instructions in first post
3. following install instructions in ebuild
so my situation now is that the following: /etc/init.d/net.eth1 start
returns me this:
Code: | * Running preup function
* Configuring wireless network for eth1
* Scanning for access points
* eth1 does not support scanning
* No preferred access points found
* Trying to force preferred incase they are hidden
* Connecting to "sog" (WEP enabled)... [ ok ] * eth1 connected to "sog" in managed mode
* on channel 10 (WEP enabled)
* Bringing eth1 up via DHCP...
|
the DHCP bit gets a !!, so i hardcoded in an IP and it didn't make any difference.
so in Gnome, the Wireless Link Monitor 2.6 applet shows me as connected, 100% signal strength, but the connection doesn't work. nothing returns. gentoo.org not found, etc. pings fail, etc.
so i've been through most of the posts here, and have figured a few things out, but i'm a bit at a loss here.
anybody have any thoughts? help much appreciated. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Wed Jun 23, 2004 6:35 pm Post subject: |
|
|
I would guess that your WEP key is wrong.
To verify, disable WEP on your Gentoo and the AP and try again. If it works, then WEP is your problem and try configuring it again.
things to try
key_sog="s:key enc open"
key_sog="open s:key"
key_sog="s:key enc restricted"
key_sog="restricted s:key"
And try all the above with your key in HEX
It's also important to note that this does not support keys generated from a passphrase _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
sog Guru
Joined: 04 Apr 2004 Posts: 356
|
Posted: Wed Jun 23, 2004 7:54 pm Post subject: |
|
|
thx for the feedback UberLord. did as requested - shut off encryption (which was only 64 bit, FYI) on the AP - then #'d the key in my wirless file, but on a net.eth1 restart i now get the following:
Code: |
* Running preup function
* Configuring wireless network for eth1
* eth1 does not support setting the mode to "managed"
* Scanning for access points
SIOCSIFFLAGS: Device or resource busy
* eth1 does not support scanning
* No preferred access points found
* Trying to force preferred incase they are hidden
* eth1 does not support setting ESSID to "sog"
* Connecting to "sog" (WEP disabled)... [ ok ] * eth1 connected to "" in mode
* on channel (WEP disabled)
* Bringing eth1 up (192.168.0.5)...
SIOCSIFFLAGS: Device or resource busy |
tried rebooting the AP, got the same thing.
anything else to try? |
|
Back to top |
|
|
xJoni n00b
Joined: 18 May 2004 Posts: 20
|
Posted: Thu Jun 24, 2004 1:15 am Post subject: |
|
|
hi,
realy great script - good work, but i also need to run a script after the netup (dhcp) depending on essid (also vpn client). |
|
Back to top |
|
|
mlybarger Guru
Joined: 04 Sep 2002 Posts: 480
|
Posted: Thu Jun 24, 2004 3:05 am Post subject: |
|
|
UberLord wrote: |
things to try
key_sog="s:key enc open"
key_sog="open s:key"
key_sog="s:key enc restricted"
key_sog="restricted s:key"
And try all the above with your key in HEX
|
holy smokes batman! after getting all flustered, i saw this and gave each one a shot. for me, only the 2nd one worked ok (without the "s:" in there, just "open 1234-5678-90" using my specific hash key. i also have been trying keys that were generated by passphrase, but i can't imagine how that would mess things up. a key is a key, right?
anyway. i'm _VERY_ happy for now at least to have encryptoin turned on!!.it even worked through a reboot, which i'm not sure i've had happen yet with encryption. there seems to be a lot of complicated stuff going on with the config file and the settings. how does this handle my roaming to a new hotspot? say i go to the mall which has an open hotspot (no encryption, just connect). do i need to put the ESSID for that location into this config file for it to work? |
|
Back to top |
|
|
oisch Tux's lil' helper
Joined: 17 Jul 2002 Posts: 130
|
Posted: Thu Jun 24, 2004 7:47 am Post subject: |
|
|
Quote: | Doesn't the VPN client need to be run after the network is brought up? If so, then my wireless script can do nothing about that.
There's a postup() and postdown() functions that you can build into /etc/conf.d/net that the net.eth0 script will use. |
Yes, the vpnc needs a network connection. I followed your reccomendation and wrote this short postup() function (stole some stuff from your script as I'm not really in shell scripting )
It works wuite well. Thanks again for your help.
Code: | postup() {
if [ "${IFACE}" = "eth1" ]; then
IWGETID=`which iwgetid 2>${devnull}`
essid=`${IWGETID} -s ${IFACE}`
if [ "unifunk1" = "${essid}" ]; then
/usr/bin/vpnc-connect &>/dev/null
fi
fi
} |
To stop the vpn client I modified the postdown() function
Code: | predown() {
if [ "${IFACE}" = "eth1" ]; then
if [ "unifunk1" = "${essid}" ]; then
killall vpnc &>/dev/null
fi
fi
wireless_down ${1}
return $?
} |
|
|
Back to top |
|
|
markfl Apprentice
Joined: 10 Apr 2003 Posts: 240 Location: Kent, UK
|
Posted: Thu Jun 24, 2004 8:41 am Post subject: |
|
|
mark_lybarger wrote: | say i go to the mall which has an open hotspot (no encryption, just connect). do i need to put the ESSID for that location into this config file for it to work? |
It worked for me in my local Costa
Comes up with all the local networks, (two encrypted, one open) and it connects to the one without WEP
Mark _________________ Life it seems, will fade away
Drifting further every day |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jun 24, 2004 9:16 am Post subject: |
|
|
sog wrote: | thx for the feedback UberLord. did as requested - shut off encryption (which was only 64 bit, FYI) on the AP - then #'d the key in my wirless file, but on a net.eth1 restart i now get the following:
Code: |
* Running preup function
* Configuring wireless network for eth1
* eth1 does not support setting the mode to "managed"
* Scanning for access points
SIOCSIFFLAGS: Device or resource busy
* eth1 does not support scanning
* No preferred access points found
* Trying to force preferred incase they are hidden
* eth1 does not support setting ESSID to "sog"
* Connecting to "sog" (WEP disabled)... [ ok ] * eth1 connected to "" in mode
* on channel (WEP disabled)
* Bringing eth1 up (192.168.0.5)...
SIOCSIFFLAGS: Device or resource busy |
tried rebooting the AP, got the same thing.
anything else to try? |
Looks like a hardware/kernel problem. Try rebooting.
Code: | eth1 does not support setting the mode to "managed" |
That line worries me as you did not get it before.... _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jun 24, 2004 9:26 am Post subject: |
|
|
oisch wrote: | I followed your reccomendation and wrote this short postup() function (stole some stuff from your script as I'm not really in shell scripting )
It works wuite well. Thanks again for your help.
|
No problem - here's a small aleration.
Code: | postup() {
local IFACE=${1}
local IWGETID=`which iwgetid 2>${devnull}`
local essid=`${IWGETID} -s ${IFACE}`
if [ "unifunk1" == "${essid}" ]; then
/usr/bin/vpnc-connect &>/dev/null
fi
}
predown() {
local IFACE=${1}
local IWGETID=`which iwgetid 2>${devnull}`
local essid=`${IWGETID} -s ${IFACE}`
if [ "unifunk1" == "${essid}" ]; then
killall vpnc &>/dev/null
fi
wireless_down ${1}
return $?
} |
The "local" directive means that IWGETID and essid won't overwrite any extnernal vars - not that it really matters here, but it's "Good Practice"
Also = means "assign" and == means "test equal"
Also, you cannot "guarantee" (well, actual you can, but it may change in the future) that the wireless interface is always eth1, so why not just test essid against the current IFACE?
EDIT: Had a superfluos "fi" in the code. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Last edited by UberLord on Fri Jun 25, 2004 3:35 pm; edited 1 time in total |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
sog Guru
Joined: 04 Apr 2004 Posts: 356
|
Posted: Thu Jun 24, 2004 1:39 pm Post subject: |
|
|
Quote: |
Looks like a hardware/kernel problem. Try rebooting.
|
done - fixed the "SIOCSIFFLAGS" issue. i now get the following:
Code: | /etc/init.d/net.eth1 restart
* Unmounting network filesystems... [ ok ] * Running predown function
* Removing wireless configuration from eth1... [ ok ] * Bringing eth1 down... [ ok ] * Running preup function
* Configuring wireless network for eth1
* Scanning for access points
* eth1 does not support scanning
* No preferred access points found
* Trying to force preferred incase they are hidden
* Connecting to "sog" (WEP disabled)... [ ok ] * eth1 connected to "sog" in managed mode
* on channel 10 (WEP disabled)
|
still no joy as far as access. if it helps, here's the only uncommented line in my wireless file:
Code: |
preferred_aps=("sog")
|
sorry for all the bother, but i'd obviously love to get wireless working in the machine, particularly since it's my travel laptop.
any and all help appreciated. |
|
Back to top |
|
|
cookiez n00b
Joined: 29 Mar 2004 Posts: 34
|
Posted: Fri Jun 25, 2004 5:20 am Post subject: |
|
|
My access point has 4 different keys defined and my I set the third one as the default one. When I was setting up wireless for my Pocket PC, I had to tell it that the key I am giving it is key number 3, otherwise it did not connect. Likewise, when I edit /etc/conf.d/wireless and tell it to use the third key, I could not get an IP address or talk to the network. However, when I set the first key in my access point to be default and gave /etc/conf.d/wireless the hex value of that key, everything worked. Is there a way to specify what key number the key is in /etc/conf.d/wireless? Thanks. _________________ Weeks of coding saves hours of planning. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Fri Jun 25, 2004 9:24 am Post subject: |
|
|
cookiez wrote: | My access point has 4 different keys defined and my I set the third one as the default one. When I was setting up wireless for my Pocket PC, I had to tell it that the key I am giving it is key number 3, otherwise it did not connect. Likewise, when I edit /etc/conf.d/wireless and tell it to use the third key, I could not get an IP address or talk to the network. However, when I set the first key in my access point to be default and gave /etc/conf.d/wireless the hex value of that key, everything worked. Is there a way to specify what key number the key is in /etc/conf.d/wireless? Thanks. |
Well the key_ESSID="foo bar" just maps to Code: | iwconfig ${IFACE} key foo bar | so provided you can do it with one iwconfig command then you should be able to do this
the below should work
Code: |
key_ESSID="s:key1 key s:key2 key s:key3 key s:key4 key [3]" |
_________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
Helena Veteran
Joined: 02 Apr 2003 Posts: 1114 Location: Den Dolder, The Netherlands
|
Posted: Fri Jun 25, 2004 9:54 pm Post subject: Poweroff? |
|
|
I noticed a problem when I recently upgraded my kernel-sources from 2.6.5 to 2.6.7 (gentoo-dev-sources). It could also be that I messed up something else since I fooled around quite a bit.
Anyway, after a lot of experimentation I discovered that my wireless network card refuses to start whenever the power to the card is on at boot time. This apparently results in a number of Yenta driver complaints about an IRQ not taken care of, and the net.wlan0 service will not start. However, if the power is off at boot, Yenta just smiles at me as does the net.wlan0 service and I'm up and running.
Anyone seen similar behaviour?
What's more, is there an explanation or even a solution? |
|
Back to top |
|
|
sog Guru
Joined: 04 Apr 2004 Posts: 356
|
Posted: Fri Jun 25, 2004 10:13 pm Post subject: |
|
|
Quote: | Well, according to your output wireless is working.
Are not getting a DHCP address? Are you not able to ping the AP? What?
C'mon - throw me bone here! |
haha - sorry, fair enough.
ok, it goes like this. you're correct, according to the output, wireless is working. the little Gnome Wireless Link Monitor applet says the same thing - 100% signal. and it's not just DHCP - that's giving me a few problems, but i bypassed that and hard coded in an IP (which the AP - Netgear FM114P - lets me do).
and i CAN ping the gateway. but that's it. nothing external works. ping, browser, etc. everything comes back bad.
any further thoughts? a free gmail account to whoever solves this for me and to UberLord either way for writing the script (let me know if you want one, UL). |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Fri Jun 25, 2004 10:46 pm Post subject: Re: Poweroff? |
|
|
Helena wrote: | I noticed a problem when I recently upgraded my kernel-sources from 2.6.5 to 2.6.7 (gentoo-dev-sources). It could also be that I messed up something else since I fooled around quite a bit.
Anyway, after a lot of experimentation I discovered that my wireless network card refuses to start whenever the power to the card is on at boot time. This apparently results in a number of Yenta driver complaints about an IRQ not taken care of, and the net.wlan0 service will not start. However, if the power is off at boot, Yenta just smiles at me as does the net.wlan0 service and I'm up and running.
Anyone seen similar behaviour?
What's more, is there an explanation or even a solution? |
Well, with my lappy using 2.6.6 and 2.6.7 sources with my Draytek Vigor 540 (prism54) card, it does not get started at boot even by pcmcia-cs. So I have to add net.eth1 to the default runlevel - no biggie but it works.
My old SMC (prism) card didn't have this problem. It may be something todo with the uploadind of firmware. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Fri Jun 25, 2004 10:47 pm Post subject: |
|
|
sog wrote: |
haha - sorry, fair enough.
ok, it goes like this. you're correct, according to the output, wireless is working. the little Gnome Wireless Link Monitor applet says the same thing - 100% signal. and it's not just DHCP - that's giving me a few problems, but i bypassed that and hard coded in an IP (which the AP - Netgear FM114P - lets me do).
and i CAN ping the gateway. but that's it. nothing external works. ping, browser, etc. everything comes back bad.
any further thoughts? a free gmail account to whoever solves this for me and to UberLord either way for writing the script (let me know if you want one, UL). |
Sounds like you don't have a valid gateway set.
Check the output of the "route" command and check the default gateway is your gateway IP. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
Eagle_ Tux's lil' helper
Joined: 19 Jun 2004 Posts: 119
|
Posted: Sat Jun 26, 2004 12:24 am Post subject: Wireless T41 |
|
|
Hi,
I am new at Gentoo, i am trying to make my wireless working at my laptop T41 (WiFi card). I done what UberLord where discrabing (what i understood from it).
I already had enable the two opption in the kernel, in my module list i have Quote: | ath_pci 37860 0
wlan 56232 1 ath_pci
ath_hal 128336 1 ath_pci
|
i also done Quote: | ln -sf /etc/init.d/net.eth0 /etc/init.d/net.ath0 |
in my /etc/conf.d/net, i had only iface_eth0="dhcp" and i added also iface_ath0="dhcp"
i dont know how to change my wireless file (what to add if i need anything)
when i type ifconfig i only get eth0 and lo.
when i type rc-update add ath0 defualt i recieve:
Quote: | * /sbin/rc-update: /etc/init.d/ath0 not found; aborting. |
if someone have any suggestion i would be more then happy
Eagle |
|
Back to top |
|
|
ryceck Apprentice
Joined: 13 Jan 2004 Posts: 195
|
Posted: Sat Jun 26, 2004 8:44 am Post subject: Re: Wireless T41 |
|
|
Are u sure u have the right driver for ur wifi card?
What does "iwconfig ath0" say?
One more thing to do for u btw: Code: |
cp /etc/init.d/net.eth0 /etc/init.d/net.ath0
|
Then u can add net.ath0 to ur default runlevel |
|
Back to top |
|
|
markfl Apprentice
Joined: 10 Apr 2003 Posts: 240 Location: Kent, UK
|
Posted: Sat Jun 26, 2004 9:31 am Post subject: |
|
|
Sorry, but don't do the cp above, its better if you symlink them so that an update will catch both.
Mark _________________ Life it seems, will fade away
Drifting further every day |
|
Back to top |
|
|
int2str Guru
Joined: 29 Sep 2003 Posts: 362
|
|
Back to top |
|
|
Eagle_ Tux's lil' helper
Joined: 19 Jun 2004 Posts: 119
|
Posted: Sat Jun 26, 2004 12:51 pm Post subject: |
|
|
Hi,
This is my output for lspci:
Quote: | 0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]
0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:00.1 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:01.0 Ethernet controller: Intel Corp. 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)
0000:02:02.0 Network controller: Intel Corp. PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)
|
is there avekabel drivers for my wireless card?
P.S
like you saw i dane ln -s ... not cp |
|
Back to top |
|
|
|