trents_blog/site/search/search_index.json

1 line
273 KiB
JSON
Raw Normal View History

{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"","title":"Home"},{"location":"links/","text":"Trent's Blog Links Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"links/#trents-blog","text":"","title":"Trent's Blog"},{"location":"links/#links","text":"Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"rss/","text":"Trent's Blog RSS Created Updated Links Home Links","title":"RSS"},{"location":"rss/#trents-blog","text":"","title":"Trent's Blog"},{"location":"rss/#rss","text":"Created Updated","title":"RSS"},{"location":"rss/#links","text":"Home Links","title":"Links"},{"location":"posts/add-kvm-network-with-virsh/","text":"date: 2021-10-16 Introduction This is a short and sweet walk-through for how to create a new network for libvirt for kvm , from the command line, using virsh . Name Resolution Let's start with name resolution. Install libnss-libvirt : apt install libnss-libvirt In /etc/nsswitch.conf , add libvirt to hosts key. # /etc/nsswitch.conf # change this ... hosts: files dns mymachines ... # to this ... hosts: files libvirt dns mymachines ... Starter XML You could dumpxml on the existing default network: virsh net-dumpxml default > foonet.xml Then, edit foonet.xml: remove the network uuid change the network name to taste remove the bridge mac change the bridge name to taste change the bridge ip address and dhcp range to taste <!-- foonet.xml --> <network> <name> foonet </name> <forward mode= 'nat' > <nat> <port start= '1024' end= '65535' /> </nat> </forward> <bridge name= 'virbr101' stp= 'on' delay= '0' /> <ip address= '10.55.44.1' netmask= '255.255.255.0' > <dhcp> <range start= '10.55.44.2' end= '10.55.44.254' /> </dhcp> </ip> </network> Define The Network With the above xml file: virsh net-define foonet.xml The network definition can now be found in /etc/libvirt/qemu/networks/foonet.xml <!-- /etc/libvirt/qemu/networks/foonet.xml --> <!-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: virsh net-edit foonet or other application using the libvirt API. --> <network> <name> foonet </name> <uuid> e6e40bfc-d449-4043-924c-ca0f0edf4210 </uuid> <forward mode= 'nat' > <nat> <port start= '1024' end= '65535' /> </nat> </forward> <bridge name= 'virbr111' stp= 'on' delay= '0' /> <mac address= '52:54:00:49:a7:f8' /> <ip address= '10.55.44.1' netmask= '255.255.255.0' > <dhcp> <range start= '10.55.44.2' end= '10.55.44.254' /> </dhcp> </ip> </network> You could also start the network without defining it using virsh net-create foonet.xml . Start/Stop Start the network virsh net-start foonet Stop the network virsh net-destroy foonet Undefine the network virsh net-undefine foonet Autostart the network virsh net-autostart foonet Disable autostart for the network virsh net-autostart foonet --disable Tab completion is you friend!","title":"Add KVM Network With Virsh"},{"location":"posts/add-kvm-network-with-virsh/#introduction","text":"This is a short and sweet walk-through for how to create a new network for libvirt for kvm , from the command line, using virsh .","title":"Introduction"},{"location":"posts/add-kvm-network-with-virsh/#name-resolution","text":"Let's start with name resolution. Install libnss-libvirt : apt install libnss-libvirt In /etc/nsswitch.conf , add libvirt to hosts key. # /etc/nsswitch.conf # change this ... hosts: files dns mymachines ... # to this ... hosts: files libvirt dns mymachines ...","title":"Name Resolution"},{"location":"posts/add-kvm-network-with-virsh/#starter-xml","text":"You could dumpxml on the existing default network: