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.