# Can't connect to new wireless router-

## floops

I upgraded to a new wireless N dual band router- however I cannot seem to get to the internet that way- I can see the router and it seems to be connected but is not getting an ip address and just says "Network is unreachable" - Probably something dumb- can anyone help?- here is some output

localhost floopy # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

eth1      IEEE 802.11abg  ESSID:"Gauss"  

          Mode:Managed  Frequency:2.437 GHz  Access Point: C0:C1:C0:B3:05:FC   

          Bit Rate=65 Mb/s   Tx-Power=200 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off                                                                                                      

          Power Management:off                                                                                                    

          Link Quality=70/70  Signal level=-34 dBm                                                                                

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0                                                                

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

localhost floopy # ping -c 3 192.168.1.1

connect: Network is unreachable

localhost floopy # wpa_cli status

Selected interface 'eth1'

bssid=c0:c1:c0:b3:05:fc

ssid=Gauss

id=2

mode=station

pairwise_cipher=CCMP

group_cipher=TKIP

key_mgmt=WPA-PSK

wpa_state=COMPLETED

----------

## Gusar

Did you run a dhcp client after making the wireless connection? Also, which wireless card (lspci -nn)?

----------

## floops

I tried running dhcpcd and it gave me a bogus IP address (my router is something like 192.168.1.1 but dhcp assigned me the address 169.something which is clearly not from the router)- again the output is the same as above- it looks connected but is not- the only update is that it did give me a (bogus) IP address.

Thanks for the suggestion though

----------

## chithanh

169.254.* are APIPA addresses which dhcpcd uses when no DHCP server can be reached. Be aware that after dhcpcd gets an APIPA address, it will re-assign it immediately on second launch again, and only change it when a DHCP server replies.

To see whether you have any connection at all, set a static IP address and try to ping hosts on the local network. Also try to launch wpa_supplicant manually and wait for CTRL_EVENT_CONNECTED.

----------

## Gusar

I ask again, which wireless card? A few of them have issues lately, but there are some patches available. There's also possible workarounds. But we need to know which card you have.

----------

## floops

Sorry for not responding earlier- I do not think it is the card- but it is a Broadcom 4313. I tried using the brcmsmac driverr and could not get it to work so now use the broadcom-sta driver

----------

## floops

Have not had much time to mess with this til today- 

first tried restarting eth1

localhost floopy # /etc/init.d/net.eth1 restart

 * Bringing down interface eth1

 *   Stopping dhcpcd on eth1 ...                                                                                            [ ok ]

 *   Removing addresses

 *     Stopping wpa_cli on eth1 ...                                                                                         [ ok ]

 *     Stopping wpa_supplicant on eth1 ...                                                                                  [ ok ]

 * Bringing up interface eth1

 *   Starting wpa_supplicant on eth1 ...

Could not set interface eth1 flags: Operation not possible due to RF-kill

Failed to initialize driver interface

 *   start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'                                                          [ !! ]

 * ERROR: net.eth1 failed to start

then emerged rfkill and found there was some soft block setting which I unblocked

localhost floopy # rfkill list

0: phy0: Wireless LAN

        Soft blocked: yes

        Hard blocked: no

1: brcmwl-0: Wireless LAN

        Soft blocked: no

        Hard blocked: no

localhost floopy # rfkill unblock 0

localhost floopy # rfkill list

0: phy0: Wireless LAN

        Soft blocked: no

        Hard blocked: no

1: brcmwl-0: Wireless LAN

        Soft blocked: no

        Hard blocked: no

