I have a Linux machine that creates a Wifi hotspot. I need to simulate a few clients connecting to that hotspot and then using that connectiong to talk to a service, through the wlan interface. The service is running in it's own process and the clients would be connecting from another process. Is there a way to achieve this? Something like create another interface on the same subnet as the wlan? Thanks
Have a look at the
mac80211_hwsim kernel module. This module simulates a number of virtual "radios" (wifi cards, or
phys) that communicate with each other. E.g.,
modprobe mac80211_hwsim radios=3
will give you 3 of those. Use
iw dev to view them and see their MAC address. Then you can use
ip to configure them, and simulate an access point and as many clients as you want. You'll also get a
hwsim0 interface of
ieee802.11/radiotap type, and you can run
wireshark on it to see the messages that go through the "virtual" air.
If the software you are using on the wireless network interfaces can't bind to specific interfaces, consider putting it into a network namespace for each client.