How to change(where are the network settings?) the routing correctly?

Qubes 4.0
Let’s say I need to do something like this:

ip r del default
ip r add via <ip eth0 interface>

Is it okay to do this in a file /rw/config/rc.local?
For good, need something like /etc/network/interfaces

Hi @joreke . Have you checked the docs? Specifically the following

Yes, I looked at this documentation and didn’t find an answer there.
There is an example here - /rw/config/network-hooks.d/
But it didn’t work for me.

1 Like

You mean it did nothing? Post the contents of your file.
Check out the use of bind-dirs:

Here is my file, but it doesn’t work. Maybe it’s the parameters that are passed? Does it accurately transmit ‘online’ when VM starting?
chmod +x /rw/config/network-hooks.d/



case "$command" in
	  ip r del default
	  ip r add via ${ip}

And thanks for the link. create a directory and a file in it is not enough( /rw/config/network-hooks.d/

That script is only called in a netvm - is the qube you are working on a

Do you mean that?

    Property type: VM
    To which NetVM connect. Default value (–default option) will follow system-global default NetVM (managed by qubes-prefs). Setting to empty name will disable networking in this VM.

In qube (sys-destroy-route-qube) has in properties netvm (sys-firewall). But he himself is not netvm.

Yes - as stated in the docs that script is only called in a netvm.
Since sys-destroy-route-qube is not a netvm the script will never be

Works through /rw/config/rc.local.
Is it correct to place these commands in this file?