localhost floopy # /etc/init.d/net.eth1 restart

 * Bringing up interface eth1

 *   Starting wpa_supplicant on eth1 ...                                                                                    [ ok ]

 *   Starting wpa_cli on eth1 ...                                                                                           [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.eth1 has started, but is inactive

localhost floopy # wpa_cli scan

Selected interface 'eth1'

OK

localhost floopy # wpa_cli status

Selected interface 'eth1'

bssid=c0:c1:c0:b3:05:fc

ssid=Gauss

id=2

mode=station

pairwise_cipher=CCMP

group_cipher=TKIP

key_mgmt=WPA-PSK

wpa_state=COMPLETED

ip_address=169.254.17.179

Sadly the Windows computer connected happily to the router. Anyone know what I am doing wrong? Thanks for all your effort

Oh- and looking at the router using the wired ethernet I cannot see my laptop listed as connected to the router- only the windows computer and my wired connection

Could this be something I am missing from the kernel?

----------

## floops

Yet more info to help diagnose

in dmesg there is a line 

eth1 No Ipv6 routers present

In the event log from wpa_gui I get the following sequence

Trying to associate with router( given by mac id)

Association request to driver failed

CTRL-EVENT-DISCONNECTED bssid=router   reason =0

Associated with router

Key Negotiation Completed PTK=CCMP, GTK=TKIP

CTRL-EVENT-CONNECTED

/var/log/messages | tail

Feb 21 21:59:42 localhost dhcpcd[10810]: eth1: checking for 169.254.82.230

Feb 21 21:59:46 localhost dhcpcd[10810]: eth1: sending IPv6 Router Solicitation

Feb 21 21:59:47 localhost dhcpcd[10810]: eth1: using IPv4LL address 169.254.82.230

Feb 21 21:59:47 localhost dhcpcd[10810]: forked to background, child pid 10861

Feb 21 21:59:50 localhost dhcpcd[10861]: eth1: sending IPv6 Router Solicitation

Feb 21 21:59:50 localhost kernel: [ 1315.149281] eth1: no IPv6 routers present

Feb 21 21:59:50 localhost dhcpcd[10861]: eth1: broadcasting for a lease

Feb 21 21:59:54 localhost dhcpcd[10861]: eth1: sending IPv6 Router Solicitation

Feb 21 21:59:54 localhost dhcpcd[10861]: eth1: no IPv6 Routers available

Does this help at all?

----------

## Gusar

You're not getting a proper IP. Could be a router issue. Or you could try a different dhcp client.

----------

## floops

Hi Gusar-

Thanks for your reply-

Seems unlikely a router issue as a Windows based computer happily connects as does my Roku(which I think is linux based). My Gentoo laptop will happily connect with other routers (in particular my work one which does not use encryption, and my older 802.11G version that only did WEP). So I would guess that dhcp is not the issue either- I am no expert so please feel free to contradict me.

Thanks again for your input

floops

----------

## Gusar

Bah, it seems today I'm missing a lot of stuff in the output people post. Here I missed this:

```
Could not set interface eth1 flags: Operation not possible due to RF-kill 
```

and this

```
Soft blocked: yes
```

You need to unblock that:

```
rfkill unblock all
```

Also, please use code tags next time, it makes this stuff easier to read.

----------

## floops

Hi again Gusar

I have figured out this problem- I installed rfkill and each time I restart eth1 I get the same issue, so I issue 

```
rfkill unblock 0 
```

and restart eth1 again. So that issue seems to be resolved- though I do not understand why I have to keep unblocking it. Can I just tell it to never block this?

Sorry about the code tags thing- I have never used those buttons at the top or the post window and honestly did not know what they were for- I will try to incorporate them in all my future posts. Thanks again for your help

floops

----------

## Gusar

You could use preup() for this. Check the documentation (/usr/share/doc/openrc-<version>/net.example.bz2) on how this works. I've never used it before, but it's explained in that file. I think this in /etc/conf.d/net should do it:

```
preup() {

  rfkill unblock 0

  return 0

}
```

Last edited by Gusar on Wed Feb 22, 2012 9:13 pm; edited 1 time in total

----------

## floops

I tried the brcmsmac driver and had even more problems- could not even do WEP

You can check out my failings here

https://forums.gentoo.org/viewtopic-t-907880-highlight-.html

Not sure if this is the appropriate way to cite something like this- I was not sure of the formatting for the Post tag.

Now it may be that the stuff I did to get the Broadcom-sta driver working were enough to solve my brcmsmac problems but I do not know. I would need to find a bunch of free time to try and switch back since I cannot afford to take down the computer I use for home and work for a significant amount of time. If that is the only option I may try it- but I do not expect the driver is the issue at the moment (though certainly it may cause the Rf kill thing- but this is a problem I can solve quickly and get back up) so it is just a minor nuisance in my world.

Do you think the sta driver is part of this issue or just the rf kill one?

Thanks again for your help

----------

## Gusar

I haven't googled much, but yeah, it seems this is a quirk of the wl (broadcom-sta) driver. Try the preup() thingy. Like I said, I've never used it before, so I'm curious if it'll work.

----------

## floops

Well you solved one problem- sort of-

I added to /etc/conf.d/net

```
preup{} {

        rfkill unblock 0

        return 0

}
```

I get 

localhost / # /etc/init.d/net.eth1 restart

 * Caching service dependencies ...

/etc/init.d/../conf.d/net: line 9: preup{}: command not found

/etc/init.d/../conf.d/net: line 9: preup{}: command not found

/etc/init.d/../conf.d/net: line 9: preup{}: command not found                                                               [ ok ]

/etc/init.d/../conf.d/net: line 9: preup{}: command not found

 * Bringing down interface eth1

 *   Stopping dhcpcd on eth1 ...                                                                                            [ ok ]

 *   Removing addresses

 *     Stopping wpa_cli on eth1 ...                                                                                         [ ok ]

 *     Stopping wpa_supplicant on eth1 ...                                                                                  [ ok ]

/etc/init.d/../conf.d/net: line 9: preup{}: command not found

 * Bringing up interface eth1

 *   Starting wpa_supplicant on eth1 ...                                                                                    [ ok ]

 *   Starting wpa_cli on eth1 ...                                                                                           [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.eth1 has started, but is inactive

So while it claims it has no knowledge of preup, I did not have to mess with the rfkill thing. Did I do something wrong? It is at least effective

I found it- parentheses immediately after preup- not brackets correct code should have been

```
preup()   {

                   rfkill unblock 0

                   return 0

)
```

Wasn't the problem I was going for but I do appreciate it. Thanks heaps Gusar

----------

## Gusar

Hmm, it would be nice to know if it's the preup thing or something else that made the driver change it's behavior. On the other hand, wl is a closed driver, so who knows what the hell it is doing. You're lucky it works at all. Usually people only report kernel panics when trying to use it.

----------

