# Wifi configuration [Solved]

## Le_Sage

Hello, 

I moved in recently into a flat share and there is only a wifi connection. I have a dual boot on my laptop Sony Vaio VGN-CR11S (Ubuntu/Gentoo Linux). It works well on Ubuntu. But I have a problem on Gentoo. After trying to configure the wifi, when I boot on my gentoo session, it seems that the system doesn't recognize wifi and I have to launch the command "iwlist scan" in a terminal before the internet connection works. Besides, it doesn't work every time...So, I want to know if there is a way to let the system scan the wifi networks by itself and not with my help on a terminal.

I give you here some information about my wifi configuration : 

```
# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

# WPA_SUPPLICANT

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "dhcp" )

# cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=0

network={

        ssid="WLAN-AB5278"

        psk="mot_de_passe"

        priority=5

}
```

This is what I get if I don't launch the command "iwlist scan" : 

```
# ifconfig -a

eth0      Lien encap:Ethernet  HWaddr 00:13:a9:f4:a0:2d 

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 lg file transmission:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interruption:28 Adresse de base:0x2000

lo        Lien encap:Boucle locale 

          inet adr:127.0.0.1  Masque:255.0.0.0

          adr inet6: ::1/128 Scope:Hôte

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 lg file transmission:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

sit0      Lien encap:IPv6-dans-IPv4 

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 lg file transmission:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Lien encap:Ethernet  HWaddr 00:1b:77:ac:c2:2f 

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 lg file transmission:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# /etc/init.d/net.wlan0 start

* WARNING:  net.wlan0 has already been started.

# iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

wlan0     IEEE 802.11abg  Mode:Managed  Access Point: Not-Associated   

          Tx-Power=15 dBm   

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

          Encryption key:off

          Power Management:off

# wpa_cli status

Selected interface 'wlan0'

wpa_state=DISCONNECTED

```

And this what I get when I launch it : 

```

# iwlist scan

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

sit0      Interface doesn't support scanning.

wlan0     Scan completed :

          Cell 01 - Address: 00:24:FE:47:3A:FF

                    Channel:1

                    Frequency:2.412 GHz (Channel 1)

                    Quality=31/70  Signal level=-79 dBm 

                    Encryption key:on

                    ESSID:"WLAN-0024FE473AFF"

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s

                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s

                    Mode:Master

                    Extra:tsf=00000001f8963983

                    Extra: Last beacon: 2659ms ago

                    IE: Unknown: 0011574C414E2D303032344645343733414646

                    IE: Unknown: 010882848B960C121824

                    IE: Unknown: 030101

                    IE: Unknown: 050400010000

                    IE: Unknown: 2A0100

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (1) : CCMP

                        Authentication Suites (1) : PSK

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (1) : TKIP

                        Authentication Suites (1) : PSK

                    IE: Unknown: 32043048606C

                    IE: Unknown: DD180050F2020101820003A4000027A4000042435E0062322F00

                    IE: Unknown: 2D1A4E101BFFFF000000000000000000000000000000000000000000

                    IE: Unknown: 3D16010D0800000000000000000000000000000000000000

                    IE: Unknown: DD0900037F01010000FF7F

                    IE: Unknown: DD0A00037F04010020000000

                    IE: Unknown: DD0E0050F204104A0001101044000102

          Cell 02 - Address: 00:23:08:40:F9:A2

                    Channel:3

                    Frequency:2.422 GHz (Channel 3)

                    Quality=36/70  Signal level=-74 dBm 

                    Encryption key:on

                    ESSID:"WLAN-40F902"

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s

                              18 Mb/s; 36 Mb/s; 54 Mb/s

                    Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s

                    Mode:Master

                    Extra:tsf=0000045733c993cc

                    Extra: Last beacon: 2627ms ago

                    IE: Unknown: 000B574C414E2D343046393032

                    IE: Unknown: 010882848B961224486C

                    IE: Unknown: 030103

                    IE: Unknown: 2A0104

                    IE: Unknown: 32040C183060

                    IE: Unknown: 2D1AEE1117FFFF0000010000000000000000000000000C0000000000

                    IE: Unknown: 3D1603050000000000000000000000000000000000000000

                    IE: Unknown: 3E0100

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

                    IE: Unknown: 7F0101

                    IE: Unknown: DD8C0050F204104A00011010440001021041000100103B000103104700100000000000000001100000230840F9A01021000B436F72706F726174696F6E1023000941525634353235505710240008312E30372E3030301042000A4A3834353030313131321054000800060050F204000110110014576972656C65737320526F757465722857464129100800020004

                    IE: Unknown: 0706444520010D10

                    IE: Unknown: DD1E00904C33EE1117FFFF0000010000000000000000000000000C0000000000

                    IE: Unknown: DD1A00904C3403050000000000000000000000000000000000000000

          Cell 03 - Address: 00:23:08:AB:52:56

                    Channel:11

                    Frequency:2.462 GHz (Channel 11)

                    Quality=55/70  Signal level=-55 dBm 

                    Encryption key:on

                    ESSID:"WLAN-AB5278"

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s

                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s

                    Mode:Master

                    Extra:tsf=00000002c737e180

                    Extra: Last beacon: 2255ms ago

                    IE: Unknown: 000B574C414E2D414235323738

                    IE: Unknown: 010882848B960C121824

                    IE: Unknown: 03010B

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : TKIP CCMP

                        Authentication Suites (1) : PSK

                    IE: Unknown: 2A0102

                    IE: Unknown: 32043048606C

                    IE: Unknown: DD180050F2020101030003A4000027A4000042435E0062322F00

                    IE: Unknown: 2D1A0E101BFFFF000000000000000000000000000000000000000000

                    IE: Unknown: 3D160B0F0A00000000000000000000000000000000000000

                    IE: Unknown: DD0900037F01010000FF7F

                    IE: Unknown: DD0A00037F04010030000000

                    IE: Unknown: 0706444520010D14

                    IE: Unknown: DD910050F204104A00011010440001021041000100103B0001031047001000000000000000030000002308AB52561021000B436F72706F726174696F6E1023000941525634353238505710240008312E30342E3030301042000A4A3932393037323737381054000800060050F204000110110014576972656C65737320526F757465722857464129100800020004103C000103

# wpa_cli status

Selected interface 'wlan0'

bssid=00:23:08:ab:52:56

ssid=WLAN-AB5278

id=0

pairwise_cipher=CCMP

group_cipher=TKIP

key_mgmt=WPA2-PSK

wpa_state=COMPLETED

ip_address=192.168.2.107
```

Last edited by Le_Sage on Tue May 25, 2010 9:56 pm; edited 1 time in total

----------

## VinzC

Have you tried commenting out the line that says

```
ap_scan=0
```

  :Question: 

----------

## tomk

Moved from Kernel & Hardware to Networking & Security.

----------

## d2_racing

Yeah, maybe it's only that little config.

His config seems to be pretty good.

----------

## Le_Sage

It seems to work yeah! Thanks!  :Very Happy: 

----------

## VinzC

You're welcome  :Smile:  .

----------

## d2_racing

Nice  :Razz: 

----------

## VinzC

Who said geeks were anti-social beings?  :Wink: 

----------

## d2_racing

Yeah  :Razz: 

----------

