Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #202758
| From | john doe <johndoe65534@mail.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only |
| Date | 2018-11-25 07:40 +0100 |
| Message-ID | <wXWff-mH-1@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <wXjnA-1dU-25@gated-at.bofh.it> <wXjxg-1hf-13@gated-at.bofh.it> <wXjGW-1kM-5@gated-at.bofh.it> <wXJUK-164-9@gated-at.bofh.it> <wXS1X-6e3-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 11/25/2018 3:05 AM, David Wright wrote: > On Sat 24 Nov 2018 at 12:25:20 (-0500), Gary Dale wrote: >> 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 >>> address 10.5.0.2/24 >>> gateway 10.5.0.1 >>> # dns-* options are implemented by the resolvconf package, if installed >>> dns-nameservers 8.8.8.8 >>> dns-search neoconsig.local >>> >>> Just changed 10.5.0.2 to 10.5.0.3 >>> >>> #ifdown enp0s3 >>> #ifup enp0s3 >> >> Reco has already explained why this approach is incorrect. > > The OP seems to prefer imagining a bug rather than taking much notice > of the replies. > >> 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. > > Yes, but it also appears that interfaces also defines how the network > is brought down again, which is what the OP doesn't understand. > >> If you >> want to change a running network, use ifconfig or ip to change the >> address. e.g. ifconfig enp-s3 10.5.0.3 should work since all you are >> changing is the ip address. > > I can't see any advantage in this as you have to do all the grunt work > yourself instead of letting ifdown/ifup do it for you. For example: > > Here's my normal /e/n/i: > > $ 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 enp0s14 > iface enp0s14 inet dhcp > $ > > I set up two static alternatives, one using the same address (13) as I > get from the router, and one wacky one (213) in the "intruder" range: > > allow-hotplug enp0s14 > iface enp0s14 inet static > address 192.168.1.13 > netmask 255.255.255.0 > gateway 192.168.1.1 > dns-nameservers 192.168.1.1 > > and > > allow-hotplug enp0s14 > iface enp0s14 inet static > address 192.168.1.213 > netmask 255.255.255.0 > gateway 192.168.1.1 > dns-nameservers 192.168.1.1 > > (the rest of each file is unchanged from the normal one). > > Running a script like: > > #!/bin/bash > ifdown enp0s14 > cp /etc/network/interfaces-static-213 /etc/network/interfaces > ifup enp0s14 > > releases the lease, downs the avahi-daemon, changes the network > address, restarts the ssh server, reconfigures ntpd, and ups the > avahi-daemon. My ssh session also goes dead (as I was logged in > that way). > > Logging in on 192.168.1.213 instead (and avoiding polluting my > known_hosts file) I can now run a similar script to the above, > that has the line > cp /etc/network/interfaces-static-13 /etc/network/interfaces > or > cp /etc/network/interfaces-normal-dhcp /etc/network/interfaces > in it, and my old ssh session comes alive again (the new session > going dead of course). The logs show all the other changes being > reversed back to normal, with a new lease etc. > TL-DR. Instead of using the cp command, one could use mapping stanza: http://manpages.ubuntu.com/manpages/bionic/man5/interfaces.5.html#mappings -- John Doe
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Still unable to restart networking on Debian 9 text mode only Luciano Andress Martini <analistaunix@gmail.com> - 2018-11-23 13:40 +0100
Re: Still unable to restart networking on Debian 9 text mode only Reco <recoverym4n@enotuniq.net> - 2018-11-23 13:50 +0100
Re: Still unable to restart networking on Debian 9 text mode only Reco <recoverym4n@enotuniq.net> - 2018-11-23 14:50 +0100
Re: Still unable to restart networking on Debian 9 text mode only Luciano Andress Martini <analistaunix@gmail.com> - 2018-11-23 14:10 +0100
Re: Still unable to restart networking on Debian 9 text mode only Luciano Andress Martini <analistaunix@gmail.com> - 2018-11-23 14:20 +0100
Re: Still unable to restart networking on Debian 9 text mode only Luciano Andress Martini <analistaunix@gmail.com> - 2018-11-23 14:30 +0100
Re: Still unable to restart networking on Debian 9 text mode only Gary Dale <garyndp@gmail.com> - 2018-11-24 18:30 +0100
Worked example, was Re: Still unable to restart networking on Debian 9 text mode only David Wright <deblis@lionunicorn.co.uk> - 2018-11-25 03:10 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only Gary Dale <garyndp@gmail.com> - 2018-11-25 03:40 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only David Wright <deblis@lionunicorn.co.uk> - 2018-11-25 16:20 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only Gary Dale <garyndp@gmail.com> - 2018-11-27 00:20 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only David Wright <deblis@lionunicorn.co.uk> - 2018-11-27 22:00 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only john doe <johndoe65534@mail.com> - 2018-11-25 07:40 +0100
Re: Worked example, was Re: Still unable to restart networking on Debian 9 text mode only David Wright <deblis@lionunicorn.co.uk> - 2018-11-25 17:00 +0100
Re: Still unable to restart networking on Debian 9 text mode only Rob van der Putten <rob@sput.nl> - 2018-11-25 17:30 +0100
Re: Still unable to restart networking on Debian 9 text mode only Luciano Andress Martini <analistaunix@gmail.com> - 2018-11-26 14:00 +0100
Re: Still unable to restart networking on Debian 9 text mode only Gary Dale <garyndp@gmail.com> - 2018-11-27 00:40 +0100
Re: Still unable to restart networking on Debian 9 text mode only David Wright <deblis@lionunicorn.co.uk> - 2018-11-27 22:10 +0100
Re: Still unable to restart networking on Debian 9 text mode only Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-23 14:10 +0100
Re: Still unable to restart networking on Debian 9 text mode only "Alexander V. Makartsev" <avbetev@gmail.com> - 2018-11-23 16:10 +0100
csiph-web