Page 1 of 1

Fixing wlan number in Pups - any value per adapter [SOLVED]

Posted: Mon 06 Apr 2020, 23:46
by davids45
G'day,

I have many Pups on each computer and now each computer connects to the home network and router via Wifi.

I use Pwidgets in 32-bit Pups and Conky in 64-bit Pups to display on the Desktop, the wifi status among other stuff.

I have seen that the naming of the same wifi dongle varies between Pups on the same computer if there's more than one adapter so the Pwidget/Conky Wifi script fails to show wifi details if it is wlan1 when the config script has wlan0, or vice versa. Sometimes the wifi is 'wl' followed by a long string of alphanumeric digits.

I believe Puppy decides what number to give to the wifi adapter. The wifi router/modem uses the MAC address (a constant for the dongle) not any wlan number.

Is the wlan's number assigned by a Puppy to the particular wifi dongle (identified via its MAC address) set by something in /etc/udev/rules.d/70.persistant.netrules or somewhere else?

I don't see this 'persistentnet.rules...' text file in every Pup so am confused (as usual).

For example, I'd like my wifi dongle to be wlan1 in every Pup so my Pwidget/Conky scripts don't have to be edited so often.

I think it would be easier for me when adding a new Pup to do the "set-wlan-dongle-to-wlan1" at Pup set-up than have multiple PWidget/Conky config scripts.

I would also like to know if this permanent fixing of this wlan number for the same wifi dongle would affect the Internet connection wizards.

Thanks.

David S.

Posted: Tue 07 Apr 2020, 01:26
by ozsouth
@DavidS - using net.ifnames=0 parameter in grub config is supposed to fix this. See:
http://murga-linux.com/puppy/viewtopic. ... 84#1039784

Solution - change the wlans by editing .....

Posted: Wed 08 Apr 2020, 01:39
by davids45
G'day ozsouth,

Thanks for the link. It seems to be for Live Pups.

My issue is my laptop with a poorly performing in-built wifi and a USB dongle that is better but gets relegated to wlan1 or to something like wlxyz123abc.

My pwidgets and conky configs are set to report wlan0. So the better USB, whatever its wlan name given by Puppy, is ignored until I edit each config.

I've found, so far, that a text file in /etc/udev/rules/ called '70-persistent.net-rules', can set which wifi adapter is wlan0 and wlan1, or to any wlan(number) I like if I edit it.

I've edited this file in ScPups and Slacko Pups (where it exists) to make the USB wifi wlan0, saving editing of the pwidget/conky configs. The skip-listed inbuilt wifi (which is sometimes still present?) I set to wlan1.

In Debian & Ubuntu Pups, this '70-persistent-net-rules' file is missing but when I've copied it to /etc/udev/rules/ from a good ScPup, on reboot, the Debian and Ubuntu-based Pups now have the USB adapter as wlan0 as I want.

The Wifi wizards are happy with this change if re-run is needed.

So far, so good.......

David S.

Posted: Wed 08 Apr 2020, 02:20
by bigpup
Thanks for the link. It seems to be for Live Pups.
I think you need to look at it again.
It gives info about adding a command to the boot loader menu config file menu entry.
Seems to be example command to add to any boot loader menu entry.

Posted: Wed 08 Apr 2020, 04:58
by davids45
G'day bigpup,

I had a longer look at ozsouth's link.

Does it work if there are two or more wifi adapters in the computer?

My problem was the naming/numbering of wifi interfaces when there's two in the computer. On my laptop, I wanted my USB adapter to be wlan0 and not the inbuilt adapter which generally got preferment but seems to be the weaker in picking up wifi signals.

Thanks for your interest,

David S.

Posted: Sat 11 Apr 2020, 16:12
by perdido
deleted

Posted: Mon 13 Apr 2020, 18:43
by jafadmin
You are correct that it is done by a udev rule. "/etc/udev/rules.d/70-persistent-net.rules"

It triggers on the mac address of the device. Get the mac addresses using "ifconfig -a | grep -i hwaddr"

example "70-persistent-net.rules" entry:

Code: Select all

# USB device 0x:0x (rt2800usb) use name "w0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:12:3a:b4:56:cd", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="w0"
In my case (BionicPup64) the rule did not exist. I had to create it.