Wireless interface changes on occasion from wlan0 to wlan1 and back

12 Antworten [Letzter Beitrag]
doolio
Offline
Beigetreten: 12/31/2013

Hi,

Perhaps some of you have come across this oddity before. I have a bash function which displays some network information including my IP address. However, on occasion when run, it returns an error on displaying the IP address as the wlan0 interface is hardcoded in the function. Checking my wireless connection I find it is using the wlan1 interface. This explains the failure with my bash function but can anyone shed some light on why the interface shauld change? Stranger still I could login another day and it will be back using wlan0.

If it helps
lspci -nnk | grep -A2 0280
gives
02:00.0 Network controller [0280]: Qualcomm Atheros AR9285
Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)
Subsystem: AzureWave AW-NE785 / AW-NE785H 802.11bgn Wireless Full or
Half-size Mini PCIe Card [1a3b:1089]
Kernel driver in use: ath9k

and the contents of my
/etc/udev/rules.d/70-persistent-net.rules
file is the following
# This file maintains persistent names for network interfaces.See udev(7) for syntax.Entries are automatically added by the 75-persistent-net-generator.rules file; however you are also free to add your own entries.
# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0
(e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:16:d3:b0:58:f1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0 (iwl3945)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:77:02:5c:0e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# PCI device 0x168c:/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0 (ath9k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="1c:4b:d6:d1:e3:86", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"

I've researched and found that this iwl3945 is the driver for the Intel 3945 chipset. Can someone confirm if this is a free (as in freedom) driver? I believe this chipset requires non-free firmware (source https://wiki.debian.org/iwlegacy). My machine is a Libreboot X60s so was rebuilt with the Atheros AR9285 card so shouldn't contain any non-free components.

doolio
Offline
Beigetreten: 12/31/2013

Bueller?

doolio
Offline
Beigetreten: 12/31/2013

Apologies for the obvious bump but I'd appreciate some input from those with more experience in this area. Thanks.

Trisquelian
Offline
Beigetreten: 01/23/2015

I do not know if there are other reasons for a wireless interface being named any thing else than wlan0 other than unless you have multiple NICs (USB dongles get the same name pattern from what I recall - wlanX for wireless and ethX for ethernet) or you associated multiple names with the same interface on networkmanager, wicd or whatever GUI tool you are using (since you did not specify).

As for the driver, I believe it is pretty obvious if Debian includes it in the non-free repository; as those that are not proprietary or otherwise go elsewhere.

doolio
Offline
Beigetreten: 12/31/2013

I'm confident I'm using Atheros AR9285 card and ath9k driver. I tend not to use the GUI tools if I can but can confirm there is only one name associated with the interface. Just to add this evening as I stated in my first post it is now stating it is using the wlan0 interface. Thanks.

Trisquelian
Offline
Beigetreten: 01/23/2015

Can you give us the output of "ip a" then? Do you use any USB adapters or not?

doolio
Offline
Beigetreten: 12/31/2013

ip agives
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:16:d3:b0:58:f1 brd ff:ff:ff:ff:ff:ff
3: wlan0: mtu 1500 qdisc mq state UP qlen 1000
link/ether 1c:4b:d6:d1:e3:86 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.84/24 brd 192.168.1.255 scope global wlan0
inet6 fe80::1e4b:d6ff:fed1:e386/64 scope link
valid_lft forever preferred_lft forever

and I don't use any USB adaptors. Thanks.

Trisquelian
Offline
Beigetreten: 01/23/2015

The output from "ip a" shows that the system is only using the Atheros card. I have a couple devices with multiple ethernet ports and the naming for the interfaces was persistent across reboots, but I guess wireless interfaces do not load consistently(paralel).

Do you often remove one of these cards? Did you write the /etc/udev/rules.d/70-persistent-net.rules file manually? You should keep the configuration for each interface on the same line in the /etc/udev/rules.d/70-persistent-net.rules , I can't really tell since the formatting on the forum can be a little tricky ( the lines beggining with SUBSYSTEM, ATTR and KERNEl should be on the same line ). Lastly, switch the NAME fields on each line. You want the line with ATTR{address}=="1c:4b:d6:d1:e3:86", to have wlan0 and the other card to wlan1. Reboot a few times and keep testing with "ip a",

Note: If the configuration file is correctly configured your Atheros interface should always be named wlan1 and not 0, in the current file.

doolio
Offline
Beigetreten: 12/31/2013

No, I've not removed any of the cards in the past. I also did not write the /etc/udev/rules.d/70-persistent-net.rules file manually. It does state though at the beginning of the file that "Entries are automatically added by the 75-persistent-net-generator.rules file" but I've been unable as yet to find such a file on my system. I can confirm though that the configuration for each interface is on the same line - as you suspected the formatting is not maintained by the forum.

Does your statement "Lastly, switch the NAME fields on each line. You want the line with ATTR{address}=="1c:4b:d6:d1:e3:86", to have wlan0 and the other card to wlan1. Reboot a few times and keep testing with "ip a","

not contradict with your last statement

"Note: If the configuration file is correctly configured your Atheros interface should always be named wlan1 and not 0, in the current file."

or am I misunderstanding what you mean. If I change the NAME of the 1c:4b:d6:d1:e3:86 interface to wlan0 then it won't be wlan1 which you seem to imply it should.

Thanks for the help.

Trisquelian
Offline
Beigetreten: 01/23/2015

Yes, it is contradicting in the case that the formatting would be correct ( I just considered two different cases). Now the latter is correct. Whatever you name your interface on that file should take effect.

"Note: If the configuration file is correctly configured your Atheros interface should always be named wlan1 and not 0, in the current file."

This was because of the script. You were trying to detect the configuration for wlan0 and the file was forcing the Atheros card to be named wlan1.

doolio
Offline
Beigetreten: 12/31/2013

Thanks for the clarification and your help on this issue.

I've updated the NAME fields in the /etc/udev/rules.d/70-persistent-net.rules file so that my Atheros interface is named wlan0. In theory, I suppose I could remove the iwl3945 entry (now named wlan1) altogether from this file.

Thanks again.

lembas
Offline
Beigetreten: 05/13/2010

> No, I've not removed any of the cards in the past. I also did not write the /etc/udev/rules.d/70-persistent-net.rules file manually. It does state though at the beginning of the file that "Entries are automatically added by the 75-persistent-net-generator.rules file" but I've been unable as yet to find such a file on my system.

On Trisquel 6:

$ locate 75-persistent-net-generator.rules
/lib/udev/rules.d/75-persistent-net-generator.rules
doolio
Offline
Beigetreten: 12/31/2013

Thanks Lembas. I was not aware of this 'locate' command. Interestingly, it simultaneously returned an error saying no such command but also the location you posted from where I can read the file in question.