LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-09-2012, 10:57 PM   #1
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 435

Rep: Reputation: Disabled
Wirelessly Connecting to a Specific AP


So I can't seem to figure this one out...

Basically I'm attempting to connect to a specific Access Point (AP) in a place with many AP's of the same name. I have the BSSID of the AP, but no matter what I do in rc.wireless.conf or rc.inet1.conf, I can't seem to connect to that AP again.

Here is my rc.wireless.conf:
Code:
...
B4:15:*)
    INFO="The only good router here..."
    ESSID="The-ESSID"
    MODE="Master" (iwlist scan picked up Mode as "Master" not "Managed" so this is correct)
    CHANNEL="1" (believe it or not, it is Channel 1.)
    IWCONFIG="ap B4:15:SP:EC:IF:IC"
esac
In this situation, SP:EC:IF:IC is the actual BSSID that I mentioned earlier and "iwlist scan" shows it each time I scan.

I commented two sections like the wiki has:
Code:
... (part at the very beginning)
#*)
#    INFO="Any ESSID"
#    ESSID="any"
#    ;;
... (part at the very end)
# Generic example (describe all possible settings)
#*)
#    INFO="Fill with your own settings..."
...
So I know I'm good on that.

Now in rc.inet1.conf I have:

Code:
IFNAME[1]="wlan0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
...
WLAN_ESSID[1]="The-ESSID"
WLAN_MODE[1]="Master"
WLAN_WPA[1]="wpa_supplicant"
WLAN_CHANNEL[1]="1"
My rc.inet1.conf, rc.wireless.conf, the latter of which I never touched and wpa_supplicant.conf have not needed modifying because I was able to connect to this AP (and the others set up exactly the same way) perfectly fine.

However, today I wish to access this specific AP because it provides a better connection. Even with those settings that I placed, it still keeps accessing a different AP (same ESSID as the one I wish to connect to, but different BSSID is what I mean).

I've read the man page for rc.inet1.conf and there doesn't seem to be an option to set the specific BSSID to connect to. Only one to set the MAC address on the local machine. There is no man page for rc.wireless.conf so no luck there.

Also, when I add in:
Code:
WLAN_MODE[1]="Master"
To rc.inet1.conf, I get:
Code:
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.
Alongside:
Code:
Error for wireless request "Set Nickname" (8B1C) :
    SET failed on device wlan0 ; Operation not supported.
But the latter is something I've always gotten.

Last edited by TommyC7; 10-09-2012 at 10:59 PM.
 
Old 10-11-2012, 01:14 PM   #2
eloi
Member
 
Registered: Nov 2010
Posts: 195

Rep: Reputation: 50
What you are configuring is your wireless not the ap. Till i know your wireless should be in managed mode.

If there is no option to set the ap mac address let's add it.

Add this to your rc.inet1.conf:

Code:
WLAN_AP[1]="here the mac of the router"

In rc.wireless, in the section "# Empty all wireless parameters" below WPAWAIT="" add AP="":

Code:
WPADRIVER=""
WPACONF=""
WPAWAIT=""
AP=""
in the same file below WPA=${WLAN_WPA[$i]:-${WPA}} add AP=${WLAN_AP[$i]:-${AP}}

Code:
RTS=${WLAN_RTS[$i]:-${RTS}}
SENS=${WLAN_SENS[$i]:-${SENS}}
WPA=${WLAN_WPA[$i]:-${WPA}}
AP=${WLAN_AP[$i]:-${AP}}

in the same file and in the section "Regular stuff..." add:

Code:
if [ -n "$AP" ] ; then
        echo "$0:  $IWCOMMAND ap $AP" | $LOGGER
        $IWCOMMAND ap $AP
fi

What we are doing with the above is adding a iwconfig ap command to the Slackware init scripts.

I have no wireless now to try if this workarround works. Let me know if it does .

The error about the nickname is because your wireless doesn't support this feature. If you don't want to see it comment out (in the same rc.wireless) the following:

Code:
#if [ ! -n "$NICKNAME" ] ; then
#    NICKNAME=$(/bin/hostname)
#fi
#if [ -n "$ESSID" -o -n "$MODE" ] ; then
#        echo "$0:  $IWCOMMAND nick $NICKNAME" | $LOGGER
#        $IWCOMMAND nick $NICKNAME
#fi

Good luck.
 
Old 10-11-2012, 05:48 PM   #3
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 435

Original Poster
Rep: Reputation: Disabled
Hey eloi.

I appreciate the help, but I chose a simpler method. For some reason, in wpa_supplicant.conf's man page, the options aren't listed. However on another operating system (and on the internet), wpa_supplicant.conf's man page showed that it had a "bssid" option, so I just added that to /etc/wpa_supplicant.conf instead:

Code:
network={
        bssid=00:12:34:56:78:9A
        ...
}
I'm still not quite sure why the rc.wireless.conf method didn't work, though.
 
Old 10-12-2012, 05:39 AM   #4
eloi
Member
 
Registered: Nov 2010
Posts: 195

Rep: Reputation: 50
What I've explained above seems complicated because is some kind of patch to make the option "permanent". What it does is passing through Slackware bash scripts a command like this:

Code:
iwconfig wlan0 ap 00:11:22:33:44:55
But I've never used WPA encryption. I ignore to what extent wpa_supplicant inherit the options passed through iwconfig.

My advice is just comment this:

Code:
#*)
#    INFO="Any ESSID"
#    ESSID="any"
#    ;;
on rc.wireless.conf and leave the rest of that file untouched. Then make several attempts alternately passing your wireless options trough rc.inet1.conf and/or wpa_supplicant.conf.

The "simpler" solution would be changing the AP name ;-).
 
Old 10-13-2012, 08:53 PM   #5
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 784

Rep: Reputation: 99
do it the easy way
in slackware/extras there's a package called wicd install it
you did install wirelesstools
any way wicd will scan for access points then give you a list to select from
set the password (if any) enable encryption (if the access point is encrypted) and handle it for you
will handle wired connections as well as wifi

overall a nice tool to have around
 
Old 10-14-2012, 02:59 AM   #6
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 435

Original Poster
Rep: Reputation: Disabled
I prefer connecting to access points via the given tools in the operating system without having to resort to external programs or using ifconfig, wpa_supplicant/wirelestools and dh{cpcd,client} individually (just a personal preference).
 
Old 10-14-2012, 10:29 AM   #7
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 784

Rep: Reputation: 99
cool do it your way
but I can sit down at a strange hot spot and be on the web in 30 seconds
 
Old 10-14-2012, 03:01 PM   #8
eloi
Member
 
Registered: Nov 2010
Posts: 195

Rep: Reputation: 50
Yeah. Why to bother in finding out how things work?

Use iPhone5. When something is broken (i.e. internet
connection) buy a new one. Easy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No IP address when connecting wirelessly through Xubuntu youngaa Linux - Wireless Networking 11 12-03-2009 01:26 PM
connecting wirelessly mlombaard Linux - Newbie 1 04-29-2008 04:26 AM
Why the heck must connecting two routers wirelessly be near-impossible ? Dark Carnival Linux - Hardware 5 05-20-2007 01:26 PM
connecting to the internet wirelessly davisw Linux - Laptop and Netbook 5 05-02-2007 04:03 PM
Connecting Wirelessly with Netgear WG311 Redhat iambia Linux - Wireless Networking 2 01-25-2006 11:17 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration