net-edit launches the command (or script) is defined in the users $EDITOR environment variable, passing it a temporary copy of the XML configuration for the virtual network.
net-edit checks if the temporary file was changed.
net-edit validates it to ensure it's error free. If no errors are found, net-edit then overwrites the existing saved virtual network configuration using it.
net-edit --network network-identifier
| Name | Required? | Description |
|---|---|---|
--network network-identifier
|
Required
|
The name or UUID of the virtual network whose XML configuration is to be edited.
The word "
--network" itself is optional.
|
virsh #net-editmynetwork
mynetwork".
virsh #net-edit--networkmynetwork
virsh #net-editbfbc4c69-7d6a-cc9a-904c-09910ce179c0
bfbc4c69-7d6a-cc9a-904c-09910ce179c0".
virsh #net-edit--networkbfbc4c69-7d6a-cc9a-904c-09910ce179c0
virsh # net-list --all Name State Autostart ----------------------------------------- default active yes examplenetwork active no
examplenetwork":
virsh # net-dumpxml examplenetwork <network> <name>examplenetwork</name> <uuid>b7005dec-be1a-fe9a-338a-0cb1301dfcfd</uuid> <forward mode='route'/> <bridge name='virbr100' stp='on' delay='0' /> <ip address='10.10.120.1' netmask='255.255.255.0'> </ip> </network>
net-edit, we launch an editor on the XML fragment. (vi is the editor shown):
virsh #net-editexamplenetwork
<network> <name>examplenetwork</name> <uuid>b7005dec-be1a-fe9a-338a-0cb1301dfcfd</uuid> <forward mode='route'/> <bridge name='virbr100' stp='on' delay='30' /> <-- 0 changed to 30 here <ip address='10.10.120.1' netmask='255.255.255.0'> </ip> </network> ~ ~ ~ ~ ~ ~ "/tmp/virsht2UZ6L" 8L, 238C
net-edit automatically copies the temporary XML to the saved configuration, if no errors in it were detected.
Network examplenetwork XML configuration edited.examplenetwork" virtual network is started, it will use the new value.