Static IP and DNS on RaspberryPi with lora gateway os

Hey guys,

trying to set static ip and dns for eth0 on Raspberry Pi3 with lora full Gateway os installed.
I managed to set the ip via ifconfig but it’s always lost after rebooting the PI.

I also edited the “interfaces file” under /etc/Network with:

from Default iface eth0 inet dhcp
to:

iface eth0 inet static
adress xx.xx.xx.xx
netmask xx.xx.xx.xx
network xx.xx.xx.xx
gateway xx.xx.xx.xx

But it wont work.

Is there another config file for doing this or do i have to activate the interface file?

Greetings and thanks

freedom67

Hi,

FYI: https://www.raspberrypi.org/forums/viewtopic.php?t=221060

More specifically: https://www.raspberrypi.org/forums/viewtopic.php?t=221060#p1357512

Thank you but the regular ways wont work as the Gateway OS Runs on an older Version of Linux.
But we found a way by adding a bash script to the System Startup:

#!/bin/sh
DESC=“FIX NETWORK”

case “$1” in
start)
echo “Starting $DESC”
ifconfig eth0 “ip” netmask “mask” up
;;
stop)
echo “Stopping $DESC”
do_stop
;;
restart|force-reload)
echo “Restarting $DESC”
do_stop
sleep 1
do_start
;;
*)
echo “Usage: $0 {start|stop|restart|force-reload}” >&2
exit 1
;;
esac

exit 0

CLI:
raspberrypi3:/etc/init.d# ./network start
Starting FIX NETWORK
raspberrypi3:/etc/init.d# sysctl
raspberrypi3:/etc/init.d# chmod 755 network
raspberrypi3:/etc/init.d# update-rc.d network defaults
Adding system startup for /etc/init.d/network.
raspberrypi3:/etc/init.d# ll /etc/init.d/network

FYI ! This topic can get closed.

Hi @Tim_E,

Acutally we are having an issue resolving the Static IP for the Gateway OS. Can I ask what network did you give while editing the interfaces file?

Mine seem to not work when I try to change the default series (xx.xx.7.xx) series with the (xx.xx.1.xx).

Static Ip was allotted but the problem that arose was that the redis wasn’t able to connect to (xx.xx.1.xx) this network, thereby crashing the application server. It worked fine with the (xx.xx.7.xx) series.

It would be great if you could help me!