anfractuosity
Posts: 25
Joined: Wed Jun 21, 2017 7:23 am

Pi 3 B+ using ad-hoc wifi with WPA?

Wed Jul 04, 2018 6:46 am

I can create an ad-hoc network with WEP fine, doing the following:

Code: Select all

auto wlan0
iface wlan0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  wireless-channel 11
  wireless-essid mesh
  wireless-mode ad-hoc
  wireless-key <wep key>
However, when trying to use WPA with wpa_supplicant I simply can't seem to get it to work:

Code: Select all

ap_scan=2

network={
    ssid="mesh"
    mode=1
    frequency=2432
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    group=CCMP
    psk="secret passphrase"
}
From - https://wiki.archlinux.org/index.php/ad-hoc_networking

I get 'iface validation failed: err=-16' in dmesg. Anyone got any ideas?

mutrised
Posts: 44
Joined: Thu Nov 08, 2012 12:41 am
Location: France

Re: Pi 3 B+ using ad-hoc wifi with WPA?

Thu Jul 05, 2018 3:16 pm

I had a hard time to trying to setup UP WPA2 on my pi, but finaly, I think you have too many options.

I got some similar config but they were not working. The one I got now:

Code: Select all

network={
    ssid="Mxxxxx"
    psk="passphrase"
    priority=1
    id_str="home"
}
Other option may be set by the OS by itself if not specified. It worked this way for me.
Hope this will help ;)
RPI2B 7/24 - web, NAS/media, Owncloud and more
RPI0 7/24 - VPN, DHCP, DNS (including filtering), wakeonlan proxy
RPI0W - VPN gateway providing secure WIFI AP and network router, some kind of internet BOX when on the move ;)

anfractuosity
Posts: 25
Joined: Wed Jun 21, 2017 7:23 am

Re: Pi 3 B+ using ad-hoc wifi with WPA?

Fri Jul 06, 2018 4:10 pm

Thanks, I believe those options are necessary though to create the ad-hoc network, especially the mode=1 one and it's also necessary to specify a frequency too, so they're all on the same channel for me.

mutrised
Posts: 44
Joined: Thu Nov 08, 2012 12:41 am
Location: France

Re: Pi 3 B+ using ad-hoc wifi with WPA?

Tue Jul 10, 2018 2:46 pm

My bad, I missed the ad hoc bit...
Sorry if I missed it again...

I set up a wifi access point with hostapd for some kind or VPN access point. It provides WPA2 hotspot creation.
But I didn't set it up with wap_supplicatn file which I believed was only used to connect to an existing wifi network.

Here what I got into /etc/hostapd/hostapd.conf

Code: Select all

country_code=FR
ieee80211n=1
ieee80211d=1
interface=wlx086axxxxx
bridge=br0
hw_mode=g
channel=8
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP TKIP
rsn_pairwise=CCMP

ssid=XXXXX
wpa_passphrase=XXXXX
It works like a charm. I may help you I hope
RPI2B 7/24 - web, NAS/media, Owncloud and more
RPI0 7/24 - VPN, DHCP, DNS (including filtering), wakeonlan proxy
RPI0W - VPN gateway providing secure WIFI AP and network router, some kind of internet BOX when on the move ;)

anfractuosity
Posts: 25
Joined: Wed Jun 21, 2017 7:23 am

Re: Pi 3 B+ using ad-hoc wifi with WPA?

Wed Jul 11, 2018 7:59 pm

That seems to use AP mode I'm afraid, rather than let you use ad-hoc mode.

Return to “Networking and servers”