reload /etc/network/interfaces with out rebooting

Back in the good ole days before we had systemd I could edit /etc/network/interfaces and have networking restarted by doing a start stop on /etc/init.d/networking. But with systemd this doesn't seem to work. As well as running # /etc/init.d/networking restart I've tried # systemctl restart networking.service # service networking restart And the above commands with an explicit start then stop instead of restart. But any changes made to etc/network/interfaces aren't applied. On the survey the commands above appear to be doing nothing. I'm not using network-manager but resolvconf is installed and is populating /etc/resolv.conf, although only after a reboot. In the systemd world how do you restart networking with new settings with our rebooting? thanks in advance.

If you use /etc/network/interfaces then use ifup/ifdown to apply changes. On 2 April 2018 11:15:44 am GMT+11:00, Geoff D'Arcy via luv-main <luv-main@luv.asn.au> wrote:
Back in the good ole days before we had systemd I could edit /etc/network/interfaces and have networking restarted by doing a start stop on /etc/init.d/networking.
But with systemd this doesn't seem to work. As well as running # /etc/init.d/networking restart
I've tried # systemctl restart networking.service # service networking restart
And the above commands with an explicit start then stop instead of restart. But any changes made to etc/network/interfaces aren't applied. On the survey the commands above appear to be doing nothing.
I'm not using network-manager but resolvconf is installed and is populating /etc/resolv.conf, although only after a reboot.
In the systemd world how do you restart networking with new settings with our rebooting?
thanks in advance. _______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
-- Sent from my Huawei Mate 9 with K-9 Mail.

Have you tried "systemctl restart systemd-networkd" ? -Manoj.C On Mon, Apr 2, 2018 at 10:34 PM, Russell Coker via luv-main < luv-main@luv.asn.au> wrote:
If you use /etc/network/interfaces then use ifup/ifdown to apply changes.
On 2 April 2018 11:15:44 am GMT+11:00, Geoff D'Arcy via luv-main < luv-main@luv.asn.au> wrote:
Back in the good ole days before we had systemd I could edit /etc/network/interfaces and have networking restarted by doing a start stop on /etc/init.d/networking.
But with systemd this doesn't seem to work. As well as running # /etc/init.d/networking restart
I've tried # systemctl restart networking.service # service networking restart
And the above commands with an explicit start then stop instead of restart. But any changes made to etc/network/interfaces aren't applied. On the survey the commands above appear to be doing nothing.
I'm not using network-manager but resolvconf is installed and is populating /etc/resolv.conf, although only after a reboot.
In the systemd world how do you restart networking with new settings with our rebooting?
thanks in advance. _______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
-- Sent from my Huawei Mate 9 with K-9 Mail. _______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main

On 2018-04-03 08:32, Manoj C Menon via luv-main wrote:
Have you tried "systemctl restart systemd-networkd" ?
Thanks Manoj Yes did try that and not using netplan, however Russell's suggestion does exactly what I need so all good. Thanks Guys
-Manoj.C
On Mon, Apr 2, 2018 at 10:34 PM, Russell Coker via luv-main <luv-main@luv.asn.au <mailto:luv-main@luv.asn.au>> wrote:
If you use /etc/network/interfaces then use ifup/ifdown to apply changes.
On 2 April 2018 11:15:44 am GMT+11:00, Geoff D'Arcy via luv-main <luv-main@luv.asn.au <mailto:luv-main@luv.asn.au>> wrote: > >Back in the good ole days before we had systemd I could edit >/etc/network/interfaces and have networking restarted by doing a start >stop on /etc/init.d/networking. > >But with systemd this doesn't seem to work. As well as running ># /etc/init.d/networking restart > >I've tried ># systemctl restart networking.service ># service networking restart > >And the above commands with an explicit start then stop instead of >restart. But any changes made to etc/network/interfaces aren't >applied. >On the survey the commands above appear to be doing nothing. > >I'm not using network-manager but resolvconf is installed and is >populating /etc/resolv.conf, although only after a reboot. > >In the systemd world how do you restart networking with new settings >with our rebooting? > >thanks in advance. >_______________________________________________ >luv-main mailing list >luv-main@luv.asn.au <mailto:luv-main@luv.asn.au> >https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main <https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main>
-- Sent from my Huawei Mate 9 with K-9 Mail. _______________________________________________ luv-main mailing list luv-main@luv.asn.au <mailto:luv-main@luv.asn.au> https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main <https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main>
_______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main

