Skip to main content
Raspberry Pi

Raspberry Pi Setting a Static IP Address

By November 20, 2013September 12th, 2022No Comments

If you will be using your Pi as a server you will most likely want a static IP address, an address that does not change. Otherwise you m ay not know the current address of the server to connect to. If you are using Raspbian then setting the IP address is similar to setting a static address in Ubuntu. There is just the one network interface file that you will find in /etc/network/interfaces.

During the install DHCP will be configured for you network connection but we can change this a latterly to a static IP address. To do this we would edit the /etc/network/interfaces and change the entry for the NIC to static from dhcp.

Once changed to static we must, of course configure the address information:

iface eth0 inet static

Note: that we will now configure the DNS information in each network stanza to allow for different DNS servers based on different types of connections, ie LAN, wireless and 3G. This is preferred over setting single entries in the /etc/resolv.conf