I followed tutorial from CANONICAL

Test foo worked as expected..

after running

sudo apt install cpu-checker
kvm-ok

kvm-ok checks:

Install maas:
wget -qO- https://raw.githubusercontent.com/canonical/maas-multipass/main/maas.yml \
 | multipass launch --name maas -c4 -m8GB -d32GB --cloud-init -
sudo snap restart multipass.multipassd
/etc/netplan/50-cloud-init.yaml
To set up a network bridge between your local network and MAAS network, you will need to create a new bridge interface and add your existing network interface to that bridge. Here are the steps to set up a bridge in Ubuntu using netplan:

Open the netplan configuration file located at /etc/netplan/50-cloud-init.yaml
Under the 'network' section, define a new bridge interface and give it a name, for example:
Copy code
bridges:
    br0:
        interfaces: [ens3]
        dhcp4: true
Replace the 'ethernets' section with 'interfaces' and assign the bridge interface to it, like this:
Copy code
interfaces:
    ens3:
        match:
            macaddress: 52:54:00:f2:cd:51
        set-name: ens3
        optional: true
Apply the changes by running the command "sudo netplan apply"
Check the status of the bridge using the command "sudo ip link show br0"
Once you have set up the bridge, you should be able to see the bridge interface, along with the interfaces that are part of the bridge, when you run the command "ifconfig" or "ip link show".
You can also use the command "sudo netplan --debug generate" to check the generated configuration and see if there are any errors or issues with the configuration file.
Please be careful while modifying the netplan file, a small typo can cause the network to stop working and also test it in a test environment before applying it to production.
ubuntu@maas:/etc/netplan$ cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
bridges:
    br0:
        interfaces: [ens3]
        dhcp4: true
interfaces:
    ens3:
        match:
            macaddress: 52:54:00:f2:cd:51
        set-name: ens3
        optional: true

#network:
#    ethernets:
#        ens3:
#            dhcp4: true
#            match:
#                macaddress: 52:54:00:f2:cd:51
#            set-name: ens3
#    version: 2
ubuntu@maas:/etc/netplan$ sudo netplan apply
/etc/netplan/50-cloud-init.yaml:6:1: Error in network definition: unknown key 'bridges'
bridges:
^
It looks like the version of netplan you are using does not support the 'bridges' key. The version of netplan that ships with Ubuntu 22.04 does not support bridge interfaces. In this version of Ubuntu, you can use the 'network-manager' or 'ifupdown' package to set up a bridge interface.

Here's how you can set up a bridge interface using the 'ifupdown' package:

Install the 'ifupdown' package by running the command "sudo apt install ifupdown"
Create a new file in the '/etc/network' directory and name it something like 'br0', this file will be used to configure the bridge interface.
Add the following lines to the file:
-----------
auto br0
iface br0 inet dhcp
    bridge_ports ens3

-----------
Replace 'ens3' with the name of the interface you want to add to the bridge.
Bring the bridge interface up by running the command "sudo ifup br0"
Verify that the bridge has been created and the interface has been added to it by running the command "ifconfig"
Please note that this setup is only temporary, and it will be lost if you reboot your system. To make the setup permanent, you will need to add the 'br0' file to the '/etc/network/interfaces.d' directory and update the '/etc/network/interfaces' file to include the line "source /etc/network/interfaces.d/*"

As the version of netplan you are using is not able to support the bridges key, you can use the above ifupdown method to setup bridge between local and MAAS network.
ubuntu@maas:/etc/netplan$ sudo vi /etc/network/br0
ubuntu@maas:/etc/netplan$ sudo ifup br0
ifup: unknown interface br0
ubuntu@maas:/etc/netplan$ cat /etc/network/br0
auto br0
iface br0 inet dhcp
    bridge_ports ens3
It appears that the 'ifup' command is not recognizing the 'br0' interface. This could be due to a couple of reasons:

The file '/etc/network/br0' is not in the correct location. In Ubuntu, the 'ifup' command looks for interface configuration files in the '/etc/network/interfaces.d' directory. You should move the 'br0' file to this directory.

The interfaces file '/etc/network/interfaces' is not include the line "source /etc/network/interfaces.d/*"

Try the following steps:

Move the 'br0' file to '/etc/network/interfaces.d' directory by running the command "sudo mv /etc/network/br0 /etc/network/interfaces.d"
Open the '/etc/network/interfaces' file in a text editor, and add the line "source /etc/network/interfaces.d/*"
Try bring up the bridge interface again by running the command "sudo ifup br0"
Verify that the bridge has been created and the interface has been added to it by running the command "ifconfig"
If the problem persists, please check the file permissions of the 'br0' file in '/etc/network/interfaces.d' directory, it should be readable and writable by root.
ubuntu@maas:/etc/network$ sudo mv br0 interfaces.d/
ubuntu@maas:/etc/network$ vi interfaces
ubuntu@maas:/etc/network$ sudo ifup br0
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "br0"
cat: /sys/class/net/br0/ifindex: No such file or directory
Error getting hardware address for "br0": No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.
ifup: failed to bring up br0
It looks like there may be an issue with the configuration of your network bridge.

The interfaces file should be in /etc/network/interfaces not /etc/network/interfaces.d/
You also need to install bridge-utils for creating the bridge, You can use this command 'sudo apt-get install bridge-utils'
check the iface name in the interfaces file, it should match with the name of the interface you want to bridge.
After that use this command 'sudo ifup br0' to bring up the bridge interface.
If you are still facing issue please share your complete interfaces file and also check if you have any other network configuration file that might be interfering.
kuber@kubertemplate:~$ multipass list
Name                    State             IPv4             Image
foo                     Running           10.145.208.105   Ubuntu 22.04 LTS
maas                    Running           10.145.208.226   Ubuntu 22.04 LTS
kuber@kubertemplate:~$ multipass shell maas
shell failed: ssh connection failed: 'Timeout connecting to 10.145.208.226'
kuber@kubertemplate:~$ multipass info maas
info failed: ssh connection failed: 'Timeout connecting to 10.145.208.226'
kuber@kubertemplate:~$ ssh ubuntu@10.145.208.226

Leave a Reply