Results 1 to 6 of 6

Thread: WLAN Id Numbers

  1. #1
    Join Date
    2015-Dec
    Posts
    15

    WLAN Id Numbers

    Hi, is it possible to have KALI identify ALWAYS with the same number the different WLAN adapters?

    I run KALI 2016.2 with:
    - an internal wifi card
    - an usb TP-LINK adapter
    - an usb ALFA adapter

    What i see now is that each adapter is randomly assigned a WLAN Id, for example:
    Internal = WLAN2
    TP-LINK = WLAN1
    ALFA = WLAN0

    After each reboot this situation changes.

    I'd need to have ALWAYS this situation:
    Internal = WLAN0
    TP-LINK = WLAN1
    ALFA = WLAN2

  2. #2
    Join Date
    2013-Jul
    Posts
    844
    To JackBauer

    You could try this and see if it works. Boot the computer with no usb wifi devices connected then once running plug in TP link and see if it gets assigned wlan1 then plug in Alpha and see if it get assigned wlan2

    MTeams

  3. #3
    Join Date
    2015-Dec
    Posts
    15
    Thanks MM33, following your suggestion i get desired WLAN Id's, BUT my specific need is to boot Kali with all USB Wifi Adapters ALREADY plugged in: in this case i usually get this situation:
    ALFA=WLAN0
    TP-LINK=WLAN1
    Internal=WLAN2

    It seems that "somewhere" Kali has stored this association, linking each WLAN Id to each specific adapter.

  4. #4
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    Create "/etc/udev/rules.d/70-persistent-net.rules" and add rules to clearly identify the adapter (e.g. using the port, slot, driver, etc.) and assign the name of your choice.

    Below an example rules file running on a Raspberry Pi, used to assign wlanX where X is the number of the USB port the adapter is plugged into:

    # Assign wlan name according to the usb port used (2-5), 0 for internal
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="1-1.2:1.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="1-1.3:1.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan3"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="1-1.4:1.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan4"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="1-1.5:1.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan5"


    Just run udevadm info -a /sys/class/net/wlan0, etc. and find the best attributes to use for your rules.

  5. #5
    Join Date
    2015-Dec
    Posts
    15
    Ok, thanks.
    I think the mac address is a good attribute, so a rule would be:
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:86:f1:65:d5", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

    Do I need to restart the service with:
    sudo service udev restart
    ?

  6. #6
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    445
    Quickest to reboot.
    You could unplug the USB adapters, reload the rules and plug them back in but for the internal cards you have to stop the network, unload the drivers, reload the rules, trigger the rules, reload the drivers, start the network... -Just bounce it

Similar Threads

  1. what do the numbers kali1-6 indicate?
    By mjrarcher in forum General Archive
    Replies: 1
    Last Post: 2020-09-02, 20:14
  2. Replies: 0
    Last Post: 2014-08-04, 15:46
  3. Replies: 5
    Last Post: 2014-07-06, 01:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •