User Tools

Site Tools


ubuntu:kvm:install_and_configure_kvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:kvm:install_and_configure_kvm [2020/08/10 23:17] 192.168.1.1ubuntu:kvm:install_and_configure_kvm [2020/08/10 23:33] (current) 192.168.1.1
Line 307: Line 307:
       dhcp6: no       dhcp6: no
 </file> </file>
 +
 +After modifying the network config file, save and close it.
 +
 +Apply the changes by running the following command:
 +
 +<code bash>
 +sudo netplan --debug  apply
 +</code>
 +
 +Now check if the IP address has been assigned to the bridge interface:
 +
 +<code bash>
 +ip a
 +</code>
 +
 +returns:
 +
 +<code bash>
 +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
 +    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 +    inet 127.0.0.1/8 scope host lo
 +       valid_lft forever preferred_lft forever
 +    inet6 ::1/128 scope host 
 +       valid_lft forever preferred_lft forever
 +2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
 +    link/ether b4:2e:99:3e:e5:20 brd ff:ff:ff:ff:ff:ff
 +3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
 +    link/ether b4:2e:99:3e:e5:22 brd ff:ff:ff:ff:ff:ff
 +4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
 +    link/ether b4:2e:99:3e:e5:22 brd ff:ff:ff:ff:ff:ff
 +    inet 192.168.1.69/24 brd 192.168.1.255 scope global br0
 +       valid_lft forever preferred_lft forever
 +    inet6 fe80::b62e:99ff:fe3e:e522/64 scope link 
 +       valid_lft forever preferred_lft forever
 +5: wlp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
 +    link/ether d0:ab:d5:91:98:3f brd ff:ff:ff:ff:ff:ff
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The bridged network interface **br0** is assigned with IP address 192.168.1.69 and the enp3s0 entry now has an **master br0** entry.  It means that enp3s0 belongs to the bridge.
 +</WRAP>
 +
 +----
 +
 +===== Show the Bridge Status =====
 +
 +<code bash>
 +brctl show br0
 +</code>
 +
 +returns:
 +
 +<code bash>
 +bridge name bridge id STP enabled interfaces
 +br0 8000.b42e993ee522 yes enp3s0
 +</code>
 +
 +----
 +
 +===== Configure KVM to use the bridge =====
 +
 +Create a an XML file called **bridge.xml**.
 +
 +Add the following lines:
 +
 +<file bash bridge.xml>
 +<network>
 +  <name>br0</name>
 +  <forward mode="bridge"/>
 +  <bridge name="br0"/>
 +</network>
 +</file>
 +
 +
 +Start the newly created bridge and make it as default bridge for VMs.
 +
 +<code bash>
 +virsh net-define bridge.xml
 +</code>
 +
 +returns:
 +
 +<code bash>
 +Network br0 defined from bridge.xml
 +</code>
 +
 +
 +Start the bridge.
 +
 +<code bash>
 +virsh net-start br0
 +</code>
 +
 +returns:
 +
 +<code bash>
 +Network br0 started
 +</code>
 +
 +Configure the bridge to autostart each time the system reboots.
 +
 +<code>
 +virsh net-autostart br0
 +</code>
 +
 +returns
 +
 +<code bash>
 +Network br0 marked as autostarted
 +</code>
 +
 +----
 +
 +===== Verify that the bridge is active and started =====
 +
 +<code bash>
 +virsh net-list --all
 +</code>
 +
 +returns:
 +
 +<code bash>
 + Name   State    Autostart   Persistent
 +-----------------------------------------
 + br0    active   yes         yes
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  Congratulations!  The KVM bridge is active now.
 +</WRAP>
  
  
ubuntu/kvm/install_and_configure_kvm.1597101467.txt.gz · Last modified: 2020/08/10 23:17 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki