# Wpa_supplicant on eth0 problem

## NewBieUser

I have two network interfaces eth0 and wlan0. Both of them requires wpa_supplicant. My wireless connection works fine, but eth0 doesn't start properly.

Could you help plz?

my configs:

/etc/conf.d/net

```

modules="wpa_supplicant dhcpcd"

config_wlan0="dhcp"

wpa_supplicant_eth0=" -Dwired -c /etc/wpa_supplicant/wired.conf"

config_eth0="dhcp"

```

/etc/wpa_supplicant/wired.conf

```

ctrl_interface=/var/run/wpa_supplicant

eapol_version=1

ap_scan=0

network={

        eapol_flags=0

        key_mgmt=IEEE8021X

        eap=TLS

        identity="myidentity"

        ca_cert="/etc/wpa_supplicant/certs/cacas.pem"

        client_cert="/etc/wpa_supplicant/certs/clientcert.cer"

        private_key="/etc/wpa_supplicant/certs/privkey.pem"

        private_key_passwd="my_privkey_pass"

        priority=80

}

```

/etc/wpa_supplicant/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

fast_reauth=1

ap_scan=1

#Work

network={

        ssid="ASUS"

        psk=fcf3e0c39d76a250f38da15c6413...

        priority=80

}

#Open AP

network={

        key_mgmt=NONE

        priority=5

}

```

When net.wlan0 starts wpa_supplicant started by it, but when eth0 starts it doesn't start wpa_supplicant.

Also, if I ran manually and restart dhcpcd eth0 works properly

```
wpa_supplicant -c /etc/wpa_supplicant/wired.conf -i eth0 -D wired
```

How to reconfigure my eth0 / wpa_supplicant to start properly by starting init.d script net.eth0?

Is there any decision to start wlan0 and eth0 that eth0 works as primary connection and wlan0 when eth0 is unavailable?

Thanks

----------

## jopeto

I'm just a beginner as well, so if some of what I tell you below is wrong, hopefully someone more knowledgeable will jump in and correct me.

Regarding starting net.eth0 when booting you can try using the command

```
# rc-update add net.eth0 default
```

I don't know if that's what you are asking for, but ifplugd is a program which determines whether you have an ethernet cable plugged to your computer. If there isn't, then it skips directly to wireless. You can install it running

```
# emerge sys-apps/ifplugd
```

I don't think that my wired connection is started by wpa_supplicant. Here's my /etc/conf.d/net file for comparison:

```
dns_domain_lo="homenetwork"

config_eth0="dhcp"

modules="wpa_supplicant"

config_wlan0="dhcp"

wpa_cli_wlan0="-G3600"

wpa_supplicant_wlan0="-D nl80211"
```

I don't have a /etc/wpa_supplicant/wired.conf file.

----------

## khayyam

NewBieUser ...

I think the issue here is that you are using the same control_interface for both wlan0 and eth0 ... and from the wpa_supplicant manpage it would seem that control_interfaces are per interface.

So, change one or other config to create a seperate control_interface.

best ... khay

----------

