Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

How to rename wireless interface on bootup using ifrename

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
krosswindz
n00b
n00b
Posts: 39
Joined: Fri Oct 15, 2004 3:44 am

How to rename wireless interface on bootup using ifrename

  • Quote

Post by krosswindz » Tue Feb 15, 2005 3:12 pm

I have the intel pro wireless 2200 BG card in my laptop. Before version 1.0.0 I had the option of setting the interface name as wlan%d using the ifname module parameter. From 1.0.0 ipw2200 uses regular kernel way to change interface name using ifrename. I have the iftab setup but I want to be able to choose the correct interface name when the module is loaded. The problem being that I use lvm and my /usr is not mounted until after all my modules are loaded because of which hotplug isnt able to rename my device correctly. Any idea as to what I could do to solve this problem. Any help on this is appreciated
Top
thesnowman
Guru
Guru
Posts: 365
Joined: Thu May 08, 2003 3:29 pm
Location: Sydney, Australia

  • Quote

Post by thesnowman » Tue Feb 15, 2005 11:30 pm

I used to use /etc/modules.d/aliases:

Code: Select all

echo "alias eth1 ipw2200" >> /etc/modules.d/aliases && /sbin/modules-update
to ensure that my interface was always eth1. I don't know if this will work for wlan0, but you could try it.
Top
krosswindz
n00b
n00b
Posts: 39
Joined: Fri Oct 15, 2004 3:44 am

  • Quote

Post by krosswindz » Wed Feb 16, 2005 5:57 am

I tried the alias with wlan0, it never worked. If I rmmod ipw2200 and then modprobe it again it comes as wlan0 because of hotplug. It doesnt do that on the first autoload. I just want the first autoload to work. Thanks for the help
Top
thesnowman
Guru
Guru
Posts: 365
Joined: Thu May 08, 2003 3:29 pm
Location: Sydney, Australia

  • Quote

Post by thesnowman » Wed Feb 16, 2005 7:03 am

This has changed in version net-wireless/ipw2200-1.0.1 not 1.0.0. I had 1.0.0 installed until this morning. I have now installed 1.0.1 and the behaviour has changed. My interface is now called eth0 and as you rightly say, the alias does not change it to eth1. I'm going to downgrade...
Top
thesnowman
Guru
Guru
Posts: 365
Joined: Thu May 08, 2003 3:29 pm
Location: Sydney, Australia

  • Quote

Post by thesnowman » Wed Feb 16, 2005 7:39 am

Have a look at this thread on the ipw2100 mailing list, in particular the first and second replies:
http://sourceforge.net/mailarchive/mess ... d=10808215

Brix suggests that this is documented in the CHANGES file, however I could not see it:

Code: Select all

less /usr/share/doc/ipw2200-1.0.1/CHANGES.gz
Hopefully Brix will see this thread and let us know where it is mentioned...

The third reply suggests a fix using UDEV. I am testing now and will let you know if it works for me.

P.S. shouldn't this thread be in Networking & Security...
Top
thesnowman
Guru
Guru
Posts: 365
Joined: Thu May 08, 2003 3:29 pm
Location: Sydney, Australia

  • Quote

Post by thesnowman » Wed Feb 16, 2005 8:09 am

Got it to work with the following udev rule in /etc/udev/rules.d/10-udev.rules:

Code: Select all

KERNEL="eth*", SYSFS{address}="00:0e:35:6f:33:66", NAME="wlan0"
Obviously change the mac address to match your adapter.

I used

Code: Select all

# udevinfo -a -p /sys/class/net/eth0/
as specified in the writing udev rules document to determine the mac address. ifconfig printed it in CAPS which obviously wouldn't match.
Top
krosswindz
n00b
n00b
Posts: 39
Joined: Fri Oct 15, 2004 3:44 am

  • Quote

Post by krosswindz » Tue Feb 22, 2005 4:02 am

Thanks for the tip, it worked. Another quick question is it possible to free up eth1 so that some other device can use it instead of it being named eth2, probably I am asking for too much ;)
Top
ribx
Apprentice
Apprentice
Posts: 219
Joined: Thu Nov 20, 2003 8:12 am
Location: germany

  • Quote

Post by ribx » Sat Feb 26, 2005 3:42 pm

i am not running udev. here how i did it:

echo '<new_name> mac xx:xx:xx:xx:xx:xx' >> /etc/iftab

reload the module. thats all. it seems that the driver reads it out. i dont understand it realy but it works ;)

for more info:
man ifrename
man iftab

first i though i have to run ifrename, but when i did it it told me that the device was busy. so i tried to reload it with modprobe et voila:

Code: Select all

wlan0     IEEE 802.11g  ESSID:"LUTZHOME"  Nickname:"LUTZHOME"
          Mode:Managed  Frequency:2.457 GHz  Access Point: 00:04:E2:B6:C2:BA
          Bit Rate=54 Mb/s   Tx-Power=255 dBm
          RTS thr:off   Fragment thr:off
          Encryption key:AF91-2211-84AB-CDEF-0987-6543-21   Security mode:open
          Power Management:off
          Link Quality=96/100  Signal level=-31 dBm  Noise level=-85 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
it works (without running ifrename :/ )

-ribx
The adopt an unanswered post initiative
Top
krosswindz
n00b
n00b
Posts: 39
Joined: Fri Oct 15, 2004 3:44 am

  • Quote

Post by krosswindz » Mon Feb 28, 2005 4:25 pm

The reason that works is that you are using hotplug. When you load the module hotplug looks for /etc/iftab and see that you have /etc/iftab so uses ifrename to rename the module when you reinsert it. It doesnt seem to be able to pick it up when it boots which kind of baffles me. I dont want to go through the process of reinserting the module every boot. udev rule works for me.
Top
KhanReaper
n00b
n00b
User avatar
Posts: 37
Joined: Tue Sep 21, 2004 3:11 pm
Contact:
Contact KhanReaper
Website

  • Quote

Post by KhanReaper » Wed Jun 22, 2005 5:55 pm

What system package provides ifrename and iftab?
Even the Politburo concurs with Process of Elimination. Shouldn't you?
Top
ribx
Apprentice
Apprentice
Posts: 219
Joined: Thu Nov 20, 2003 8:12 am
Location: germany

  • Quote

Post by ribx » Wed Jun 22, 2005 7:23 pm

Code: Select all

notebook ~ # qpkg -f `which ifrename`
net-wireless/wireless-tools *
The adopt an unanswered post initiative
Top
ribx
Apprentice
Apprentice
Posts: 219
Joined: Thu Nov 20, 2003 8:12 am
Location: germany

  • Quote

Post by ribx » Wed Jun 22, 2005 8:39 pm

i have another problem now:

i switched to the udev thing, because my wlan card has the mac address 00:00:00:00:00:00 if it is switched off by the hardware key. maybe you think that shouldnt be a problem, something like

Code: Select all

wlan0 mac 00:0E:35:75:7C:07
wlan0 mac 00:00:00:00:00:00
would do the job, but there is one problem: i'm using the cisco vpn client. it loads a pseudo driver, which also has the mac address 00:00:...:00.

ok so far i was yesterday. then i desided to make this more comforable for me and use udev. but udev needs about 5 seconds to change the name of the wireless card from eth0 to wlan0. i dont want to add a 5 seconds sleep to my init.d script which loads ipw2200. thats too ugly. here some informations:

Code: Select all

notebook ~ # grep eth /etc/udev/rules.d/10-local.rules 
KERNEL="eth*",SYSFS{address}="00:0f:1f:25:89:79", NAME="eth0"
KERNEL="eth*", NAME="wlan0"

*  sys-fs/udev
      Latest version available: 056
      Latest version installed: 056
      Size of downloaded files: 468 kB
      Homepage:    http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
      Description: Linux dynamic and persistent device naming support (aka userspace devfs)
      License:     GPL-2
The adopt an unanswered post initiative
Top
rabinath
n00b
n00b
User avatar
Posts: 31
Joined: Tue Jan 03, 2006 1:31 pm
Location: Germany

  • Quote

Post by rabinath » Tue Nov 28, 2006 11:05 am

Just for those using

Code: Select all

KERNEL="eth*", SYSFS{address}="00:0e:35:6f:33:66", NAME="wlan0"
Since my latest udev update to sys-fs/udev-103 the code above did not work any longer. I had to change it a little (note the double ==) to:

Code: Select all

KERNEL=="eth*", SYSFS{address}=="00:0e:35:6f:33:66", NAME="wlan0"
Top
bookstack
Apprentice
Apprentice
Posts: 245
Joined: Fri Feb 27, 2004 4:10 pm

  • Quote

Post by bookstack » Fri Feb 16, 2007 1:30 pm

Let me push it further:

Yes, we can set the udev rule by mac address, it also works.

How could we *automatically* rename the eth%d interface to wlan0%d, if the device is driven by ndiswrapper or ipw2200?
Refactor the life
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Fri Feb 16, 2007 3:22 pm

bookstack wrote:How could we *automatically* rename the eth%d interface to wlan0%d
I assume you mean %n - there is no %d in man udev. This is a bad question. The point of customizing udev is to unambiguously assign a meaningful name to devices. A name which contains a random number defeats the point of having meaning.

There are lots of threads of moaning about udev randomly rearranging e.g. eth0 and eth1, and thus messing up the networking :wink:

This is why the MAC address is used - it unambiguously identifies the device to rename. However, if you're sure that only 1 device in the PC is linked to ndiswrapper, then perhaps this will work:

/etc/udev/rules.d/10-local.rules

Code: Select all

SUBSYSTEM=="net", DRIVERS=="ndiswrapper", NAME="wlan"
Top
Post Reply

15 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy