Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cant ap mode enable #16

Open
Hzone-glitch opened this issue May 9, 2023 · 3 comments
Open

i cant ap mode enable #16

Hzone-glitch opened this issue May 9, 2023 · 3 comments

Comments

@Hzone-glitch
Copy link

Hzone-glitch commented May 9, 2023

hi there
i use your wpa_supplicant.conf and the final command doesnt work ! ()
i change channel and ssid ; not work.
Screenshot_2023-05-09_22_35_00
Screenshot_2023-05-09_23_04_24
Screenshot_2023-05-09_23_04_43

please help me.
(WN722n v3)
and then i use this config . but client dont connect to ap !

interface=wlan0
driver=nl80211
ssid=wpa3
hw_mode=g
channel=7
macaddr_acl=0
ignore_broadcast_ssid=0

@xiv3r
Copy link

xiv3r commented May 9, 2023 via email

@ivanovborislav
Copy link
Owner

Hi!
Create bash script "ap-enable.sh":

#!/bin/bash

ip addr flush dev "$1"
ip addr add 192.168.100.1/24 dev "$1"

killall dnsmasq
dnsmasq --conf-file=/dev/null --interface="$1" --bind-interfaces --except-interface=lo --dhcp-range=192.168.100.100,192.168.100.149

sysctl -w net.ipv4.ip_forward=1
iptables -A FORWARD -i "$1" -o eth0 -j ACCEPT
iptables -A FORWARD -i  eth0 -o "$1" -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

killall hostapd
hostapd -i "$1" "$2"

chmod +x ap-enable.sh

Create conf file "hostapd.conf":

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
driver=nl80211
ssid=WPA3 #change this or the network name will be "WPA3"
country_code=EN
channel=6
beacon_int=100
dtim_period=1
fragm_threshold=2346
rts_threshold=2347
hw_mode=g
ieee80211n=1
max_num_sta=16
wmm_enabled=1
ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40][RX-STBC1][MAX-AMSDU-7935][DSSS_CCK-40]
ignore_broadcast_ssid=0

auth_algs=1
wpa=2
wpa_key_mgmt=SAE
wpa_pairwise=CCMP
rsn_pairwise=CCMP
ieee80211w=2
sae_groups=19 20 21
sae_require_mfp=1
wpa_passphrase=1234567890 #change this or the password will be "1234567890"

Enable AP - run:
sudo ./ap-enable wlan0 hostapd.conf

and "ap-disable.sh" script :

#!/bin/bash

killall hostapd

ip addr flush dev "$1"

killall dnsmasq

sysctl -w net.ipv4.ip_forward=0
iptables -D FORWARD -i "$1" -o eth0 -j ACCEPT
iptables -D FORWARD -i  eth0 -o "$1" -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

chmod +x ap-disable.sh

Disable AP - run:
sudo ./ap-disable wlan0

Client config file "wpa_supplicant.conf":

update_config=1
ctrl_interface=/var/run/wpa_supplicant
country=EN
p2p_no_group_iface=1
sae_groups=19 20 21

network={
    ssid="WPA3"
    proto=RSN
    key_mgmt=SAE
    pairwise=CCMP
    group=CCMP
    ieee80211w=2
    psk="1234567890"
}

@zenbooster
Copy link

Work on 5.15.0-1038-raspi ! ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants