This is the detailed output of the commands that leads to the problem for me,
I hope this can be useful
Edoardo
----------------------------------------
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
allow-hotplug enp0s3
iface enp0s3 inet dhcp
----------------------------------------
# ls /etc/NetworkManager
ls: impossibile accedere a '/etc/NetworkManager': file o directory inesistente
----------------------------------------
# ifconfig enp0s3
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fP7P:7751 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:7P:77:51 txqueuelen 1000 (Ethernet)
RX packets 7 bytes 1726 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1734 (1.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
----------------------------------------
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.2 0.0.0.0 UG 0 0 0 enp0s3
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
————————————————————
*at this point I change the configuration*
----------------------------------------
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
----------------------------------------
#ifdown -v enp0s3
Configuring interface enp0s3=enp0s3 (inet)
/bin/run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/avahi-autoipd
run-parts: executing /etc/network/if-down.d/upstart
run-parts: executing /etc/network/if-down.d/wpasupplicant
/bin/ip route del default via 192.168.1.1 dev enpOs3 2>&1 1>/dev/null || true
RTNETLINK answers: No such process
bin/ip addr del 192.168.1.3/255.255.255.0 broadcast 192.168.1.255 dev enpOs3
label enpOs3
RTNETLINK answers: Cannot assign requested address
/bin/ip link set dev enpOs3 down
/bin/run-parts --verbose /etc/network/if-post-down.d
run-parts: executing /etc/network/if-post-down.d/wireless-tools
run-parts: executing /etc/network/if-post-down.d/wpasupplicant
----------------------------------------
#ifup -v enp0s3
Configuring interface enp0s3=enp0s3 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 192.168.1.3/255.255.255.0 broadcast 192.162.1.255 dev enpOs3
label enp0s3
/bin/ip link set dev enp0s3 up
/bin/ip route add default via 192.168.1.1 dev enp0s3 onlink
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-autoipd
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
----------------------------------------
# ifconfig enp0s3
enpOs3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fe7e:7751 prefixlen 64 scopeid Ox20<link>
ether 08:00:27:7e:77:51 txqueuelen 1000 (Ethernet)
RX packets 17 bytes 2516 (2.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33 bytes 3123 (3.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
----------------------------------------
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 enp0s3
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3