O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required