How to change the gateway address

Currently the default gateway IP is and the IP is
because almost PC use as default Gateway as well, it will be conflicted in some situation.
Is there any way we can set the default Gateway IP to be and the IP to be without using dietpi-config tool?
I have modified the dietpi.txt in the SD, it doesn’t work. please advise
Thanks in advance


many thanks for your report. Is there a partikular reason why you don’t like to use dietpi-config? It’s the easiest way to change/manage network settings. However you should be able to adjust settings as well within /etc/network/interfaces file.

Network setting within dietpi.txt are used during first boot only. They are not applicable during normal run. That’s way they are marked starting AUTO_SETUP_NET_*. As well there is a message within config file right before this section.

# D I E T - P I
# DietPi-Automation settings, applied on first boot of DietPi only, ONCE!

Gateway is the address of your internet modem/router. I don’t know how there could be a conflict if all of the machines use the same gateway.

I guess he was pointing out that the default values could lead to local issues and conflict with local settings in some cases if not changed. However the default setting is to use DHCP. This way you will always get an IP address from your router or DHCP server. Therefore you will not run into any issues with default settings. And disabling DHCP you will do actively. Means you know that you need to set correct static IP values.