LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How to start wireless network at startup? (http://www.linuxquestions.org/questions/slackware-14/how-to-start-wireless-network-at-startup-449021/)

Zmyrgel 05-27-2006 07:31 AM

How to start wireless network at startup?
 
Okay, I have NETGEAR WG311v3 wireless network card in my server PCI slot and I want to enable wireless network at startup. How is this done?

I used ndiswrapper 1.14 for the drivers. I haven't found better drivers than those found on the card's CD. Newer drivers are available but only in .exe package and I didn't locate the .inf and .sys files for those newer drivers after extracting them.

Anyway I have the network working at the moment. Not sure how good connection is as I tried it with windows and with basic drivers the signal was "weak" and with newer drivers it was "excellent" so I'm trying to get the newer drivers to work somehow.


But how to enable it at startup?

Just make script
Code:

#!/bin/bash
modprobe ndiswrapper
ifconfig wlan0 up
iwconfig wlan0 essid MyNet key open s:MyKey111
dhcpcd wlan0

And add this to /etc/rc.d/rc.local or what?

I need to get this working soon as I'm moving to another coutry I can't get physical access to my server.

How to check signal quality on my server?

Nylex 05-27-2006 07:50 AM

Nope, no need to put it in rc.local. Edit your rc.inet1.conf and uncomment the lines relating to the wireless work (and set the appropriate settings). You may not need to uncomment them all, I certainly don't have to. Make sure you do uncomment "USE_DHCP[x]=""", where x is a number (4 in my file) and change it to USE_DHCP[x]="yes". Also add the line "/sbin/modprobe ndiswrapper" (without quotes) to your rc.modules file. This is assuming you're using 10.2, as 10.1 is a little bit different.

Zmyrgel 05-28-2006 10:17 AM

I've been trying to get this working. I edited the rc.inet1.conf for those wireless options. Not sure that if the password is valid as I typed it in ASCII instead of hex values. Should it be in hex?

And just noticed you said add /usr/sbin/modprobe ndiswrapper... I've been trying to get it to work with /usr/sbin/ndiswrapper -d 00:0a.0 wg311v3 which doesn't work. Well, back to server to fix things.

Nylex 05-28-2006 10:22 AM

Well, modprobe is in /sbin and not /usr/sbin/. The rest of the lines in rc.modules should tell you that!

As for the password, I don't know (as I don't use password on mine). It does look like it should be in hex though, given the example in the file.

Zmyrgel 05-28-2006 10:41 AM

Oaky, I got it to start ndiswrapper but setting up the connection doesn't work yet. Mainly because of that WEP key I use.

Here's what I have now:
rc.inet1.conf
Code:

## Example config information for wlan0.  Uncomment the lines you need and fill
## in your info.  (You may not need all of these for your wireless network)
IFNAME[4]="wlan0"
IPADDR[4]=""
NETMASK[4]=""
USE_DHCP[4]="yes"
#DHCP_HOSTNAME[4]="icculus-wireless"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
WLAN_ESSID[4]=MyyraVerkko
WLAN_MODE[4]=Managed
WLAN_RATE[4]="54M auto"
WLAN_CHANNEL[4]="auto"
WLAN_KEY[4]="xxxxxxxxxxxxx"
WLAN_IWPRIV[4]="AuthMode=OPEN EncrypType=WEP WEP=xxxxxxxxxxxxx TxRate=0"
#WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"

## Some examples of additional network parameters that you can use.
## Config information for wlan0:
IFNAME[4]="wlan0"              # Use a different interface name nstead of
                                # the default 'eth4'
#HWADDR[4]="00:01:23:45:67:89"  # Overrule the card's hardware MAC address
#MTU[4]=""                      # The default MTU is 1500, but you might need
                                # 1360 when you use NAT'ed IPSec traffic.
#DHCP_KEEPRESOLV[4]="yes"      # If you dont want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes"          # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes"          # If you don't want the DHCP server to change
                                # your default gateway
#DHCP_IPADDR[4]=""              # Request a specific IP address from the DHCP
                                # server
