JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Fri Dec 01, 2017 6:49 pm

sparkie777 wrote:
Thu Nov 30, 2017 4:26 am
@JacoFourie:

if you don't want to use MAC addresses (because they are too specific) you could setup a file with a more generous rule specification (probably sufficient in your case):

/etc/udev/rules.d/72-static-name.rules:

Code: Select all

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="brcmfmac", NAME="wlan1"
this allows your dongle to allocate wlan0 since the onboard wlan is forced to wlan1

This did not work. The 2 still swap around randomly. I will test the new method.

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Fri Dec 01, 2017 8:02 pm

JacoFourie wrote:
Fri Dec 01, 2017 6:49 pm
This did not work. The 2 still swap around randomly. I will test the new method.
strange. what installation/distribution do you use? what did you configure manually?

could you please show the output of commands

Code: Select all

egrep -r wlan /etc/udev /lib/udev
udevadm test /sys/class/net/wlan0
udevadm test /sys/class/net/wlan1

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Sat Dec 02, 2017 4:13 pm

Code: Select all

egrep -r wlan /etc/udev /lib/udev
/etc/udev/rules.d/72-static-name.rules:ACTION=="add", SUBSYSTEM=="net", DRIVERS=="brcmfmac", NAME==“wlan0"
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=wlan                                   # (toggle) on-to-off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d6=wlan                                   # (toggle) off-to-on
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_6e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_84=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_84=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_88=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d6=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_e1=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f3=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d7=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f8=wlan                                   # Wireless HW switch button
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f8=wlan                                   # Wireless HW switch button
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_04=wlan                                   # Fn+F5
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_900f1=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_04=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_090014=wlan                               # Fn+F5
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_96=wlan                                   # Fn+F5 wireless
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f6=wlan                                   # satellite dish1
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_fb=wlan                                   # Fn+J
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_8e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_86=!wlan                                  # Fn+F9
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_b4=!wlan                                  # Fn+F9 (X60P)
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 wlan/airplane switch
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 Wi-Fi toggle
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 wlan/airplane switch
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d4=wlan                                   # RF Switch Off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_9e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f1=wlan                                   # RF Switch Off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f2=wlan                                   # RF Switch On
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Newland Design + Assoc. Inc.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Auto-ID Tech. Co,.Ltd.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Communication Science Technologies Co.,Ltd.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Computer Ltd. Co.
Binary file /lib/udev/hwdb.bin matches

Code: Select all

pi@RHControl1:~ $ udevadm test /sys/class/net/wlan0
calling: test
version 232
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

=== trie on-disk ===
tool version:          232
file size:         8574469 bytes
header size             80 bytes
strings            1848133 bytes
nodes              6726256 bytes
Load module index
Found container virtualization none
timestamp of '/etc/systemd/network' changed
Skipping overridden file: /lib/systemd/network/99-default.link.
Skipping empty file: /etc/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
timestamp of '/lib/udev/rules.d' changed
Reading rules file: /lib/udev/rules.d/10-local-rpi.rules
Reading rules file: /lib/udev/rules.d/15-i2c-modprobe.rules
Reading rules file: /lib/udev/rules.d/15-rfkill.rules
Reading rules file: /lib/udev/rules.d/40-usb_modeswitch.rules
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules
Reading rules file: /lib/udev/rules.d/55-dm.rules
Reading rules file: /lib/udev/rules.d/60-block.rules
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /lib/udev/rules.d/60-crda.rules
Reading rules file: /lib/udev/rules.d/60-drm.rules
Reading rules file: /lib/udev/rules.d/60-evdev.rules
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /lib/udev/rules.d/60-serial.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules
Reading rules file: /lib/udev/rules.d/69-libmtp.rules
Reading rules file: /lib/udev/rules.d/70-debian-uaccess.rules
Reading rules file: /lib/udev/rules.d/70-mouse.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules
Reading rules file: /lib/udev/rules.d/70-touchpad.rules
Reading rules file: /lib/udev/rules.d/70-uaccess.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /etc/udev/rules.d/72-static-name.rules
invalid key/value pair in file /etc/udev/rules.d/72-static-name.rules on line 1,                                                                                                                      starting at character 53 (',')
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
Reading rules file: /lib/udev/rules.d/73-special-net-names.rules
Reading rules file: /lib/udev/rules.d/73-usb-net-by-mac.rules
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules
Reading rules file: /lib/udev/rules.d/80-debian-compat.rules
Reading rules file: /lib/udev/rules.d/80-drivers.rules
Reading rules file: /lib/udev/rules.d/80-ifupdown.rules
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /lib/udev/rules.d/85-hwclock.rules
Reading rules file: /lib/udev/rules.d/85-regulatory.rules
Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /lib/udev/rules.d/90-console-setup.rules
Reading rules file: /etc/udev/rules.d/90-wireless.rules
invalid key/value pair in file /etc/udev/rules.d/90-wireless.rules on line 2, st                                                                                                                     arting at character 54 (',')
Reading rules file: /lib/udev/rules.d/97-hid2hci.rules
Reading rules file: /etc/udev/rules.d/99-com.rules
Reading rules file: /lib/udev/rules.d/99-systemd.rules
rules contain 196608 bytes tokens (16384 * 12 bytes), 20930 bytes strings
13903 strings (113100 bytes), 11775 de-duplicated (94299 bytes), 2129 trie nodes                                                                                                                      used
IMPORT builtin 'net_id' /lib/udev/rules.d/75-net-description.rules:6
RUN 'ifupdown-hotplug' /lib/udev/rules.d/80-ifupdown.rules:5
IMPORT builtin 'path_id' /lib/udev/rules.d/80-net-setup-link.rules:5
IMPORT builtin 'net_setup_link' /lib/udev/rules.d/80-net-setup-link.rules:9
No matching link configuration found.
RUN '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv                                                                                                                     4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name' /lib                                                                                                                     /udev/rules.d/99-systemd.rules:56
ACTION=add
DEVPATH=/devices/platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0
DEVTYPE=wlan
ID_NET_DRIVER=brcmfmac
ID_NET_NAME_MAC=wlxb827eb07d1fc
ID_OUI_FROM_DATABASE=Raspberry Pi Foundation
ID_PATH=platform-3f300000.mmc
ID_PATH_TAG=platform-3f300000_mmc
IFINDEX=3
INTERFACE=wlan0
SUBSYSTEM=net
SYSTEMD_ALIAS=/sys/subsystem/net/devices/wlan0
TAGS=:systemd:
USEC_INITIALIZED=4014500
run: 'ifupdown-hotplug'
run: '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/wlan0 --prefix=/net/ipv4/neigh/wlan0 --prefix=/net/ipv6/conf/wlan0 --prefix=/net/ipv6/neigh/wlan0'
Unload module index
Unloaded link configuration context.

Code: Select all

pi@RHControl1:~ $ udevadm test /sys/class/net/wlan1
calling: test
version 232
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

=== trie on-disk ===
tool version:          232
file size:         8574469 bytes
header size             80 bytes
strings            1848133 bytes
nodes              6726256 bytes
Load module index
Found container virtualization none
timestamp of '/etc/systemd/network' changed
Skipping overridden file: /lib/systemd/network/99-default.link.
Skipping empty file: /etc/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
timestamp of '/lib/udev/rules.d' changed
Reading rules file: /lib/udev/rules.d/10-local-rpi.rules
Reading rules file: /lib/udev/rules.d/15-i2c-modprobe.rules
Reading rules file: /lib/udev/rules.d/15-rfkill.rules
Reading rules file: /lib/udev/rules.d/40-usb_modeswitch.rules
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules
Reading rules file: /lib/udev/rules.d/55-dm.rules
Reading rules file: /lib/udev/rules.d/60-block.rules
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /lib/udev/rules.d/60-crda.rules
Reading rules file: /lib/udev/rules.d/60-drm.rules
Reading rules file: /lib/udev/rules.d/60-evdev.rules
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /lib/udev/rules.d/60-serial.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules
Reading rules file: /lib/udev/rules.d/69-libmtp.rules
Reading rules file: /lib/udev/rules.d/70-debian-uaccess.rules
Reading rules file: /lib/udev/rules.d/70-mouse.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules
Reading rules file: /lib/udev/rules.d/70-touchpad.rules
Reading rules file: /lib/udev/rules.d/70-uaccess.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /etc/udev/rules.d/72-static-name.rules
invalid key/value pair in file /etc/udev/rules.d/72-static-name.rules on line 1, starting at character 53 (',')
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
Reading rules file: /lib/udev/rules.d/73-special-net-names.rules
Reading rules file: /lib/udev/rules.d/73-usb-net-by-mac.rules
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules
Reading rules file: /lib/udev/rules.d/80-debian-compat.rules
Reading rules file: /lib/udev/rules.d/80-drivers.rules
Reading rules file: /lib/udev/rules.d/80-ifupdown.rules
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /lib/udev/rules.d/85-hwclock.rules
Reading rules file: /lib/udev/rules.d/85-regulatory.rules
Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /lib/udev/rules.d/90-console-setup.rules
Reading rules file: /etc/udev/rules.d/90-wireless.rules
invalid key/value pair in file /etc/udev/rules.d/90-wireless.rules on line 2, starting at character 54 (',')
Reading rules file: /lib/udev/rules.d/97-hid2hci.rules
Reading rules file: /etc/udev/rules.d/99-com.rules
Reading rules file: /lib/udev/rules.d/99-systemd.rules
rules contain 196608 bytes tokens (16384 * 12 bytes), 20930 bytes strings
13903 strings (113100 bytes), 11775 de-duplicated (94299 bytes), 2129 trie nodes used
IMPORT builtin 'net_id' /lib/udev/rules.d/75-net-description.rules:6
IMPORT builtin 'usb_id' /lib/udev/rules.d/75-net-description.rules:8
/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0: if_class 255 protocol 0
IMPORT builtin 'hwdb' /lib/udev/rules.d/75-net-description.rules:8
RUN 'ifupdown-hotplug' /lib/udev/rules.d/80-ifupdown.rules:5
IMPORT builtin 'path_id' /lib/udev/rules.d/80-net-setup-link.rules:5
IMPORT builtin 'net_setup_link' /lib/udev/rules.d/80-net-setup-link.rules:9
No matching link configuration found.
RUN '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name' /lib/udev/rules.d/99-systemd.rules:56
ACTION=add
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/net/wlan1
DEVTYPE=wlan
ID_BUS=usb
ID_MODEL=802.11n_WLAN_Adapter
ID_MODEL_ENC=802.11n\x20WLAN\x20Adapter
ID_MODEL_FROM_DATABASE=EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
ID_MODEL_ID=7811
ID_NET_DRIVER=rtl8192cu
ID_NET_NAME_MAC=wlx74da388bb61d
ID_OUI_FROM_DATABASE=Edimax Technology Co. Ltd.
ID_PATH=platform-3f980000.usb-usb-0:1.4:1.0
ID_PATH_TAG=platform-3f980000_usb-usb-0_1_4_1_0
ID_REVISION=0200
ID_SERIAL=Realtek_802.11n_WLAN_Adapter_00e04c000001
ID_SERIAL_SHORT=00e04c000001
ID_TYPE=generic
ID_USB_DRIVER=rtl8192cu
ID_USB_INTERFACES=:ffffff:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=Realtek
ID_VENDOR_ENC=Realtek
ID_VENDOR_FROM_DATABASE=Edimax Technology Co., Ltd
ID_VENDOR_ID=7392
IFINDEX=4
INTERFACE=wlan1
SUBSYSTEM=net
SYSTEMD_ALIAS=/sys/subsystem/net/devices/wlan1
TAGS=:systemd:
USEC_INITIALIZED=4164857
run: 'ifupdown-hotplug'
run: '/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/wlan1 --prefix=/net/ipv4/neigh/wlan1 --prefix=/net/ipv6/conf/wlan1 --prefix=/net/ipv6/neigh/wlan1'
Unload module index
Unloaded link configuration context.

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Sat Dec 02, 2017 8:18 pm

thanks for the debug output, saying:

Code: Select all

invalid key/value pair in file /etc/udev/rules.d/72-static-name.rules on line 1, starting at character 53 (',')
this is because you unfortunately typed 'NAME=="wlan0"' instead of 'NAME="wlan1"'.

that's why the file is simply ignored and it of course won't work. Please remove one '='.
In addition to that you must write 'wlan1' (and not 'wlan0'). You can't use 'wlan0' here.
If you want to assign 'wlan0' to the internal wifi and 'wlan1' to your dongle you must resort to the full blown ruleset explained in my [HOWTO]

last but not least there is another strange message:

Code: Select all

invalid key/value pair in file /etc/udev/rules.d/90-wireless.rules on line 2, starting at character 54 (',')
I don't know what file this is. Created you this yourself? Is there some harmful content in it? Could you please post the contents? Thanks.
Last edited by sparkie777 on Sat Dec 02, 2017 8:57 pm, edited 1 time in total.

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Sat Dec 02, 2017 8:42 pm

It is for the AP stuff. I did not get the AP up yet. This is what is in the file.

Code: Select all

ACTION=="add", SUBSYSTEM=="ieee80211", KERNEL=="phy0", \
    RUN+="/sbin/iw phy %k interface add uap0 type __ap”

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Sat Dec 02, 2017 8:46 pm

as far as I know rules like this may not span several lines. '\' is not allowed.

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Sun Dec 03, 2017 8:00 pm

Sparkie is seems your method in your tutorial works 100%. Thank you sooooo much. I will monitor it and give feedback but it seems to have the wlan devices locked into their spots.


JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Sun Dec 03, 2017 8:30 pm

Mmmmm I spoke to soon. After a couple of reboots why is it creating a new adapter ? rename5: why is it there ?

Code: Select all

