udev: renamed network interface wlan0 to wlan1

      当一次插入无线网卡后,debian2.6.30.4死机,断电关机后再次插入无线网卡,无线网卡的标志老是wlan1而不能显示为wlan0,一直无法解决,dmesg后发现如下问题:
     udev: renamed network interface wlan0 to wlan1
最后看到下面这个帖子:
http://blog.laimbock.com/2008/08/06/pci-wi-fi-card-fedora/

For a while I wanted to put a PCI Wi-Fi card into my Fedora 8 box runningMythTV so I canremove the rather annoying LAN cable running through my appartment.Anyone who has ever tried finding a PCI Wi-Fi card or USB Wi-Fistick for use on a Linux box knows what a challenge it is to findone that’s actually supported. And by supported I mean out of thebox and not through NDISwrapper.  But with the muchappreciated help from the Linux wirelessLAN support webpage by HJ Heins I found the Conceptronic C54Ri 54Mbps Wireless Network Cardthat should work. The card has a RaLink chipset and these days thatseems to be your best bet if you want anything Wi-Fi to work onLinux (besides Intel off course).

The card is about €25 and comes with a small manual and a cdromwith all sorts of Windows stuff on it so I quickly put it back inthe box. I installed the card, rebooted the PC and amazingly enoughit was instantaneously recognized, the rt2500pci and related kernelmodules automatically loaded and ready to be configured. That’s thecool thing about Linux. If it’s supported then it really worksstraight out of the box. Kudo’s to RaLink, the peoplefrom the RT2X00 project and the kerneldevelopers for making this such a breeze!

With my shiny new Wi-Fi card installed and recognized I noticedthat the output of iwconfig showed that the card was assignedwlan1. Strange as I would suspect it be wlan0 given the fact thatit was the only Wi-Fi card in the box. So I checked/var/log/messages I noticed this message:

udev: renamed network interface wlan0 to wlan1

This one had me stumped for a second but then I remembered thata few months back I had tried to get a SpeedTouch 121G Wi-Fi USBstick working which was not a success. And that udev haspersistence these days so that might have something to do withchoosing wlan1 over wlan0. Next I checked out/etc/udev/rules.d/70-persistent-net.rules and the ndiswrapper entrywith name wlan0 for the SpeedTouch 121G was in there. I removed theentry, changed the name of the rt2500pci entry to wlan0, rebootedthe box and then the rt2500pci card came up as wlan0.

The only thing left was configuring the card insystem-config-network, adding an entry in the DHCP server andallowing the card access to the Wi-Fi router. The result: oneworking PCI Wi-Fi card in 15 minutes. Now who said that Linux wasdifficult :)

最后的解决方法是:删除/etc/udev/rules.d/70-persistent-net.rules,重启PC后,回归正常。

你可能感兴趣的:(udev: renamed network interface wlan0 to wlan1)