The WiFi / 802.11 virtual interface is similar to VETH on Linux

I am looking for a way to configure a purely virtual (i.e. no real signal) 802.11 network on a single device - for testing purposes in such a way as to give me the same functionality:

  • create multiple access point interfaces (say ap0, ap1..)
    • set their main parameters ( ssid...)
    • configure the dhcp server on each of them,
    • control signal level using shell command ( iw?)
    • enable cryptography management (change passwords, encryption methods, etc.)
  • create a client interface with a single access point ( wifi0), which
    • see specific access points (or all)
    • Let me connect to a specific interface using tools like NetworkManager

It is very simple, in fact, and to see how the driver vethworks with ip link, gave me high hopes.

is it possible at all with iw tool? if yes - how to do it?

If not, how would I usually pursue this question if I needed to implement this? by creating a fake wpa_supplicant driver that transfers data?

I would be grateful for any hints and directions on this issue.

+4
source share
2 answers

I tried to follow the prompts published by Stefano Kappa, with no luck. My interfaces are constantly reporting No valid interface combinationsthat say I should be stuck (but not been).

WIFI

  • mac80211_hwsim
    • radios, (phy#).
    • phy# .
    • phy# LAN- (wlan#).
    • hwsim#, -Wi-Fi .
  • hostapd , ( ) ,
  • wpa_supplicant, .

( , Android), . nl80211 - .

:

hostapd.conf ( : , , )

interface=wlan1
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface_group=0
ssid=Vamonos Pest
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

wpa_supplicant.conf

network={
    ssid="Vamonos Pest"
    key_mgmt=NONE
    priority=16
}

, :

hostapd -d hostapd.conf 
wpa_supplicant -Dnl80211 -iwlan0 -d -csupplicant.conf

. wpa_supplicant Wi-Fi. , hwsim . - dhcp wlan1, dhcp client wlan0, .

+4

, .

iw , , Wi-Fi- .

" " ( "phy" ):

iw phy phy0 info

.

, , , wpa_supplicant ( Wi-Fi). wpa_supplicant, : http://lists.shmoo.com/pipermail/hostap/

. Nexus 5 Android wpa_supplicant. iw Android, :

> iw phy phy0 info
Supported interface modes:
              * IBSS
              * managed
              * AP
              * P2P-client
              * P2P-GO
     software interface modes (can always be added):
     valid interface combinations:
              * #{ managed } <= 2, #{ P2P-client, P2P-GO } <= 2, #{ IBSS } <= 1,
                total <= 3, #channels <= 2


 >iw dev
     phy#0
     Interface p2p1
             ifindex 24
             type managed
     Interface wlan0
             ifindex 21
             type managed
     Interface p2p0
             ifindex 20
             type managed

, Linux, . .

, , , , wpa_supplicant, veth 802.11, , , nl80211, macvtap ip-.

0

Source: https://habr.com/ru/post/1611347/


All Articles