5

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
nicolaus-hee
  • 138
  • 5
Txugo
  • 241
  • 1
  • 4
  • 14

4 Answers4

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?

mPrinC
  • 121
  • 2
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!

Kachamenus
  • 749
  • 6
  • 26
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.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
FreshTendrils
  • 463
  • 1
  • 7
  • 13
1

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

PiEnthusiast
  • 110
  • 5