Raspberry Pi Static IP Address |
|
To gain access to revision questions, please sign up and log in.
a
IP Addresses are used on the Internet to uniquely identify hosts (computers, printers, network storage etc.)
By default, the Raspberry Pi gets an IP Address automatically from whatever network it is connected to.
If you want to run your Pi as a server or connect remotely, it can be more useful to set the IP Address manually. This ensures the address is the same each time you want to log in or connect.
Selecting a suitable IP address can be tricky. You don't want to use one that might be allocated to another computer.
On a school or business network, you'd need to ask the network administrator.
At home you probably are the network administrator.
You will need to log into your home router and find out what addresses are reserved for the DHCP Pool.
You can select any address not in the pool.
Here is a shot of my DHCP settings on my home router. I can use any address less than 192.168.1.64 and I chose 192.168.1.5.
Addresses to Avoid
The 192.168.xxx.xxx range of addresses is reserved for private use on home or small business networks.
There is another private address range on 10.6.xxx.xxx.
Many home routers use this address space.
The setup steps are similar and you have to avoid particular addresses for the same reasons.
Addresses to Avoid
Here are the steps to achieve this on the Pi ...
Run nano. This is a text editor. Use it to alter the interfaces file in the /etc/network/ directory or folder in Windows-speak.
sudo nano /etc/network/interfaces
This is my interfaces file. Five lines needed to be added and the iface eth0 line altered.
---- IGNORE A COUPLE OF LINES HERE ----
iface eth0
inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
---- IGNORE MORE LINES HERE ----
Next reboot.
sudo reboot
And finally download PuTTY and use this to log in remotely from any Windows PC.
reviseOmatic V3 Contacts, ©, Cookies, Data Protection and Disclaimers Hosted at linode.com, London