#WLAN_ESSID[4]=DARKSTAR        # Here, you can override _any_ parameter
                                # defined in rc.wireless.conf, by prepending
                                # 'WLAN_' to the parameter's name. Useful for
                                # those with multiple wireless interfaces.
#WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=thekey TxRate=0"
                                # Some drivers require a private ioctl to be
                                # set through the iwpriv command. If more than
                                # one is required, you can place them in the
                                # IWPRIV parameter (space-separated, see the
                                # example).

messages
Code:

May 28 18:33:31 slackbox kernel: ndiswrapper version 1.14 loaded (preempt=no,smp=no)
May 28 18:33:31 slackbox kernel: ndiswrapper: driver wg311v3 (NETGEAR,02/22/2005,3.1.1.7) loaded
May 28 18:33:31 slackbox kernel: PCI: Found IRQ 3 for device 00:0a.0
May 28 18:33:31 slackbox kernel: ndiswrapper: using irq 3
May 28 18:33:31 slackbox kernel: wlan0: vendor: ''
May 28 18:33:31 slackbox kernel: wlan0: ndiswrapper ethernet device 00:0f:b5:8a:4b:b1 using driver wg311v3, 11AB:1FAA:1385:6B00.5.conf
May 28 18:33:31 slackbox kernel: wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK
May 28 18:33:31 slackbox logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig lo 127.0.0.1
May 28 18:33:31 slackbox logger: /etc/rc.d/rc.inet1:  /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 mode Managed
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 nick slackbox
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 channel auto
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 key restricted
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 key ************
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 rate 54M auto
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwpriv wlan0 set AuthMode=OPEN
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwpriv wlan0 set EncrypType=WEP
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwpriv wlan0 set WEP=sl4ck3rm4st3r
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwpriv wlan0 set TxRate=0
May 28 18:33:33 slackbox logger: /etc/rc.d/rc.M:  /sbin/iwconfig wlan0 essid MyyraVerkko
May 28 18:33:34 slackbox logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 60  wlan0
May 28 18:34:32 slackbox logger: /etc/rc.d/rc.hotplug start (entering script)
May 28 18:34:33 slackbox kernel: ne2k-pci.c:v1.02 10/19/2000 D. Becker/P. Gortmaker
May 28 18:34:33 slackbox kernel:  http://www.scyld.com/network/ne2k-pci.html
May 28 18:34:33 slackbox kernel: PCI: Found IRQ 9 for device 00:0b.0
May 28 18:34:33 slackbox kernel: PCI: Found IRQ 10 for device 00:06.0

Any idea how to set that inet1.conf so it would succesfully connect with my router?

Alien Bob 05-28-2006 02:48 PM

With ndiswrapper you should not need the IPPRIV commands, just set the WEP key through the normal IWCONFIG commands. I think this would be sufficient for you:
Code:

IFNAME[4]="wlan0"
IPADDR[4]=""
NETMASK[4]=""
USE_DHCP[4]="yes"
WLAN_ESSID[4]=MyyraVerkko
WLAN_MODE[4]=Managed
WLAN_RATE[4]="54M auto"
WLAN_CHANNEL[4]="auto"
WLAN_KEY[4]="s:sl4ck3rm4st3r"

Note that if you want to pass a WEP key string of ASCII characters instead of the usual series of HEX characters, you have to prefix that string with "s:" (see the WLAN_KEY example). Also, I advise you to change your WEP key, now that the world knows :-)

Eric

Zmyrgel 05-28-2006 03:54 PM

Well, They have to find my network first :)

I made things little bit more interresting as I changed to WPA-PSK. I got it to work with my Gentoo laptop but I'm having problems again with my slack server. I downloaded the wpa_supplicant source but I can't compile it as it gives me errors that some file / folder doesn't exist. I made the .config file and added all options on it.

Any idea how to get it to compile it fully? Rest of it is probably pretty much the same struggle as with my laptop so it should be a quick job then on.

But I think I'll hit the bed and continue this issue tomorrow.

PS. I did change the WPA key :)


All times are GMT -5. The time now is 06:26 PM.