LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-28-2011, 09:22 AM   #1
Ignotum Per Ignotius
Member
 
Registered: Sep 2009
Location: UK
Distribution: Slackware, Arch
Posts: 75
Blog Entries: 4

Rep: Reputation: 43
Strange Dependence Of wlan0 On eth0


Hi.

Here's my problem...

I've got an old 450Mhz PII Linux box kicking around and it has a lot of storage space: I dump stuff on it from time to time (it's running Slackware 12.2). It's got two NICs in it:
  • a wired Realtek RTL8139 type on eth0
  • a wireless Broadcom BCM4318 on wlan0

I want to set the machine up so that ordinarily it uses WiFi (wlan0), but if an Ethernet cable is plugged into it, it switches to the faster connection (eth0). When the cable's removed, it should revert to WiFi (wlan0) again. (I can't really leave the cable plugged in all the time as my router has only four ports and normally they're all in use --- I just want to plug in the old file dump from time to time when transferring large files such as ISOs, and then unplug it again.) ...Oh, and the box is headless --- any admin I do on it is via ssh (or, failing that, by plugging in a keyboard and typing blind).

Its set-up is as follows (excerpted from rc.inet1.conf):

Code:
# Config information for eth0:
IFNAME[0]="eth0"
IPADDR[0]="192.168.0.3"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for wlan0:
IFNAME[1]="wlan0"
IPADDR[1]="192.168.0.4"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
WLAN_ESSID[1]="Junkyard"

# Default gateway IP address:
#GATEWAY=""
GATEWAY="192.168.0.31"
Highlights of what the kernel (2.6.27.7) spits out at boot (the output of dmesg | grep -i -e eth0 -e wlan0 -e b43 -e 8139):

Code:
8139too Fast Ethernet driver 0.9.28
8139too 0000:00:0e.0: enabling device (0104 -> 0107)
8139too 0000:00:0e.0: found PCI INT A -> IRQ 5
eth0: RealTek RTL8139 at 0x1400, 4c:00:10:11:31:3a, IRQ 5
eth0:  Identified 8139 chip type 'RTL-8100B/8139D'
b43-pci-bridge 0000:00:0d.0: enabling device (0104 -> 0106)
b43-pci-bridge 0000:00:0d.0: found PCI INT A -> IRQ 10
b43-phy0: Broadcom 4318 WLAN found
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
input: b43-phy0 as /devices/virtual/input/input2
firmware: requesting b43/ucode5.fw
firmware: requesting b43/pcm5.fw
firmware: requesting b43/b0g0initvals5.fw
firmware: requesting b43/b0g0bsinitvals5.fw
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::radio
ADDRCONF(NETDEV_UP): wlan0: link is not ready
eth0: no IPv6 routers present
input: b43-phy0 as /devices/virtual/input/input3
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::radio
ADDRCONF(NETDEV_UP): wlan0: link is not ready
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: no IPv6 routers present
input: b43-phy0 as /devices/virtual/input/input4
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::radio
ADDRCONF(NETDEV_UP): wlan0: link is not ready
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: no IPv6 routers present
input: b43-phy0 as /devices/virtual/input/input5
b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::radio
ADDRCONF(NETDEV_UP): wlan0: link is not ready
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: no IPv6 routers present
(The "wlan0: link is not ready" messages are a bit odd.)

Relevant output of ifconfig:

Code:
eth0      Link encap:Ethernet  HWaddr 4c:00:10:11:31:3a
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::4e00:10ff:fe11:313a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1447 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1566 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:164794 (160.9 KiB)  TX bytes:327506 (319.8 KiB)
          Interrupt:5 Base address:0x1400

wlan0     Link encap:Ethernet  HWaddr 00:16:cf:3f:dd:10
          inet addr:192.168.0.4  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-16-CF-3F-DD-10-6C-6F-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
...And here's the output of route:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
localnet        *               255.255.255.0   U     0      0        0 wlan0
loopback        *               255.0.0.0       U     0      0        0 lo
default         Gateway.Junkyar 0.0.0.0         UG    1      0        0 eth0
There's no WEP/WPA at the moment to worry about.

When the wired NIC is plugged into the router I can ping the machine on both IP addresses. (As one would expect.)

Now the weird stuff...

If eth0 is unplugged, I cannot ping the machine on either IP address. It appears that wlan0 is somehow dependent upon eth0 (which means it's about as much use as a chocolate teapot).

Now, if I take down eth0 using ifconfig then --- although ifconfig says wlan0 is still up --- I can't ping either eth0 or wlan0. Then, if I bring up eth0 again using ifconfig, I still cannot ping either interface. However, when I then take down wlan0 using ifconfig, I can ping both interfaces!

The best bit is that if eth0 is up, wlan0 can be taken down at will and yet I can still ping both IP addresses!

I've Googled around and found a couple of vaguely similar scenarios in other forum posts, but they didn't solve my problem.

I'm thinking its witches...

All help greatly appreciated.

Thanks.


Paul.
 
Old 05-28-2011, 02:31 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Leave it headless.
Get a newer kernel that 2.6·27 for the broadcom driver. There were a good few b43 commits in the following versions.
In /etc/modprobe.d, stick in a line. I have something like
install b43 /sbin/modprobe ssb; /sbin/modprobe b43; /sbin/modprobe btusb
The ssb is Sonics Silicon Backplane and there's some stupid b43-usb-to-pci thing in that :-/.
Lastly, while I'm giving out, wlan0 should be set up in rc.wireless.conf, I think.
 
1 members found this post helpful.
Old 05-30-2011, 05:13 AM   #3
Ignotum Per Ignotius
Member
 
Registered: Sep 2009
Location: UK
Distribution: Slackware, Arch
Posts: 75

Original Poster
Blog Entries: 4

Rep: Reputation: 43
Thanks for the reply, Business. (My apologies for the delay in getting back to you --- been otherwise engaged.)

Quote:
Originally Posted by business_kid View Post
Leave it headless.
Get a newer kernel that 2.6·27 for the broadcom driver. There were a good few b43 commits in the following versions.
In /etc/modprobe.d, stick in a line. I have something like
install b43 /sbin/modprobe ssb; /sbin/modprobe b43; /sbin/modprobe btusb
The ssb is Sonics Silicon Backplane and there's some stupid b43-usb-to-pci thing in that :-/.
Since kernel upgrading was likely to take longer than adding a line to a configuration file, I tried simply adding the line you suggested to /etc/modprobe.conf without the upgrade. ...And the machine threw a wobbly like you've never seen. Errors I scarce knew existed all over the shop at boot, ending in a kernel panic! ...Just from a single line! Amazing! I booted into an earlier version of Linux, mounted 12.2's root partition, removed the line and all was well once more.

You're spot-on about the B43's 'Sonics Silicon Backplane' --- I'd noticed it listed during probing at boot (and had always wondered about that 2-foot fin sticking out of the rear of my machine...). However, it turns out that it's already handled by default --- the B43 module automatically loads the SSB module, as lsmod | grep ^ssb shows...

Code:
ssb                    37252  1 b43
...though of course that doesn't mean everything's configured correctly.

Quote:
Lastly, while I'm giving out, wlan0 should be set up in rc.wireless.conf, I think.
I dunno --- I've a feeling rc.wireless.conf has been deprecated... (I seem to remember reading something about it in Alien BOB's Network Configuration Wiki --- but his site's down at the moment, so I can't say for sure...)

...So it looks as though it's an upgrade-job. I haven't the time right now (a zillion and one things must take precedence in the meantime), so it'll have to wait. ...Either that or I'll just put up with things as they are (I should probably chuck out the machine and clear the place up, truth be told. )

Anyway, thanks again for taking the time to reply.

Have a good Bank Holiday,


Paul.
 
Old 05-30-2011, 07:14 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by Ignotum Per Ignotius View Post
Since kernel upgrading was likely to take longer than adding a line to a configuration file, I tried simply adding the line you suggested to /etc/modprobe.conf without the upgrade. ...And the machine threw a wobbly like you've never seen. Errors I scarce knew existed all over the shop at boot, ending in a kernel panic! ...Just from a single line! Amazing! I booted into an earlier version of Linux, mounted 12.2's root partition, removed the line and all was well once more.
Glad to know I can still break things art a distance :-).
Quote:
Originally Posted by Ignotum Per Ignotius View Post
I dunno --- I've a feeling rc.wireless.conf has been deprecated...
It certainly wasn't deprecated in 12.2. It stood out a mile to me that it should go, but the wifi commands were in rc.wireless, which is run by the all dominating rc.inet1 and rc.wirelesstakes it's config (in 12.2) from rc.wireless.conf
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No networks at all (eth0, wlan0) arsci Linux - Networking 1 09-11-2010 02:48 AM
NAT eth0 through wlan0? sysslack Linux - Networking 2 08-17-2009 06:37 AM
how to forward wlan0 to eth0? patcito Linux - Networking 2 07-03-2009 05:26 AM
Remapping wlan0 to eth0 Berhanie Linux - Networking 1 02-17-2005 07:59 AM
Starting wlan0 instead of eth0 eo697 Linux - Networking 2 10-12-2003 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration