[SOLVED] ifreload -a in cron script does not update network interface changes in the cli shell after reboot.

WaxOnWaxOff

New Member
Jul 30, 2024
8
0
1
-after PVE Node reboot the script runs after one minute and checks the installed network interfaces
-the script updates a work interfaces file with the network interface devices it finds
-the script then copies the work interfaces file to /etc/network/interfaces which is backed-up
first
-the script then issues the "ifreload -a" command
-the webgui shows the correct changes that were made as per the /etc/network/interfaces config file
-opening the shell and issuing the "ip a" command shows the prior /etc/network/interfaces configuration
-the only resolve is to restart the networking service to align the output in the shell with the
webgui changes

Question(s):

Should the script be changed to restart the networking service after the "ifreload -a" command?
Shouldn't (according to the documentation) the "ifreload -a" command have updated and loaded the
new configuration displayed in the shell also?
Or, should the interfaces work file be copied as /etc/network/interfaces.new instead?
Does anything else, like firewall rules, need to be restarted as well?
 
to my knowledge, interfaces.new work only webgui
ifreload -a works with /etc/network/interfaces
 
Yes, according to the documentation:

"If you made manual changes directly to the /etc/network/interfaces file, you can apply them by running ifreload -a"

and,

"Reboot Node to Apply
Another way to apply a new network configuration is to reboot the node. In that case the systemd service pvenetcommit will activate the staging interfaces.new file before the networking service will apply that configuration."
----
So I want to confirm where the interfaces.new file is created - /etc/network it seems per documentation - so that perhaps I can change the script to copy the work template there as interfaces.new and then after the reboot, as per the documentation, either restart the pvenetcommit service or the networking service, or both, from the script after a one minute delay.

It's obvious "ifreload -a" is not working realtime.

I'm not sure what impact there is to the PVE firewall if either or both the pvenetcommit and/or networking services are restarted.

I'm willing to try, but need to confirm where to put the interfaces.new file first.
 
What happened?

So i left everything as was except I changed the script to instead use the following command - service networking reload - instead of ifreload.
-ran the script manually and both the webgui and cli shell were updated with a somewhat minor linux network configuration change
-rebooted the server; waited for a minute; confirmed the script ran again and everything was the same

So the question is, what really is the difference between using "ifreload -a" versus "service networking reload?"
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!