Have following configuration in /etc/network/interfaces
auto enp1s0 iface enp1s0 inet static address 192.168.1.3 netmask 255.255.255.0 gateway 192.168.1.1 mtu 1500 dns-nameserver 184.108.40.206
After boot internet works.
Suppose one wants to change his address from 192.168.1.3 to 192.168.1.5
ifconfig enp1s0 192.168.1.5 netmask 255.255.255.0
But now internet does not work! Even if reset ip back to 192.168.1.3
ifconfig enp1s0 192.168.1.3 netmask 255.255.255.0
it does not connect to the internet, only after reboot it works again with specified in /etc/network/interfaces static address. I read man pages, tried various commands with ip, route, ifconfig - does not seem to help.
Could you please show how to solve the problem?