You are not logged in.

#1 2008-04-16 10:08:12

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

netcfg2 not assigning AP's MAC to interface

Okay, please ignore this if it is one of those typical things that everyone's been asking about.

I've created a profile from my home network (uses WEP and DHCP). I basically just copied the example file (wep.example) and modified the existing lines without adding any new lines. SCAN="yes" is also in the file.

When I run netcfg2 myprofile, it says "association failed". I check the iwconfig output and I see that the AP's MAC is set to None (or empty or something, I'm at work now). So I iwlist ath0 scan, and then assign the MAC manually with iwconfig ath0 ap XX:XX:XX:XX:.... and then dhcpcd ath0. It works. So, my question is, how do I make netcfg2 assign the AP's MAC to the interface?

Last edited by foxbunny (2008-04-16 10:08:55)

Offline

#2 2008-04-16 23:39:42

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Here's my network profile:

CONNECTION="wireless"
DESCRIPTION="Home network for the foxen"
INTERFACE=ath0
SCAN="yes"
SECURITY="wep"
ESSID="FOXENBOXEN"
KEY="s:<censored>"
IP="dhcp"

Offline

#3 2008-04-17 12:44:54

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Bah, I just created a bash script to assign the appropriate AP, essid, key whatever and dhcpcd the interface... tongue

Offline

#4 2008-04-17 13:05:27

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: netcfg2 not assigning AP's MAC to interface

It should be unnecessary to assign the AP's MAC manually, this is done automatically during association (by the hardware or driver). However, some/most drivers don't work with hidden SSID, so assigning the AP MAC manually may help in these cases.

Offline

#5 2008-04-17 14:45:41

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

My SSID is not hidden, afaik. At least it shows up in scans, which I guess means it's not hidden. Or you meant some other form of hiding I'm unaware of? Also, every GUI tool I've tried will correctly bring up the interface and establish connection (including KWifiManager and WLAssistant). That's why this is so strange to me. Anyway, this is now solved (kinda), but if you can tell my how to do this with netcfg2 correctly, I'd be very grateful.

Offline

#6 2008-04-17 18:38:51

tigrmesh
IRC Op
From: Florida, US
Registered: 2007-12-11
Posts: 794

Re: netcfg2 not assigning AP's MAC to interface

What's in this:

foxbunny wrote:

KEY="s:<censored>"

?  Is it the hex value?  Because if so, you don't need the 's:'.

Is your hostname the same in rc.conf and hosts?  Do you have a ! in front of ath0 in the interfaces line in rc.conf?  Also in rc.conf:  does your gateway line have the address of your router, and does gateway have a ! in front of it in the routes line?

Offline

#7 2008-04-17 19:02:07

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Okay, to clarify stuff. I have wireless WORKING. Just not with netcfg2.

I have a script that goes like this:

#!/bin/bash
sudo ifconfig ath0 up
sudo iwconfig ath0 mode managed essid ESSID key s:thisismykey channel6 ap XX:XX:XX:XX:XX:XX
sudo dhcpcd -nd ath0

When I call this script, the network is up and I can ping all machines on both my lan and outside it (gateway included). And yes, ath0 is disabled in the rc.conf. But I don't think I need to set the gateway in routes, nor do I think that'd solve this particular issue, will it?

Offline

#8 2008-04-17 19:16:58

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: netcfg2 not assigning AP's MAC to interface

Look at /etc/network.d/examples/complete.example and you'll see the IWOPTS setting. Add that to your profile with the channel and ap parameters.

Offline

#9 2008-04-17 22:41:10

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg2 not assigning AP's MAC to interface

must be a typo in that example. Thanks for pointing that out

the _correct_ option is

WEP_OPTS=""

http://projects.archlinux.org/git/?p=ne … 94b18162b9

Last edited by iphitus (2008-04-17 22:41:31)

Offline

#10 2008-04-18 11:01:11

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Okay, now I'm confused... tongue

Should I add IWOPTS or WEP_OPTS?

Also, I need to add this:

WEP_OPTS/IWOPTS="ap XX:XX:XX:XX:XX:XX channel 6" ?

FYI, I've already tried IWOPTS with ap only and it didn't work... If I add the options, do I disable SCAN?

Offline

#11 2008-04-18 13:11:15

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg2 not assigning AP's MAC to interface

WEP_OPTS="ap XX:XX:XX:XX:XX:XX channel 6"

iwopts is a typo in one of the example configs.

Last edited by iphitus (2008-04-18 13:12:39)

Offline

#12 2008-04-18 14:21:11

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Oh, that makes sense now. smile I'll try that as soon as I get home.

BTW, it usually happens that when I suspend to RAM, I can no longer connect. I've tried to ifconfig ath0 down and release the dhcp IP and some such stunts, but no luck. How can I "restart" my interface after suspending to RAM? Can netcfg2 also take care of that?

Offline

#13 2008-04-19 03:39:21

tigrmesh
IRC Op
From: Florida, US
Registered: 2007-12-11
Posts: 794

Re: netcfg2 not assigning AP's MAC to interface

This is what I do when I've lost connection:

$ /etc/rc.d/net-profiles stop
$ netcfg2 <profile-name>

Offline

#14 2008-04-20 20:49:19

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Ok, so here's the iwconfig output before I do anything (on a freshly booted system).

ath0      IEEE 802.11b  ESSID:""  Nickname:""
          Mode:Managed  Channel:0  Access Point: Not-Associated   
          Bit Rate:0 kb/s   Tx-Power:0 dBm   Sensitivity=1/1  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=0/70  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Then I try to call netcfg2 with modification advised by iphitus.

:: fox up    [BUSY]  - DHCP IP lease attempt failed   [FAIL]

The reason for failure is time out.

Here's iwconfig after the failed netcfg2 attempt:

ath0      IEEE 802.11g  ESSID:""  Nickname:""
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1D:0F:E7:B1:F6   
          Bit Rate:0 kb/s   Tx-Power:17 dBm   Sensitivity=1/1  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=0/70  Signal level=-99 dBm  Noise level=-99 dBm
          Rx invalid nwid:75  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Then I run my custom script, which contains this:

#!/bin/bash
sudo ifconfig ath0 up
sudo iwconfig ath0 mode managed essid FOXENBOXEN key s:<censored> channel 6 ap 00:1D:0F:E7:B1:F6
sudo dhcpcd -nd ath0

This works. Output of iwconfig after this is:

ath0      IEEE 802.11g  ESSID:"FOXENBOXEN"  Nickname:""
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1D:0F:E7:B1:F6   
          Bit Rate:18 Mb/s   Tx-Power:17 dBm   Sensitivity=1/1  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=45/70  Signal level=-50 dBm  Noise level=-95 dBm
          Rx invalid nwid:75  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Offline

#15 2008-05-01 15:22:12

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: netcfg2 not assigning AP's MAC to interface

iphitus wrote:

WEP_OPTS="ap XX:XX:XX:XX:XX:XX channel 6"

iwopts is a typo in one of the example configs.

so does that mean that there is no IWOPTS and that it should be changed to WEP_OPTS instead for any or all of the example profiles?

Offline

#16 2008-06-12 02:49:54

SwimFr3ak
Member
From: /usa/michigan
Registered: 2008-06-10
Posts: 25

Re: netcfg2 not assigning AP's MAC to interface

If you are still having the same issue.

I was having this exact same problem with my wireless connections. Unless I manually brought the interface up before running the script, my interface would not authenticate with the access point.

Add this to the bottom of the network profile that you are using.

PRE_UP="ifconfig <interface> down && ifconfig <interface> up"

Here is my profile, it works like a charm now.

CONNECTION="wireless"
DESCRIPTION="Oakland University Wireless Network"
INTERFACE=ath0
DHCP_TIMEOUT=10
SCAN="yes"
SECURITY="none"
ESSID="grizznet"
IP="dhcp"
TIMEOUT=10
PRE_UP="ifconfig ath0 down && ifconfig ath0 up"

Offline

#17 2008-06-12 12:31:27

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: netcfg2 not assigning AP's MAC to interface

Thanks, I'll try that.

Offline

Board footer

Powered by FluxBB