Dietpi Persistent Route

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
undert0wn
Posts: 2
Joined: Mon May 28, 2018 10:26 pm

Dietpi Persistent Route

Post by undert0wn »

I am finding that when I try to set a persistent route in dietpi it is only good until power is lost.

I used the following command:

Code: Select all

sudo ip route add 10.2.2.0/24 via 10.20.20.2
This works with reboots just fine but when I lost power the config was lost and it took me some time to figure out that the route being lost was the problem.

I tried adding the following to /etc/network/interfaces but it broke my traffic all together:

Code: Select all

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 10.20.20.16
netmask 255.255.255.0
gateway 10.20.20.1
dns-nameservers 10.20.20.1
up route add -net 10.2.2.0/24 gw 10.20.20.2 dev eth0
What is the correct way to add a permanent route on DietPi?
Post Reply