Do you want to connect to your Raspberry Pi from other machines with SSH? Here is how to do it secure ssh connection between windows and raspbian. But then it is nice to have static IP address setting on it. Static IP means that the address is the same every time you power up your Pi machine.
If you are new in IP addressing dont worry. Learn more starting from Wkipedia maybe.
You can also search the web with: ‘IP addressing’ or ‘IP address classes’. And then:
- Check your local network addressing
- If you have a machine with Linux working in this network try:
- If you have a machine with Windows working in this network launch console (cmd.exe) and type:
netmask, Subnet Mask – is the subnet mask shows which bits of the address are machine or subnet.
inet, IP Address – this is the machine IP address.
Default Gateway – this is the IP address of your gateway.
- 192.168.1.0 – bad choice – this is subnet address
- 192.168.1.1 – bad choice – this is gateway IP address
- 192.168.1.255 – bad choice – this is so called broadcast IP address
- 192.168.1.120 – bad choice – it is other machine address in local network
- 192.168.1.111 – bad choice – it is other machine address in local network
- So we can choose IP address starting from 192.168.1.2 up to 192.168.1.254 excluding 111 i 120 (are used). Lets set: 192.168.1.225
- Remember that every IP address can be used only once. Lets check it:
ping 192.168.1.225Destination host is unreachable – that means the address 192.168.1.225 is now free and we can use it.
sudo nano /etc/dhcpcd.conf
- If your Raspberry should have static IP address in WiFi network append to file:
- If your Raspberry should have static IP address in cable network append to file:
- Press ‘ctrl+x’ to exit the nano editor and then press ‘y’ to save changes.
You can also add both if you need.
- After restart check if everything is ok.
And finished. Your Raspberry Pi has static IP address !!