LABORA-INF-UFG / paper-MACAK-2022

Untrusted non-3GPP access Wi-Fi use case is a proof-of-concept (PoC) of 5G core access network in which Wi-Fi technology is employed.
Apache License 2.0
10 stars 1 forks source link

How do I know my computer has nl80211 compatible wireless device, which supports the AP operating? #1

Closed manoj1919 closed 2 years ago

manoj1919 commented 2 years ago

Hi there, I was trying the following command to assign phy interfaces to name spaces: sudo ip netns exec APns bash and in the ns bash, I ran: echo $BASHPID and got 18990 as the PID. But when I run: sudo iw phy phy0 set netns 18990 I get the following error: command failed: No such file or directory (-2) I am not sure if this is because my WiFi module does not support some requisite function. sudo lshw -C network gives the following:


 *-network                 
       description: Wireless interface
       product: BCM4360 802.11ac Wireless Network Adapter
       vendor: Broadcom Inc. and subsidiaries
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 03
       serial: 64:5a:ed:ed:96:25
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) ip=192.168.0.106 latency=0 multicast=yes wireless=IEEE 802.11
       resources: irq:18 memory:a0600000-a0607fff memory:a0400000-a05fffff

Can you please help me identify the Issue here. How do I check if my device is compatible or not. Thank you in advance, Manoj

manoj1919 commented 2 years ago

To add to the above question, following command returns nl80211 not found Screenshot from 2021-11-08 16-50-56

mariotlemes commented 2 years ago

Hello,

Your wireless device probably does not support the nl80211 driver.

I not found a relationship between devices/manufacturers that support the driver.

To know if the physical network card supports access point mode, you can interact with the iw tool. When you type iw list in the terminal you will see the supported interface modes. In this list there must be AP entry, which indicates access point mode support. The iw tool also relies nl80211 driver.

Can you try setting up the use case on another machine?

Mario

pragnyakiri commented 2 years ago

Hello,

I am also getting the same error on running "sudo iw phy phy0 set netns 2531". Error: "command failed: Operation not supported (-95)".

On running iw list, I am getting a long list of information.

Any pointers regarding this error will be helpful.

Thanks, Pradnya

mariotlemes commented 2 years ago

Hello,

I am also getting the same error on running "sudo iw phy phy0 set netns 2531". Error: "command failed: Operation not supported (-95)".

On running iw list, I am getting a long list of information.

Any pointers regarding this error will be helpful.

Thanks, Pradnya

Hello @pragnyakiri,

Please, after adding the simulated interfaces with mac80211_hwsim, type iw dev command and place here.

Regards, Mario

pragnyakiri commented 2 years ago

"iw dev" command gives the following output : phy#2 Unnamed/non-netdev interface wdev 0x200000002 addr 42:00:00:00:01:00 type P2P-device txpower 20.00 dBm Interface wlan1 ifindex 528 wdev 0x200000001 addr 02:00:00:00:01:00 type managed txpower 20.00 dBm phy#0 Interface wlp2s0 ifindex 3 wdev 0x1 addr a8:86:dd:ab:59:19 ssid Challenger type managed

Thanks, Pradnya

mariotlemes commented 2 years ago

"iw dev" command gives the following output : phy#2 Unnamed/non-netdev interface wdev 0x200000002 addr 42:00:00:00:01:00 type P2P-device txpower 20.00 dBm Interface wlan1 ifindex 528 wdev 0x200000001 addr 02:00:00:00:01:00 type managed txpower 20.00 dBm phy#0 Interface wlp2s0 ifindex 3 wdev 0x1 addr a8:86:dd🆎59:19 ssid Challenger type managed

Thanks, Pradnya

Hi Pradnya,

When i type the command 1 and after the command 2 , i got the output in the figure. Note that mac80211_hwsim creates 2 interfaces (wlan0 and wlan1). Then, after create the namespaces (APns, UPFns, UEns) and in another terminal, i got the bashpid related to APns (command 3). Finally, it is possible to isolate the wlan0 (phy0) to APns (command 4). The same process is applied to wlan1 (to isolate wlan1 for UEns).

Captura de Tela 2021-11-10 às 06 15 28

In my case, phy0 corresponds to wlan0 and phy1 corresponds to wlan1. You should consider the correct name of interfaces in your scenario.

Regards, Mario

pragnyakiri commented 2 years ago

Yes Mario,

I am following the exact steps that are given on the Wiki page. But still I am getting error on running "sudo iw phy phy0 set netns" command. Check out the screenshots with each step number. Screenshot 2021-11-10 at 3 14 13 PM Screenshot 2021-11-10 at 3 15 15 PM Screenshot 2021-11-10 at 3 23 46 PM

mariotlemes commented 2 years ago

Yes Mario,

I am following the exact steps that are given on the Wiki page. But still I am getting error on running "sudo iw phy phy0 set netns" command. Check out the screenshots with each step number. Screenshot 2021-11-10 at 3 14 13 PM Screenshot 2021-11-10 at 3 15 15 PM Screenshot 2021-11-10 at 3 23 46 PM

Hello Pradnya,

In your screenshot, wlan1 corresponds to phy4 and wlan0 corresponds to phy3.

Then, the correct comand in step 4 is: sudo iw phy phy3 set netns 2959. In this case, after this command, wlan0 is isolated in namespace 2959 (that corresponds to APns).

Regards, Mario

pragnyakiri commented 2 years ago

Yes, when I replaced phy0 with phy3 (sudo iw phy phy3 set netns 2959), the error got resolved. Thank you Mario.

In the subsequent steps, since we are killing all "wpa_supplicant"s, internet has stopped working on my machine. Is there any workaround to prevent this from happening ? Any pointers will be helpful.

Thanks, Pradnya

mariotlemes commented 2 years ago

In the subsequent steps, since we are killing all "wpa_supplicant"s, internet has stopped working on my machine.

Skip this step (kill wpa_supplicant) and try to continue with the tutorial.

Are you using an external wi-fi network card (e.g. usb wireless card) in your computer?

Mario

pragnyakiri commented 2 years ago

Thanks Mario,

The workaround worked. And i could finish all steps without any errors.