4

I know that there are similiar questions out there but not worked for me. I've set up a static ip for my wlan0 interface. that works well when I'm also connected via ethernet. but as soon as I disconnect the cable I can't ping to the defined wlan0 ip or ssh. the strange thing is that my router knows that my pi is connected via wifi.

If I boot with only the wifi dongle...it still does not work.

here is my interfaces file:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface sky inet static
address 192.168.1.41
netmask 255.255.255.0
gateway 192.168.1.1

iface default inet dhcp
  • if you use nmap does the same IP address show for the wifi Pi? – rob Feb 25 '15 at 15:45
  • What happens if before you unplug the cable you service ifplugd stop (and make sure it really stopped; ps -C ifplugd should show no processes)? – goldilocks Feb 25 '15 at 15:49
  • How are you powering the Pi? Is the WiFi dongle powered by the Pi or a powered USB hub? – Steve Robillard Feb 25 '15 at 15:53
  • thanks steve. it's a edimax ew-7811un powered by the pi's usb ports [I have the original model B]. – Txugo Feb 25 '15 at 15:55
  • 1
    Iface sky? What interface is sky? Shouldn't it be wlan0? – jotadepicas Mar 28 '15 at 2:12
1

I never tried without

network 192.168.1.0
broadcast 192.168.1.255

(broadcast shouldn't matter), just put it under gateway (i set the values that should suite you). I also do not have your default line: iface default inet dhcp, but that should not matter.

You should also check the /etc/wpa_supplicant/wpa_supplicant.conf file

It should have something like:

network={
    ssid="xxx"
    psk="yyy"
    id_str="sky"

    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
}

The last 4 lines could be different. SSID is network name, PSK is password. ID_STR is same as in the /etc/network/interfaces.

Here i answered in more details: how is my IP being set?

1

Try 2 things:

  1. If on a mac, go into Users > {username} > .ssh > known_hosts delete everything after your RasPi's ip address. sorry, dunno about windows!

  2. Boot your RasPi, THEN stick in the wifi dongle.

Hope I helped!

1

Could it be that there is a DHCP setting that is stored and that causes a conflict? Check /etc/resolv.conf.

1

Try sudo ifup --force wlan0.

This way you can force the pi to use wlan0, instead of ethernet, that way if you disconnect ethernet, and still have wlan0 connected to home network, you may be able to ssh in.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – Jacobm001 Jun 26 '15 at 17:10
  • @Jacobm001 if he uses that command and then disconnects it may provide a solution – FreshTendrils Jun 26 '15 at 17:44
  • Will it? Why? Maybe you could expand the answer a little more? – Jacobm001 Jun 26 '15 at 17:47
  • @Jacobm001 If you use the command, you can force the pi to use wlan0, instead of ethernet, that way if you disconnect ethernet, and still have wlan0 connected to home network, you may be able to ssh in – FreshTendrils Jun 26 '15 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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