Libvirt: Difference between revisions

imported>Onny
Add bridge networking example
imported>Onny
mNo edit summary
Line 55: Line 55:
=== Bridge networking ===
=== Bridge networking ===


Create a XML file with the definition of the bridge interface
Create a XML file called <code>virbr0.xml</code> with the definition of the bridge interface


{{file|virbr0.xml|nix|<nowiki>
<syntaxhighlight lang="bash">
<network>
<network>
   <name>virbr0</name>
   <name>virbr0</name>
Line 63: Line 63:
   <bridge name='virbr0'/>
   <bridge name='virbr0'/>
</network>
</network>
</nowiki>}}
</syntaxhighlight>


Add and enable bridge interface
Add and enable bridge interface
Line 83: Line 83:
Add
Add


{{file|my_guest.xml|nix|<nowiki>
<syntaxhighlight lang="bash">
   <devices>
   <devices>
     [...]
     [...]
Line 94: Line 94:
     [...]
     [...]
   </devices>
   </devices>
</nowiki>}}
</syntaxhighlight>


Inside the guest configure networking for the interface <code>enp1s0</code> (name might differ)
Inside the guest configure networking for the interface <code>enp1s0</code> (name might differ)