# How to set the wpa_supplicant auto connect net when booting

## xiwang

Hello!

When I do "dhcpcd wlp2s2" ,computer can  connect to the Internet.

but I'd like to automatically connected to the Internet when booting.

How should I do?

----------

## xiwang

I execute “rc-update add wlan0 default”

but shows there is no wlan0

----------

## v_andal

Theoretically, you just need to add dhcpcd to the default run level. Ie.

```
rc-update add dhcpcd default
```

If your configuration is correct, then things should work.

Practically, there's some bug in openrc (or somewhere else). In certain cases DHCPCD does not notice wlan interface, so it does not get activated. After boot is finished, wlan interface can be activated manually.

So, make sure that dhcpcd is in default run level and that wpa_supplicant is configured appropriately. If things work, then your are done.

----------

## charles17

See this wiki article https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD

----------

## xiwang

It is works well

```
rc-update add dhcpcd default
```

 :Laughing: 

----------

