# How to assign an ip adress to wlan0

## George528

When i boot up, only wired interface is loading properly and an ip is only to it assigned. 

For wlan0 to work i have to:

1. run sudo wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0

2. delete /var/run/wpa_supplicant/wlan0

3. run sudo wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0  again

4. run dhcpcd wlan0 for it to assign an ip adress

how can i do this more easily or automatically?

also why do i get this "warning":

```
$ sudo wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0

Successfully initialized wpa_supplicant

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

nl80211: kernel reports: Match already configured

```

Thanks

----------

## alamahant

In 

/etc/conf.d/net

```

#####WIRELESS

#modules="wpa_supplicant"

#config_wlan0="192.168.2.4/24"

#routes_wlan0="default via 192.168.2.1"

#dns_servers_wlan0="192.168.2.1"

####OR

#config_wlan0="dhcp"

```

In wpa_suppicant.conf you need of cource to set your esssid and password etc.

----------

## George528

 *alamahant wrote:*   

> In 
> 
> /etc/conf.d/net
> 
> ```
> ...

 

i went with the dhcp option but it still doesn't work

----------

## alamahant

Did you

```

cd /etc/init.d

ln -s net.lo net.wlan0

rc-update add net.wlan0 boot

rc-update add wpa_supplicant boot

```

?

----------

## dmpogo

 *alamahant wrote:*   

> Did you
> 
> ```
> 
> cd /etc/init.d
> ...

 

If he uses dhcpcd, there is no need for any of that

----------

## George528

 *dmpogo wrote:*   

>  *alamahant wrote:*   Did you
> 
> ```
> 
> cd /etc/init.d
> ...

 

i use NetworkManager now

how do i make it so it automatically assigns an ip value

----------

## figueroa

Right click on the NM icon in panel, edit the connection, set an IP address and other network parameters (probably on the IPV4 tab).

----------

## George528

 *figueroa wrote:*   

> Right click on the NM icon in panel, edit the connection, set an IP address and other network parameters (probably on the IPV4 tab).

 

i dont have a nm gui installed, what package to install for xfce?

----------

## alamahant

gnome-extra/nm-applet

----------

