How to change IP Address in Linux

login as root

#nano /etc/network/interfaces

add this script
please note, in my case
my adapter name is enp3s0

auto enp3s0
iface enp3s0 inet static
        address 172.16.2.4
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-namerservers 1.1.1.1, 1.0.0.1

ctrl+s to save
ctrl+x to exit from nano editor

#/etc/init.d/networking restart

DONE

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top