On Tuesday, 3 April 2018 11:21:37 AM AEST Geoff D'Arcy via luv-main wrote:
On 2018-04-03 08:32, Manoj C Menon via luv-main wrote:
Have you tried "systemctl restart systemd-networkd" ?
Thanks Manoj
https://www.freedesktop.org/software/systemd/man/systemd.network.html https://wiki.archlinux.org/index.php/systemd-networkd https://www.freedesktop.org/software/systemd/man/systemd-networkd.service.ht... The above 3 URLs document the systemd-netorkd service, the last one notes "when configuration is updated and systemd-networkd is restarted, netdev interfaces for which configuration was removed will not be dropped, and may need to be cleaned up manually". So it seems that restarting systemd-networkd might not do what is desired. But I have never wanted to use it so I don't know a lot about it. While I generally think systemd is a good thing the networking side of it is something I haven't felt a need to use.
Yes did try that and not using netplan, however Russell's suggestion does exactly what I need so all good.
I believe that the traditional Debian network configuration (ifup/ifdown etc) developed in the mid 90's is for most systems the best way of doing things. The only exception I've found so far is wireless networks on laptops for which NetworkManager is usually quite good (apart from when it breaks and refuses to do anything). If you use ifup/ifdown then systemd won't know that much about what you are doing. It might be a good topic for a Saturday LUV meeting to explore these networking configuration issues. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

On 2018-04-04 15:21, Russell Coker via luv-main wrote:
https://www.freedesktop.org/software/systemd/man/systemd.network.html https://wiki.archlinux.org/index.php/systemd-networkd https://www.freedesktop.org/software/systemd/man/systemd-networkd.service.ht...
The above 3 URLs document the systemd-netorkd service, the last one notes "when configuration is updated and systemd-networkd is restarted, netdev interfaces for which configuration was removed will not be dropped, and may need to be cleaned up manually". So it seems that restarting systemd-networkd might not do what is desired. But I have never wanted to use it so I don't know a lot about it.
More to the point systemd-networkd [1] is a competing solution to ifupdown (and network-manager is another competing solution...). So restarting systemd-networkd [1] is not going to restart ifupdown based interfaces.
I believe that the traditional Debian network configuration (ifup/ifdown etc) developed in the mid 90's is for most systems the best way of doing things. The only exception I've found so far is wireless networks on laptops for which NetworkManager is usually quite good (apart from when it breaks and refuses to do anything). If you use ifup/ifdown then systemd won't know that much about what you are doing.
systemd-networkd [1] is newer and deals with newer features, e.g. mixed IPv4 and IPv6 networking configuration in a cleaner fashion. On the other hand, being able to bring up or down individual interfaces with ifup/ifdown is sometimes nice. I don't think you can do that with systemd-networkd [1], although I could be wrong here. I think both solutions can have quirks for making changes without rebooting. e.g. changing a DHCP interface to static can leave a DHCP process running that should be killed manually. Definitely the case for ifupdown; I suspect systemd-networkd might have the same issue (not absolutely sure here). systemd-networkd [1] supports different ways of identifying the network interface which can be useful at times, e.g.: [Match] Name=en* Could be useful if you are sure you will only have one network card, particularly as predictable network interface names comes in, can mean every computer has a different name for its network interface. Or: [Match] MACAddress=12:34:56:78:90:ab If you want to bind to an interface directly by its mac address. Links: ------ [1] https://www.freedesktop.org/software/systemd/man/systemd-networkd.service.ht...
participants (5)
-
Brian May
-
Geoff D'Arcy
-
Geoff D'Arcy
-
Manoj C Menon
-
Russell Coker