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

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

ip r del default
ip r add 8.8.8.8 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 https://www.qubes-os.org/doc/config-files/ - /rw/config/network-hooks.d/hook-100.sh
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: https://www.qubes-os.org/doc/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?
/rw/config/network-hooks.d/hook-100.sh
chmod +x /rw/config/network-hooks.d/hook-100.sh

#!/bin/bash

command="$1"
vif="$2"
vif_type="$3"
ip="$4"

case "$command" in
  online)
	  ip r del default
	  ip r add 8.8.8.8 via ${ip}
	  ;;
esac

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

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

Do you mean that?

netvm
    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
called.

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