Web lists-archives.com

Re: Still unable to restart networking on Debian 9 text mode only

On 2018-11-23 8:25 a.m., Luciano Andress Martini wrote:
Additional information - Again Debian 9.6 Fresh Install without
graphical interface:

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
allow-hotplug enp0s3
iface enp0s3 inet static
     # dns-* options are implemented by the resolvconf package, if installed
     dns-search neoconsig.local

Just changed to

#ifdown enp0s3
#ifup enp0s3

Reco has already explained why this approach is incorrect.

My own two cents on the problem is that Interfaces is meant to define how the network is brought up, not to change a running network. If you want to change a running network, use ifconfig or ip to change the address. e.g. ifconfig enp-s3 should work since all you are changing is the ip address.