# Controlling udev persistent net rules

## TheLexx

Recently I upgraded from a older Linux system that had udev but not persistent net rules. I'm looking for a way to turn it off or at least control it. My problem is with USB wifi adapters (I have two of them, both zd1211). I want it to always come up as wlan0 no mater which one I plug in. If I plug in two at the same time (which I don't plan on doing) then it can name the second one wlan1. In other words, I want USB wifi adaptors to be named in order of detection.

I do want consistent naming on my wired lan, but it's PCI and I don't change them often enough to need a system to track them, I can MANUALLY change my udev rules if need be. 

What can I do so that the first wifi USB is called wlan0 no mater which one I plug in?

EDIT: grammar fixLast edited by TheLexx on Mon Mar 15, 2010 3:07 pm; edited 1 time in total

----------

## Raniz

I guess you can tweak the rules in /etc/udev/rules.d/70-persistent-net.rules

I think you can just remove/comment out the rules for your wireless cards.

----------

## TheLexx

 *Raniz wrote:*   

> I guess you can tweak the rules in /etc/udev/rules.d/70-persistent-net.rules
> 
> I think you can just remove/comment out the rules for your wireless cards.

 

I just tried this and it does NOT work. If I remove or comment out the individual lines within 70-persistent-net.rules, the persistent naming system keeps adding them back. If I kill /etc/udev/rules.d/70-persistent-net.rules then the file is just regenerated.

I find this whole thing annoying, because when I first upgraded to udev, I liked it. I read-up on how to write udev rules and I made my own so that I had names I that stayed consistent.  (the wifi drive was called wlan0 not eth0 or eth1 depending on whether or not there was a wired card detected or not). Now this damn system ignores the rules that I wrote and uses it's own name every time I change dongles!

from /etc/udev/rules.d/10-steves.rules

```

# set name for wifi wireless devices

BUS=="usb",  DRIVER=="zd1211rw", NAME="wlan0"

```

from dmesg

```

usb 1-2.2: new full speed USB device using uhci_hcd and address 6

usb 1-2.2: New USB device found, idVendor=0ace, idProduct=1211

usb 1-2.2: New USB device strings: Mfr=16, Product=32, SerialNumber=0

usb 1-2.2: Product: USB2.0 WLAN

usb 1-2.2: Manufacturer: ZyDAS

usb 1-2.2: configuration #1 chosen from 1 choice

usb 1-2.2: reset full speed USB device using uhci_hcd and address 6

phy3: Selected rate control algorithm 'minstrel'

zd1211rw 1-2.2:1.0: phy3

udev: renamed network interface wlan0 to wlan1

```

----------

