Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure wlan on my dockstar. I installed wireless-tools, zd1211-firmware and wpasupplicant.

My /etc/network/interfaces file looks like this:

auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
        wpa-ssid *myssid*
        wpa-psk *mypw*

My wlan0-interface is up and got an ip address.

However, I can only ping this address if the LAN interface is connected too. What am I missing?

Output of route -n:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0   U     0      0        0 wlan0     U     0      0        0 eth0         UG    0      0        0 eth0
share|improve this question
Could you post the output of route -n (run as root or sudo)? – Andrew Jun 14 '11 at 23:23
@Andrew I appended it to the original post. – schokocappucino Jun 15 '11 at 3:52
I think that if the eth0 interface is not configured at all, it should not be in the route. Could you post the output when eth0 is not used? You can use ifdown to deactivate it. – ierax Jun 15 '11 at 8:23
@faif Okay, I'm now connected over wlan0. route -n: U 0 0 0 wlan0. Even if I unplug the cable, I can access my dockstar using both IPs?! – schokocappucino Jun 15 '11 at 13:38

In the provided routing table, there are two lines for the same network: one for eth0, one for wlan0. This is not ideal.

Additionally, the default route for outbound traffic is via eth0.

What is probably happening is, when you unplug the Ethernet cable, the routing table lines for eth0 remain, including the default route. The host then tries to send all its traffic over that interface, despite the fact you have unplugged it.

You could adjust auto eth0 to allow-hotplug eth0 and install a separate piece of software to manage the device based on plug/unplug events. Network-Manager works in this way and I believe has a CLI interface now.

Or, you could ensure that eth0 had a netmask of This would mean the machine would only use that interface for traffic directed at it, or in reply to such traffic, explicitly, and not as a default route. Either reconfigure your dhcp server or configure eth0 statically.

share|improve this answer

Can you set that in the BIOS that if you put a cable in the RJ45 then the wifi will auto turn off, and if no cable connected, then the wifi turns on?

share|improve this answer
I've never seen a setting like this at the BIOS level. What BIOS have you seen with that feature? – Caleb Jun 15 '11 at 11:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.