Home
  • Intro
  •  
  • Energy
    • Energy diversion
    • My Energy Diverter
    • Oven control
    • Resources
  •  
  • Banana Pi M5
    • Install Armbian
    • Setting up
    • SSH connection
    • Static IP address
    • Install SAMBA
    • Install Apache
    • Install MySQL
    • Install PHP
    • Install phpMyAdmin
    • Install FTP server
    • Add web site
    • erase eMMC
  •  
  • Arduino
    • Programming
    • Connecting to PHP/MySQL
  •  
  • Energy app
    • Example
  •  
  • Music server (NAS)
    • miniDLNA
    • Installing on BPi-M5
    • Uploading files

Setting a Static IP address for your BPi-M5

If you intend to use your BPi-M5 as a data centre for your home (e.g. talk to a load of sensors/arduinos) then your Pi will need a static IP address (one that never changes) on your network.


Log into your Pi as superuser (su) as normal.
There are two ways to set up network instructions:

  1. Use armbian-config (standard way)
  2. Exit the network interfaces file directly (my choice - jump to it here)

1).... using armbian-config

BPiM5:yourname:# armbian-config

This opens a configuration window. Scroll down to: Network and press enter to activate OK

Select Network

Next screen: choose IP and press enter to activate

Select Network

Next screen: right scrool to Static and press enter to activate

Select Network

Next screen: fill in ALL the boxes, as in this example

  1. Address: the static IP address you wish to set your Pi
  2. Netmask: Normally 255.255.255.0
  3. Gateway: The IP address of your router
  4. DNS: this MUST be set! 8.8.8.8 is for Google's DNS. Please choose any public DNS you wish. If it is not set you may experience issues on updates/upgrades to your system as the Pi fails to find servers.

Once done, press OK

Select Network

Reboot and reconnect using the new IP address


2) Exit the network interfaces file directly:

BPiM5:yourname:# cp /etc/network/interfaces /etc/network/interfaces.backup

Above backs up the original interfaces file, then edit the file:

BPiM5:yourname:# nano /etc/network/interfaces

Remove all text in the file and replace with your own:

# Ethernet adapter 0
auto eth0
allow-hotplug eth0
#no-auto-down eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.10
dns-nameservers 8.8.8.8 8.8.4.4

Reboot and reconnect using the new IP address

Next step: installing software - SAMBA Next