Results 1 to 4 of 4

Thread: Wireless interface connects to wrong AP on boot

  1. #1
    Join Date
    Oct 2005
    Location
    Poland, Bydgoszcz
    Beans
    33
    Distro
    Ubuntu 6.06

    Red face Wireless interface connects to wrong AP on boot

    Hello,

    I've a strange issue with wireless connection. Some setup information first:
    - I've atheros-based NIC that works well with madwifi
    - I've removed NetworkManager as I need a fixed (static) connection
    - my ath0 interface is configured via /etc/network/interfaces with "auto" flag
    - I use WPA2 and it's properly configured in the "interfaces" file

    Now onto the problem... For some reason ath0 attempts to connect to wrong access point on startup (e.g. when Ubuntu boots up), but I can bring it up manually with no problems (sudo ifup ath0 - connects to correct AP and works fine).

    Any idea on what may be wrong?

    PS. BTW, I tried wicd (just out of curiosity) and it also would not connect to my AP automatically on boot - I had to manually select my AP to connect to it (and yes, "Automatically connect" option was set). I noticed that I had to click "Refresh" in wicd for my AP to appear on the list - is it possible the my AP gets unnoticed due to some delays in response? I haven't had any problems with any distro with this so far -- just with Hardy.

  2. #2
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,022
    Distro
    Ubuntu 19.10 Eoan Ermine

    Re: Wireless interface connects to wrong AP on boot

    my ath0 interface is configured via /etc/network/interfaces
    I suggest specifying the MAC address of the access point you want to connect to in interfaces. Determine it with:
    Code:
    sudo iwlist ath0 scan
    You will get a result like this:
    Code:
    Cell 01 - Address: 99:13:19:62:8D:F7
                        ESSID:"mylilrouter"
                        Mode:Master
                        Channel:11
    === snip ===
    Then specify it in interfaces:
    Code:
    auto lo
    iface lo inet loopback
    
    auto ath0
    iface ath0 inet dhcp
    wireless-essid mylilrouter
    wireless-key 096c7fblahfoo
    wireless-ap 99:13:19:62:8D:F7
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  3. #3
    Join Date
    Oct 2005
    Location
    Poland, Bydgoszcz
    Beans
    33
    Distro
    Ubuntu 6.06

    Unhappy Re: Wireless interface connects to wrong AP on boot

    Quote Originally Posted by chili555 View Post
    I suggest specifying the MAC address of the access point you want to connect to in interfaces.
    (...)
    Hello,

    That didn't help. My current interfaces entry for ath0 is:
    Code:
    auto ath0
    iface ath0 inet static
    	wpa-ssid foobar
    	wpa-bssid 00:08:B1:C1:D1:01
    	wpa-ap-scan 0
    	wpa-scan-ssid 0
    	wpa-driver wext
    	wpa-proto WPA2
    	wpa-key-mgmt WPA-PSK
    	wpa-psk "********"
    	address 192.168.0.5
    	netmask 255.255.255.0
    	gateway 192.168.0.254
    The only workaround I've found so far is to remove "auto ath0" and add "/sbin/ifup ath0" line to /etc/rc.local, but I don't like it... Any other ideas on what maybe wrong?

    Thanks,

    Pawel

  4. #4
    Join Date
    Oct 2005
    Location
    Poland, Bydgoszcz
    Beans
    33
    Distro
    Ubuntu 6.06

    Lightbulb Re: Wireless interface connects to wrong AP on boot

    Ok, It looks like I've finally found a workaround for my problem. The solution is to configure wireless interface with dedicated wpa_supplicant config file. My entry for ath0 in /etc/network/interfaces:

    Code:
    auto ath0
    iface ath0 inet static
    	address 192.168.0.5
    	netmask 255.255.255.0
    	gateway 192.168.0.254
    	wpa-driver madwifi
    	wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    And in /etc/wpa_supplicant/wpa_supplicant.conf I have:

    Code:
    ap_scan=1
    network={
    	key_mgmt=NONE
    	priority=-9999999
    }
    network={
    	ssid="foobar"
    	proto=RSN
    	key_mgmt=WPA-PSK
    	pairwise=TKIP
    	group=TKIP
    	psk="************"
    	priority=1
    }
    Some conclusions:
    - if I entered the above settings in "interfaces" file directly (no separate wpa config file) - it didn't work
    - adding pairwise and group parameters seem to be crucial too

    It tooks me several hours and a lot of frustration to figure this out... Maybe this helps someone.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •