Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the Wheezy build loaded on my Pi. I have my wired ethernet configured with a static IP and I have done the same thing with the wlan. When the wired is being used the wifi comes up and works. However when I disconnect the wired cable so I can use the Pi via the wifi it stops functioning.

Have I set up the interfaces file incorrectly? It seems really strange that it would stop working because the cable isn't attached. I tried to reboot without the cable plugged into the Pi to confirm it wasn't just some sort of glitch when I unplug it while it's running but it will only work if the wired cable is attached first.

Here's a copy of my /etc/network/interfaces file...

        auto lo

    iface lo inet loopback

    auto eth0
    iface eth0 inet static
            address 10.0.42.111
            network 10.0.42.0
            netmask 255.255.255.0
            broadcast 10.0.42.255
            gateway 10.0.42.1

    allow-hotplug wlan0
    auto wlan0
    iface wlan0 inet static
            address 10.0.42.112
            network 10.0.42.0
            netmask 255.255.255.0
            broadcast 10.0.42.255
            gateway 10.0.42.1

    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
share|improve this question
    
Maybe you think it's using wlan0 but in actual fact it's using eth0? –  Jivings Jan 20 '13 at 12:40
    
No, it's using the wlan. I can ping both IP and VNC works on both IP. When the cable is unplugged wlan goes down too. –  Chef Flambe Jan 20 '13 at 19:34
    
I still don't understand why you know it's using wlan0? –  Jivings Jan 20 '13 at 19:46
    
I'm going to move this over to Super User as I think you will have more luck there. I hope this is okay with you. –  Jivings Jan 20 '13 at 20:14
    
I have two network connections on the Pi and both are staticly assigned. wlan0 is staticly addressed with 10.0.42.112 and the eth0 is set to 10.0.42.111. If you ping 10.0.42.112 you get a responce. Hence 10.0.42.112(wlan0) is working. –  Chef Flambe Jan 20 '13 at 20:42
show 1 more comment

migrated from raspberrypi.stackexchange.com Jan 20 '13 at 20:15

This question came from our site for users and developers of hardware and software for Raspberry Pi.

1 Answer

up vote 2 down vote accepted

I just had the same issue, DHCP but the same WLAN0 failure until ETH0 was UP. In my case @Jivings is correct. When you ping the receiving response is via ETH0.

Now this goes against everything I understand but in my case with the RPI ethernet cable plugged in :

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:b0:0c:39  
          inet addr:192.168.99.75  Bcast:192.168.99.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


wlan0     Link encap:Ethernet  HWaddr 80:1f:02:82:33:24  
          inet addr:192.168.99.78  Bcast:192.168.99.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Take note of the HWaddr on each card.

Then from another workstation, in this case I'm using NMAP :

$ sudo nmap -sn 192.168.99.75  **<< - ETH0**

Starting Nmap 6.25 ( http://nmap.org ) at 2013-02-03 10:19 GMT
Nmap scan report for 192.168.99.75
Host is up (0.020s latency).
MAC Address: B8:27:EB:B0:0C:39 (Raspberry Pi Foundation)
Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds
Paul@lo-mbp-preg / $ sudo nmap -sn 192.168.99.78

$ sudo nmap -sn 192.168.99.78  **<< - ETH0**

Starting Nmap 6.25 ( http://nmap.org ) at 2013-02-03 10:19 GMT
Nmap scan report for 192.168.99.78
Host is up (0.0044s latency).
MAC Address: B8:27:EB:B0:0C:39 (Raspberry Pi Foundation)
Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds

You can see that the MAC Address/HWAddr for both ETH0 and WLAN0 is the same, and matches the ETH0 HWAddr from ifconfig. So in my case the Wireless was not working. All traffic was passing via ETH0

If you don't have NMAP ping and then displaying the ARP table (IP <-> MAC table) will show the same information. From CLI:

  • Windows = arp -a
  • Linux = arp

I actually didnt find 'the reason' for this. In the process of debugging it started working reliably. Which I hate. But this config is now working :

/etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="<ssid>"
        psk=<key>
}
network={
        ssid="<ssid>"
        psk=<key>
}
network={
        ssid="<ssid>"
        psk=<key>
}
network={
        ssid="<ssid>"
        key_mgmt=WPA-EAP
        pairwise=TKIP
        group=TKIP
        eap=PEAP
        identity="user@domain"
        password="xxxxxxxxxx"
        ca_cert="/etc/cert/ca.pem"
        phase1="peapver=0"
        phase2="MSCHAPV2"
}

I hope this helps you make some progress ..

share|improve this answer
    
Thanks for the help. Will try looking at it again this weekend. –  Chef Flambe Feb 6 '13 at 3:44
    
Ok, found it : bad wpa-psk parameter in interfaces file. –  kenji Jan 15 at 17:08
add comment

Your Answer

 
discard

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.