Setting a static IP on linux

Find your ethernet interface

ip addr show

Add the address on the subnet you would like, same as the device you are interacting with

sudo ip addr add 192.168.1.10/24 dev enp3s0

You can now access things such as IP cameras with fixed IP addresses that don't require DHCP

Afterwards, you may have to flush the IP address to revert to DHCP

sudo ip addr flush dev enp3s0

Last Updated: 17/09/2025

Published: 17/09/2025