How to configure Raspberry Pi Ethernet with Static IP Address

Raspberry Pi
Please follow and like us:

In case if you plan to set your Raspberry Pi with a static IP address, then follow the steps listed below:

Kindly make sure that you are logged into Raspberry Pi on command line (console or SSH) before proceeding.

Configuring a Static IP Address on Ethernet Port:

The file along with path where network information is stored on a Pi running Debian (Raspbian) is:

/etc/network/interfaces

Edit this file using the following command:

sudo nano /etc/network/interfaces

The file will probably have the following default command for Ethernet to run on DHCP:

iface eth0 inet dhcp

Where eth0 is the Ethernet Interface that we plan to configure.

We will modify this line to the following:

iface eth0 inet static

We modified the dhcp to static in the line and then we add the network information.

address 192.168.10.72
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1

Here address 192.168.10.72 is the static IP address we plan to assign to Raspberry Pi. For the Netmask, network, broadcast and gateway values please refer to the configuration of your own network.

Exit out (CTRL-X) and save (Y) the file.

Reboot your Raspberry Pi
sudo reboot

Once the machine is rebooted, it will have the static IP address as listed above.


Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *