Network interface varies

From MEPIS Documentation Wiki

Jump to: navigation, search

When the network interface your wireless card is using seems to jump back and forth, for instance from eth0 to wlan0 or from eth0 to eth1, this usually means that there is some kind of conflict.

Conflict with Ndiswrapper

It can be that your card's native driver is competing with wlan0 and the function of Ndiswrapper. To fix this problem, follow the instructions in Wireless card not detected.

Conflict between wired and wireless interfaces

If you have both wireless and wired interfaces operating, they can interfere with each other and cause the wireless interface to switch back and forth between eth0 and eth1. You can solve this by pinning the wireless to one interface,

Method 1

Thanks to timkb4cq for figuring this out.

Open Terminal Program (Konsole) and become root.

If the wireless card is currently assigned to eth0, type:

  udevinfo -a -p /sys/class/net/eth0

If it's currently at eth1 instead, use:

  udevinfo -a -p /sys/class/net/eth1

The command udevinfo provides a dynamic device directory containing only the files for actually present devices, and will return information about the device and its Mac_address. You will want the line that begins "SYSFS{address}==" and that will look something like this:

  SYSFS{address}=="00:0f:1f:b1:d6:13"

Copy that line in your terminal output, and leave the terminal window open so you can check it in a minute. Open an editor as root (a good way is alt+F2 and type 'kwrite' making sure to click 'options' --> 'run as different user' --> root, enter root password). Then type this:

  KERNEL=="eth*", SYSFS{address}=="00:00:00:00:00:00", NAME="eth0"

Highlight the section

  SYSFS{address}=="00:00:00:00:00:00" 

and replace it with the actual address by pasting in the SYSFS{address} line you copied from the terminal output from udevinfo. Save the file in the directory

  /etc/udev/rules.d 

with the name: 11-local.rules (that's two ones at the beginning of the name, not two l's).

When you reboot, this script will make sure that the card with that mac address is named eth0. The other one will end up as eth1 by default.

Method 2

Thanks to m_pav for this one.

  • Right-click the desktop, select Run command, and enter
kdesu kwrite

finish by supplying root's password.

  • Open up the file /etc/iftab.old
  • Using the example below, add the 2 lines to the end of your iftab file, replacing the examples with the Mac_address of the interfaces on your system.
ath0 mac 00:1a:2b:3c:4d:5e
eth0 mac 00:a1:b2:c3:d4:e5 arp 1

The above shows the wireless card assigned as ath0 and the wired as eth0. The arp entry matches the ARP type (also known as the Link type) of the interface, which can be obtained by using ifconfig.

  • Save the file in /etc as iftab

The beauty of this method is that you can assign a totally different interface type to the wireless that is more suited to the actual device. Assigning the wireless card to an ath# type will pay off big time by giving you a matched icon when your wireless is connected.


Links:

http://www.debianhelp.co.uk/udev.htm Debian how-to on persistent naming of network interfaces

Personal tools
In other languages