Skip to content

Instantly share code, notes, and snippets.

@ammgws
Last active June 8, 2020 14:49
Show Gist options
  • Save ammgws/c50029b9f879d754f80460ae45018054 to your computer and use it in GitHub Desktop.
Save ammgws/c50029b9f879d754f80460ae45018054 to your computer and use it in GitHub Desktop.
virtual wifi for testing

create wpa_supplicant.conf somewhere

network={
    ssid="meow"
    key_mgmt=NONE
    priority=16
}
ctrl_interface=/run/wpa_supplicant
update_config=1

create hostapd.conf somewhere

interface=wlan1
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface_group=0
ssid=meow
country_code=US
hw_mode=g
channel=1
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1

Running:

  1. sudo modprobe mac80211_hwsim
  2. sudo hostapd /path/to/hostapd.conf
  3. sudo wpa_supplicant -Dnl80211 -iwlan0 -c/path/to/wpa_supplicant.conf

Example using wpa_cli to get ssid info: sudo wpa_cli status -iwlan0 | sed -n 's/^ssid=\\(.*\\)/\\1/p'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment