# Could not set interface wlan0 flags: No such file or directo

## RdlP

hi everybody!

I have a problem with my wireless network and i googled but i dont find the solution for my problem, when i try this:

```

wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -dd

```

the result is:

```

angel-gentoo ~ # wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -dd

Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ap_scan=1

ctrl_interface='/var/run/wpa_supplicant'

Line: 4 - start of a new network block

ssid - hexdump_ascii(len=7):

     4f 4e 4f 46 43 38 41                              ONOFC8A         

proto: 0x1

key_mgmt: 0x2

PSK (ASCII passphrase) - hexdump_ascii(len=10): [REMOVED]

pairwise: 0x8

group: 0x8

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Priority group 0

   id=0 ssid='ONOFC8A'

WEXT: cfg80211-based driver detected

Could not set interface wlan0 flags: No such file or directory

Failed to initialize driver interface

Failed to add interface wlan0

Cancelling scan request

Cancelling authentication timeout

```

my network file is:

```

#RED INALAMBRICA

modules=( "wpa_supplicant" )

#Controlador a usar

wpa_supplicant_wlan0="-Dwest"

config_eth0=( "dhcp" )

config_wlan0=( "dhcp" )

```

and my wpa_supplicant file is:

```

ap_scan=1

ctrl_interface=/var/run/wpa_supplicant

network={

  ssid="ONOFC8A"

  proto=WPA

  key_mgmt=WPA-PSK

  psk="PASSWORD"

  pairwise=TKIP

  group=TKIP

}

```

Can someone help me please?

Thank you very much!

----------

## DawgG

check with iwconfig if the interface exists; check if you can connect at all (w/out wpa_supplicant and w/out encryption). (if not check kernel (modules) for interface, networking and encryption stuff.)

if above is true maybe you might have to issue 

```
ifconfig wlan0 up
```

 before it becomes available (had that happen with a realtek if.)

GOOD LUCK!

----------

## RdlP

hi again! thank you for reponse

```

angel-gentoo ~ # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any  

          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   

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

          Encryption key:off

          Power Management:off

          

```

but when i try iwlist scan:

```

angel-gentoo ~ # iwlist scan

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

wlan0     Interface doesn't support scanning : Network is down

```

more info:

```

angel-gentoo ~ # lshw -c Network

      *-network DISABLED

       description: Wireless interface

       product: RT2860

       vendor: RaLink

       physical id: 0

       bus info: pci@0000:01:00.0

       logical name: wlan0

       version: 00

       serial: 00:15:af:db:46:bc

       width: 32 bits

       clock: 33MHz

       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless

       configuration: broadcast=yes driver=rt2800pci driverversion=2.6.36-gentoo-r5 firmware=N/A latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn

       resources: irq:19 memory:fbef0000-fbefffff

```

and

```

angel-gentoo ~ # ifconfig wlan0 up

SIOCSIFFLAGS: No such file or directory

```

Thank you!

----------

## DawgG

you should check the drivers (maybe in-kernel modules or external modules) and also, if you need extra firmware installed for it to work (check here: http://wireless.kernel.org/en/users/Drivers/rt2800pci#device_firmware )

see what happens when you insert the modules. if this is a notebook maybe there is an issue with rfkill.

GOOD LUCK!

----------

## RdlP

Hello again everybody!!!

My wireless network now work!!!

I want share my experience with you.

I downloaded my driver's card then i compiled it for linux and wpa_supplicant, it generate a rt2860sta.ko and rt2860sta.o (but my kernel versión work with modules in *.ko), then y copied rt2860sta.ko in /lib/modules/2.6.36-gentoo-r5/kernel/drivers/net/wireless/.

Then i download all wireless modules from my system and load rt2860sta.ko.

And now if I run lshw -c Network i see that logical name is ra0, not wlan0. then i run wpa_supplicant -c/etc/wpa_supplicant.conf -ira0 -dd, before i changed my net file, now is:

```

#RED INALAMBRICA 

modules=( "wpa_supplicant" ) 

#Controlador a usar 

wpa_supplicant_ra0="-Dwest" 

config_eth0=( "dhcp" ) 

config_ra0=( "dhcp" ) 

```

And now i run: dhclient and the net work!!!

Thank you very much DawG.

By the way, another question when i restart the systema i have run again wpa_supplicant, ifconfig ra0 up and dhclient, there any way to do this automatically?

Thanks!!!

----------

## cach0rr0

 *RdlP wrote:*   

> 
> 
> By the way, another question when i restart the systema i have run again wpa_supplicant, ifconfig ra0 up and dhclient, there any way to do this automatically?
> 
> 

 

two steps to this:

-set up /etc/conf.d/net for ra0 (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4)

-symlink a net.ra0 init script (ln -s /etc/init.d/net.lo /etc/init.d/net.ra0)

-add net.ra0 to the default runlevel

alternatively, you can go with a graphical wireless management tool, such as wicd

----------

## RdlP

hi again!

I do it, but when i restart the system, just before login, appears:

```

Starting ra0

     Starting wpa_supplicant on ra0

Unsupported driver 'west'

```

I also try with madwifi but appears the same error.

But when i login and run:

wpa_supplicant -c/etc/wpa_supplicant.conf -ira0

it work, why?

Thanks!

----------

## cach0rr0

wext

not

west

You could also try nl80211 instead of wext (if you do this, you'd need to emerge net-wireless/iw)

----------

## RdlP

oh! it's true, it is wext not west.... i'm silly jejej

It's work perfectly, thanks cach0rr0 and DawgG

----------

