How to do it...

To configure a new NAT network and connect a KVM instance to it, run the following:

  1. List all available networks:
root@kvm:~# virsh net-list --all Name       State    Autostart     Persistent---------------------------------------------------------- default    active    yes          yesroot@kvm:~#
  1. Dump the configuration of the default network:
root@kvm:~# virsh net-dumpxml default<network connections='1'> <name>default</name> <uuid>2ab5d22c-5928-4304-920e-bc43b8731bcf</uuid> <forward mode='nat'>   <nat>     <port start='1024' end='65535'/>   </nat> </forward> <bridge name='virbr0' stp='on' delay='0'/> <ip address='192.168.122.1' netmask='255.255.255.0'>   <dhcp>     <range start='192.168.122.2' end='192.168.122.254'/>   </dhcp> </ip></network>root@kvm:~#
  1. Compare ...

Get KVM Virtualization Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.