MusicLounge: Static IP


# OPTIONAL STATIC IP

# identify your ethernet card name usualy eth0 or enp3s0

  1. $ ip link show

# A DHCP CONFIG IS PERFECTLY VALID for building your Audophile Server,
#
# DHCP Reservation service (included in your netbox/router) provides an IP address to a specific client based on it’s physical MAC address.
# the device will always get the same IP address and it will never change as soon as you do not replace your Ethernet card.

# check /etc/network/interfaces and add the following DHCP entries if missing

  1. sudo nano /etc/network/interfaces

# if your eternet card is eth0

auto eth0
iface eth0 inet dhcp

# or if it’s enp3s0 (amd64)

auto enp3s0
iface enp3s0 inet dhcp

# CTRL+O to save
# CTRL+X to exit

# open your router dhcp setting and “reserve” the IP address of your audio server
# to skip the STATIC IP tutorial below
# go to the bottom page and click the NEXT POST button


Static IP Address - Click To Read More...
# identify your ethernet card name usualy eth0 or enp3s0

# WIFI IS NOT RECOMMENDED, remove your wifi card from your device

# and configure a static IP address in /etc/dhcpcd.conf:


# Static IP on Raspberry PI 4


  1. $ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000

# eth0 is your default interface (Ethernet connection), do not use wifi for your audio server

# if eth0 is NOT VISIBLE then pass net.ifnames=0 to the kernel cmd by adding this at the beginning of /boot/cmdline.txt and reboot

  1. $ sudo nano /boot/cmdline.txt


# save
CTRL+X then Y then ENTER

  1. $ sudo reboot

# to configure statis ip address

  1. $ sudo nano /etc/network/interfaces

# add the following lines at end (remove dhcp lines):

auto eth0
iface eth0 inet static
address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.x
gateway 192.168.x.x

# example:

auto eth0
iface eth0 inet static
address 192.168.1.75
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1


# Static IP on amd64 (Intel NUC, Mini PC,…)


# ON AMD64 PC

  1. $ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
3: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000

# enp3s0 is your default interface (Ethernet connection), do not use wifi for your audio server

  1. $ sudo nano /etc/network/interfaces

# add the following lines at end:

auto enp3s0
iface enp3s0 inet static
address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.x
gateway 192.168.x.x

# address = the choosen static IP address, EXAMPLE: 192.168.1.20
# network = your IPs range, EXAMPLE: 192.168.1.0
# gateway/router = your internet box LAN IP, EXAMPLe: 192.168.1.1

# CTRL+O to save
# CTRL+X to exit


  1. $ sudo systemctl restart networking


# get the status

  1. $ sudo systemctl status networking


# if everything okay reboot your system

  1. $ sudo reboot


# or type this cmd below with interface name (eth0 or enp3s0 ) and reboot manually

  1. $ sudo ifdown enp3s0


# here you’re loosing your SSH session obviously

# see troubleshooting page if static IP not working

# reboot system

# and start the NEW SSH SESSION WITH YOUR NEW STATIC IP! 😉


# STEP6
# to continue open SSH session with this time your new static IP address this time

# (click yes and accept the new certificate)

  1. $ login pi

Click the button NEXT below to continue…