1

I have set up my Raspberry Pi and from now on I want to access it only via SSH, so I want to ensure, that it doesn't change it's network IP on every reconnect. This is the automatically generated /etc/networking/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

Every approach I've found so far on the internet lead my to a total disconnect, but on the other hand my raspberry hat kept it's IP stable all the time.

Is the network IP (wlan0) of my Raspberry Pi static as it is right now? (If not, how do I get a static IP?)

3

An alternative solution to the one proposed by Krzysztof Adamski is to use DHCP reservation: go on the configuration page of your router and add the reservation rule to associate your desired IP to the MAC address of your Raspberry (you can find it on the command line with ifconfig, under the voice HWaddr).

2

Instead of:

iface wlan0 inet manual

you should use:

iface wlan0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1

Of course you should change the ip addresses to the values you want to use.

And instead of:

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Use:

wpa-ssid name_of_your_wifi_network
wpa-psk your_WPA_password

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.