If your Raspberry or Beaglebone is attached to your network and is doing some Jobs for you, it is important that it is always accessible with the same IP-Address.

In most cases the Network-Router, which is the DHCP-Server as well, will try to give every Computer connected to your Network always the same dynamic IP-Address, but this is not for sure.

By default the Raspberry / Beaglebone is set up to search for a DHCP-Server and to receive a dynamic IP-Address, but it is also possible to give your machine a static IP-Address.

To achieve that on a Computer running Debian or Ubuntu the file

/etc/network/interfaces

needs to be modified with an editor of your choice.
The editor of my Choice is Nano, because in most cases it is pre-installed an quite easy to use.

So type

nano /etc/network/interfaces

to open the file, which should look similar to this.
( I removed the comment-lines )

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Note, that your primary network interface eth0 is configured to use dhcp to receive its IP-Address.
To get a static Address change this to

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.x.y
        netmask 255.255.255.0
        gateway 192.168.a.b

In the Address-Line enter the new Address of your Computer. For Home-Users this will be in most cases something like 192.168.xxx.yyy, depending on your Network.
The Gateway-Address is the Address of your Router.

With the Nano-Editor press ctrl+o to save your file and ctrl+x to leave the editor. After a restart your computer is now accessible with its new Address.

Please be very careful editing this file, because if your Computer is only accessible via ssh and something goes wrong, it will not be reachable any more.

Add comment

Please insert your mail adress. Your mail address will not be displayed.