mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2024-12-24 14:59:25 -05:00
network-hooks: clarify the context in which it's executed and give more details for HVM
From Marek's comment: https://github.com/QubesOS/qubes-doc/pull/824#pullrequestreview-243813651
This commit is contained in:
parent
84e54147af
commit
40f7c883d7
@ -44,7 +44,7 @@ The scripts here all run as root.
|
||||
The file is used only in a VM with PCI devices attached.
|
||||
Intended for use with problematic device drivers.
|
||||
|
||||
- `/rw/config/network-hooks.d` - folder of scripts to be ran when configuring Qubes interfaces. For each script, the `command`, `vif`, `vif_type` and `ip` is passed as arguments (see `/etc/xen/scripts/vif-route-qubes`). For example, consider an PV AppVM `work` with IP `10.137.0.100` and `sys-firewall` as NetVM. Assuming it's Xen domain id is arbitrary `12` then, the following script located at `/rw/config/network-hooks.d/hook-100.sh` in `sys-firewall`:
|
||||
- In NetVMs/ProxyVMs, scripts placed in `/rw/config/network-hooks.d` will be ran when configuring Qubes interfaces. For each script, the `command`, `vif`, `vif_type` and `ip` is passed as arguments (see `/etc/xen/scripts/vif-route-qubes`). For example, consider an PV AppVM `work` with IP `10.137.0.100` and `sys-firewall` as NetVM. Assuming it's Xen domain id is arbitrary `12` then, the following script located at `/rw/config/network-hooks.d/hook-100.sh` in `sys-firewall`:
|
||||
~~~
|
||||
#!/bin/bash
|
||||
|
||||
@ -65,7 +65,7 @@ The scripts here all run as root.
|
||||
fi
|
||||
~~~
|
||||
|
||||
will be executed with arguments `online vif12.0 vif 10.137.0.100` when starting `work`. Please note that in case of HVM, the vif type is `vif_ioemu`.
|
||||
will be executed with arguments `online vif12.0 vif 10.137.0.100` when starting `work`. Please note that in case of HVM, the script will be called twice - once with vif_type `vif`, then with vif_type `vif_ioemu` (and different interface names). As long as the ioemu interface exists, it should be preferred (up to the hook script). When VM decide to use PV interface (vif_type `vif`), the ioemu one will be unplugged.
|
||||
|
||||
Note that scripts need to be executable (chmod +x) to be used.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user