You are not logged in.

#1 2020-03-03 14:34:16

TheGasolineWillBeOurs
Member
Registered: 2015-02-06
Posts: 65

[SOLVED] Connect to wireless with wpa_supplicant

On a server I'm using wpa_supplicant to connect to a Wi-Fi. The Wi-Fi capability on the server is provided by a USB dongle. I followed the Wiki, but now I am stuck with an IP, but with no access to the outside world, and I don't know what to try next. What might (or not) complicate the problem is, that I'm connected with a laptop to the server, directly via ethernet (no router or switch in between) using ssh.

Here are the steps I did:

The output from ip link is:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 08:f1:ea:f0:b9:d6 brd ff:ff:ff:ff:ff:ff
3: enp2s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:f1:ea:f0:b9:d7 brd ff:ff:ff:ff:ff:ff
4: wlp0s18u1u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:92:ca:05:72:12 brd ff:ff:ff:ff:ff:ff

enp2s0f0 is the connection to my laptop. wlp0s18u1u3 I'm trying to connect to a Wi-Fi.

My /etc/wpa_supplicant/wpa_supplicant.conf was written with wpa_passphrase. It looks like this:

network={
	ssid="myssid"
	#psk="mypassword"
	psk=48a46cbfdbb467dd5ed1cefb0f18d4702ae1a83c651e310969c38571fb9bc77a
}

I would then try

wpa_supplicant -B -i wlp0s18u1u3 -c /etc/wpa_supplicant/wpa_supplicant.conf

which gives

Successfully initialized wpa_supplicant
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlp0s18u1u3 disabled_11b_rates=0
wlp0s18u1u3: Failed to initialize driver interface

So I try the wext driver

wpa_supplicant -B -i wlp0s18u1u3 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext

which gives me a few warnings

Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

but nonetheless, wpa_supplicant seems to be running.

Then I run dhclient wlp0s18u1u3. And this gives me an IP address, as ip addr show wlp0s18u1u3 shows:

4: wlp0s18u1u3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:92:ca:05:72:12 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.151/24 brd 192.168.43.255 scope global wlp0s18u1u3
       valid_lft forever preferred_lft forever
    inet6 fe80::292:caff:fe05:7212/64 scope link 
       valid_lft forever preferred_lft forever

The IP address looks reasonable, as my laptop has one in the same submask. I now can ping e.g. the laptops Wi-Fi IP. But I cannot ping e.g. 8.8.8.8. And here I am stuck. Any help would be very much appreciated.

Thanks!

Last edited by TheGasolineWillBeOurs (2020-03-03 14:46:55)

Offline

#2 2020-03-03 14:46:30

TheGasolineWillBeOurs
Member
Registered: 2015-02-06
Posts: 65

Re: [SOLVED] Connect to wireless with wpa_supplicant

Wow, that was easy, actually. Writing things down seem to have helped solving the problem:

Instead of dhclient, I use dhcpcd, and voila, everything works. I will mark this as solved, but if anyone knows why it didn't work with dhclient, I'm happy to hear it.

Offline

Board footer

Powered by FluxBB