pi@RHControl1:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.64.9.129  netmask 255.255.255.0  broadcast 10.64.9.255
        inet6 fe80::71bb:5c00:5d8:9e31  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:d8:95:6e  txqueuelen 1000  (Ethernet)
        RX packets 1403  bytes 217404 (212.3 KiB)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 92  bytes 15711 (15.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        inet6 fe80::10b1:36dc:ced0:5a73  prefixlen 64  scopeid 0x20<link>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 671  bytes 53901 (52.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 671  bytes 53901 (52.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rename5: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:8d:c0:3b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.64.9.130  netmask 255.255.255.0  broadcast 10.64.9.255
        inet6 fe80::15ff:2392:e171:c25  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:8d:c0:3b  txqueuelen 1000  (Ethernet)
        RX packets 757  bytes 175725 (171.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46  bytes 7165 (6.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.20  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::91b:1cf9:15:7aae  prefixlen 64  scopeid 0x20<link>
        ether 74:da:38:6b:98:1e  txqueuelen 1000  (Ethernet)
        RX packets 348  bytes 70648 (68.9 KiB)
        RX errors 0  dropped 20  overruns 0  frame 0
        TX packets 35  bytes 5306 (5.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Sun Dec 03, 2017 8:52 pm

dependent on your configuration/distribution the (re)naming history is recorded in '/var/log/messages' and/or can be retrieved by the 'dmesg' command.

I guess 'rename5' is still there and listed for some reason (has been renamed later to wlan0 in the course of initialization) but it shouldn't hurt. Do you observe any malfunction with wlan0/ wlan1?

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Mon Dec 04, 2017 6:51 am

Hi. I am not sure what to do to check. All seems fine.

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Mon Dec 04, 2017 7:15 am

possibly a bug in the 'udev' subsystem you won't notice unless issuing 'ifconfig' (or even better 'ifconfig -a' or 'ip a')

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Thu Dec 14, 2017 1:41 pm

I have one Pi that does not want to set the dongle to wlan1. Why would it do that ?

The dongle is in at USB position 4 or where wlan2 would be. It makes the onboard "rename4" and the dongle wlan0.

Code: Select all

pi@oond15:~ $ lsusb
Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 006: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)
Bus 001 Device 005: ID 1ffb:0083
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

pi@oond15:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:23:5c:66
          inet6 addr: fe80::6e2b:d67d:7049:495/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:125069 errors:0 dropped:0 overruns:0 frame:0
          TX packets:125069 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:12202181 (11.6 MiB)  TX bytes:12202181 (11.6 MiB)

rename4   Link encap:Ethernet  HWaddr b8:27:eb:76:09:33
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:3 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:478 (478.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 74:da:38:6b:98:17
          inet addr:192.168.1.56  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2461:dbde:5c51:1432/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10237 errors:0 dropped:161 overruns:0 frame:0
          TX packets:5055 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1428030 (1.3 MiB)  TX bytes:555974 (542.9 KiB)

Code: Select all

pi@oond15:~ $ egrep -r wlan /etc/udev /lib/udev
/etc/udev/rules.d/72-wlan-geo-dependent.rules:# | wlan1 | wlan2 |
/etc/udev/rules.d/72-wlan-geo-dependent.rules:# | wlan3 | wlan4 |
/etc/udev/rules.d/72-wlan-geo-dependent.rules:# | wlan0 | (onboard wifi)
/etc/udev/rules.d/72-wlan-geo-dependent.rules:ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="sdio", KERNELS=="mmc1:0001:1", NAME="wlan0"
/etc/udev/rules.d/72-wlan-geo-dependent.rules:#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.2",       NAME="wlan1"
/etc/udev/rules.d/72-wlan-geo-dependent.rules:ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.4",       NAME="wlan1"
/etc/udev/rules.d/72-wlan-geo-dependent.rules:#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.3",       NAME="wlan3"
/etc/udev/rules.d/72-wlan-geo-dependent.rules:#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.5",       NAME="wlan4"
/lib/udev/rules.d/75-persistent-net-generator.rules:KERNEL=="wlan*", ATTRS{type}=="803",        GOTO="persistent_net_generator_end"
/lib/udev/rules.d/75-persistent-net-generator.rules.distrib:KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
/lib/udev/rules.d/75-persistent-net-generator.rules.distrib:KERNEL=="wlan*", ATTRS{type}=="803",        GOTO="persistent_net_generator_end"
Binary file /lib/udev/hwdb.bin matches
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=wlan                                   # (toggle) on-to-off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d6=wlan                                   # (toggle) off-to-on
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_6e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_84=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_84=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d6=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_e1=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f3=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d7=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f8=wlan                                   # Wireless HW switch button
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f8=wlan                                   # Wireless HW switch button
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_04=wlan                                   # Fn+F5
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_900f1=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_04=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_090014=wlan                               # Fn+F5
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_96=wlan                                   # Fn+F5 wireless
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f6=wlan                                   # satellite dish1
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_fb=wlan                                   # Fn+J
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_8e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_86=!wlan                                  # Fn+F9
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_b4=!wlan                                  # Fn+F9 (X60P)
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 wlan/airplane switch
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 Wi-Fi toggle
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d5=!wlan                                  # Fn+F12 wlan/airplane switch
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_d4=wlan                                   # RF Switch Off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_9e=wlan
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f1=wlan                                   # RF Switch Off
/lib/udev/hwdb.d/60-keyboard.hwdb: KEYBOARD_KEY_f2=wlan                                   # RF Switch On
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Computer Ltd. Co.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Newland Design + Assoc. Inc.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Communication Science Technologies Co.,Ltd.
/lib/udev/hwdb.d/20-OUI.hwdb: ID_OUI_FROM_DATABASE=Fujian Newland Auto-ID Tech. Co,.Ltd.

Code: Select all

pi@oond15:~ $ udevadm test /sys/class/net/wlan0
calling: test
version 215
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

load module index
Network interface NamePolicy= disabled on kernel commandline, ignoring.
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
read rules file: /lib/udev/rules.d/10-local-rpi.rules
read rules file: /etc/udev/rules.d/40-scratch.rules
read rules file: /lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
read rules file: /lib/udev/rules.d/50-firmware.rules
read rules file: /lib/udev/rules.d/50-udev-default.rules
read rules file: /lib/udev/rules.d/55-dm.rules
read rules file: /lib/udev/rules.d/60-cdrom_id.rules
read rules file: /lib/udev/rules.d/60-crda.rules
read rules file: /lib/udev/rules.d/60-drm.rules
read rules file: /lib/udev/rules.d/60-fuse.rules
read rules file: /lib/udev/rules.d/60-gnupg.rules
read rules file: /lib/udev/rules.d/60-keyboard.rules
read rules file: /lib/udev/rules.d/60-libgphoto2-6.rules
read rules file: /lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /lib/udev/rules.d/60-persistent-input.rules
read rules file: /lib/udev/rules.d/60-persistent-serial.rules
read rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
read rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /lib/udev/rules.d/60-persistent-storage.rules
read rules file: /lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /lib/udev/rules.d/60-triggerhappy.rules
read rules file: /lib/udev/rules.d/61-accelerometer.rules
read rules file: /lib/udev/rules.d/64-btrfs.rules
read rules file: /lib/udev/rules.d/64-xorg-xkb.rules
read rules file: /etc/udev/rules.d/69-control.rules
read rules file: /lib/udev/rules.d/69-libmtp.rules
read rules file: /lib/udev/rules.d/70-power-switch.rules
read rules file: /lib/udev/rules.d/70-uaccess.rules
read rules file: /lib/udev/rules.d/71-seat.rules
read rules file: /etc/udev/rules.d/72-wlan-geo-dependent.rules
read rules file: /lib/udev/rules.d/73-idrac.rules
read rules file: /lib/udev/rules.d/73-seat-late.rules
read rules file: /lib/udev/rules.d/75-net-description.rules
read rules file: /lib/udev/rules.d/75-persistent-net-generator.rules
read rules file: /lib/udev/rules.d/75-probe_mtd.rules
read rules file: /lib/udev/rules.d/75-tty-description.rules
read rules file: /lib/udev/rules.d/78-sound-card.rules
read rules file: /lib/udev/rules.d/80-drivers.rules
read rules file: /lib/udev/rules.d/80-net-setup-link.rules
read rules file: /lib/udev/rules.d/80-networking.rules
read rules file: /lib/udev/rules.d/80-udisks.rules
read rules file: /lib/udev/rules.d/80-udisks2.rules
read rules file: /lib/udev/rules.d/85-hdparm.rules
read rules file: /lib/udev/rules.d/85-hwclock.rules
read rules file: /lib/udev/rules.d/85-regulatory.rules
read rules file: /lib/udev/rules.d/90-alsa-restore.rules
read rules file: /lib/udev/rules.d/90-pulseaudio.rules
read rules file: /lib/udev/rules.d/95-udev-late.rules
read rules file: /lib/udev/rules.d/97-hid2hci.rules
read rules file: /etc/udev/rules.d/99-com.rules
read rules file: /lib/udev/rules.d/99-systemd.rules
rules contain 393216 bytes tokens (32768 * 12 bytes), 24113 bytes strings
23958 strings (193521 bytes), 21673 de-duplicated (171694 bytes), 2286 trie nodes used
IMPORT builtin 'net_id' /lib/udev/rules.d/75-net-description.rules:6
IMPORT builtin 'usb_id' /lib/udev/rules.d/75-net-description.rules:8
/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0: if_class 255 protocol 0
IMPORT builtin 'hwdb' /lib/udev/rules.d/75-net-description.rules:8
IMPORT builtin 'path_id' /lib/udev/rules.d/80-net-setup-link.rules:5
IMPORT builtin 'net_setup_link' /lib/udev/rules.d/80-net-setup-link.rules:11
Config file /lib/systemd/network/99-default.link applies to device wlan0
RUN 'net.agent' /lib/udev/rules.d/80-networking.rules:1
RUN '/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name' /lib/udev/rules.d/99-systemd.rules:61
unable to create temporary db file '/run/udev/data/n3.tmp': Permission denied
ACTION=add
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/net/wlan0
DEVTYPE=wlan
ID_BUS=usb
ID_MODEL=802.11n_WLAN_Adapter
ID_MODEL_ENC=802.11n\x20WLAN\x20Adapter
ID_MODEL_FROM_DATABASE=EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
ID_MODEL_ID=7811
ID_NET_DRIVER=rtl8192cu
ID_NET_NAME_MAC=wlx74da386b9817
ID_OUI_FROM_DATABASE=Edimax Technology Co. Ltd.
ID_PATH=platform-3f980000.usb-usb-0:1.2:1.0
ID_PATH_TAG=platform-3f980000_usb-usb-0_1_2_1_0
ID_REVISION=0200
ID_SERIAL=Realtek_802.11n_WLAN_Adapter_00e04c000001
ID_SERIAL_SHORT=00e04c000001
ID_TYPE=generic
ID_USB_DRIVER=rtl8192cu
ID_USB_INTERFACES=:ffffff:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=Realtek
ID_VENDOR_ENC=Realtek
ID_VENDOR_FROM_DATABASE=Edimax Technology Co., Ltd
ID_VENDOR_ID=7392
IFINDEX=3
INTERFACE=wlan0
SUBSYSTEM=net
SYSTEMD_ALIAS=/sys/subsystem/net/devices/wlan0
TAGS=:systemd:
USEC_INITIALIZED=3356
run: 'net.agent'
run: '/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/wlan0 --prefix=/proc/sys/net/ipv4/neigh/wlan0 --prefix=/proc/sys/net/ipv6/conf/wlan0 --prefix=/proc/sys/net/ipv6/neigh/wlan0'
unload module index
Unloaded link configuration context.

Code: Select all

pi@oond15:~ $ udevadm test /sys/class/net/wlan1
calling: test
version 215
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

load module index
Network interface NamePolicy= disabled on kernel commandline, ignoring.
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
read rules file: /lib/udev/rules.d/10-local-rpi.rules
read rules file: /etc/udev/rules.d/40-scratch.rules
read rules file: /lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
read rules file: /lib/udev/rules.d/50-firmware.rules
read rules file: /lib/udev/rules.d/50-udev-default.rules
read rules file: /lib/udev/rules.d/55-dm.rules
read rules file: /lib/udev/rules.d/60-cdrom_id.rules
read rules file: /lib/udev/rules.d/60-crda.rules
read rules file: /lib/udev/rules.d/60-drm.rules
read rules file: /lib/udev/rules.d/60-fuse.rules
read rules file: /lib/udev/rules.d/60-gnupg.rules
read rules file: /lib/udev/rules.d/60-keyboard.rules
read rules file: /lib/udev/rules.d/60-libgphoto2-6.rules
read rules file: /lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /lib/udev/rules.d/60-persistent-input.rules
read rules file: /lib/udev/rules.d/60-persistent-serial.rules
read rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
read rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /lib/udev/rules.d/60-persistent-storage.rules
read rules file: /lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /lib/udev/rules.d/60-triggerhappy.rules
read rules file: /lib/udev/rules.d/61-accelerometer.rules
read rules file: /lib/udev/rules.d/64-btrfs.rules
read rules file: /lib/udev/rules.d/64-xorg-xkb.rules
read rules file: /etc/udev/rules.d/69-control.rules
read rules file: /lib/udev/rules.d/69-libmtp.rules
read rules file: /lib/udev/rules.d/70-power-switch.rules
read rules file: /lib/udev/rules.d/70-uaccess.rules
read rules file: /lib/udev/rules.d/71-seat.rules
read rules file: /etc/udev/rules.d/72-wlan-geo-dependent.rules
read rules file: /lib/udev/rules.d/73-idrac.rules
read rules file: /lib/udev/rules.d/73-seat-late.rules
read rules file: /lib/udev/rules.d/75-net-description.rules
read rules file: /lib/udev/rules.d/75-persistent-net-generator.rules
read rules file: /lib/udev/rules.d/75-probe_mtd.rules
read rules file: /lib/udev/rules.d/75-tty-description.rules
read rules file: /lib/udev/rules.d/78-sound-card.rules
read rules file: /lib/udev/rules.d/80-drivers.rules
read rules file: /lib/udev/rules.d/80-net-setup-link.rules
read rules file: /lib/udev/rules.d/80-networking.rules
read rules file: /lib/udev/rules.d/80-udisks.rules
read rules file: /lib/udev/rules.d/80-udisks2.rules
read rules file: /lib/udev/rules.d/85-hdparm.rules
read rules file: /lib/udev/rules.d/85-hwclock.rules
read rules file: /lib/udev/rules.d/85-regulatory.rules
read rules file: /lib/udev/rules.d/90-alsa-restore.rules
read rules file: /lib/udev/rules.d/90-pulseaudio.rules
read rules file: /lib/udev/rules.d/95-udev-late.rules
read rules file: /lib/udev/rules.d/97-hid2hci.rules
read rules file: /etc/udev/rules.d/99-com.rules
read rules file: /lib/udev/rules.d/99-systemd.rules
rules contain 393216 bytes tokens (32768 * 12 bytes), 24113 bytes strings
23958 strings (193521 bytes), 21673 de-duplicated (171694 bytes), 2286 trie nodes used
unable to open device '/sys/class/net/wlan1'
unload module index
Unloaded link configuration context.

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Thu Dec 14, 2017 2:12 pm

is that an official stretch installation?
I ask because a file:

Code: Select all

/lib/udev/rules.d/75-persistent-net-generator.rules
exists but should not be there any longer.

there appears a strange error message

Code: Select all

unable to create temporary db file '/run/udev/data/n3.tmp': Permission denied
may be some system relevant things have been altered manually?

last but not least you wrote:
/etc/udev/rules.d/72-wlan-geo-dependent.rules:

Code: Select all

ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="sdio", KERNELS=="mmc1:0001:1", NAME="wlan0"
#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.2",       NAME="wlan1"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.4",       NAME="wlan1"
#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.3",       NAME="wlan3"
#ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.5",       NAME="wlan4"
please do not do that. Leave all lines intact (i.e. do not encomment any lines). But you are allowed to exchange the names of the interfaces.

If you use only one additional dongle consider to apply

Code: Select all

ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="sdio", KERNELS=="mmc1:0001:1", NAME="wlan0"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.2",       NAME="wlan1"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.4",       NAME="wlan1"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.3",       NAME="wlan1"
ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb",  KERNELS=="1-1.5",       NAME="wlan1"
the additional dongle is named wlan1 then no matter where it is placed.

I added this section here

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Thu Dec 14, 2017 2:25 pm

No this is a Jessie install. OK I will change the file as stated and test. I have a bunch of Pi's out in the field. They are still on Jessie. I created 5 new ones and they all seem to work with the config. But they are stretch images.

JacoFourie
Posts: 87
Joined: Thu Mar 10, 2016 6:51 pm

Re: How do you force a wifi interface to be a certain wlanX?

Fri Dec 15, 2017 6:14 am

OK that seems to have done the job. Sparkie care to explain why I may not comment out lines that was not required ? I like to know why things work the way they do.

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: How do you force a wifi interface to be a certain wlanX?

Fri Dec 15, 2017 6:52 am

if a device is found that is not explicitly specified by any rule it defaults to '0'. If after this a device is found to which you explicitly assigned '0' there is a conflict ending up with a device being named as 'renameX'.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 22 guests