0

I'm trying to setup KVM on Ubuntu 18.04.1 Server.

I tried following the instructions here, however I got stuck at the part which has me configure the bridge.

  1. I don't have a 50-cloud-init.yaml file, only a 01-netcfg.yaml file (not a cloud setup, so I figured I could edit 01 file instead)
  2. My interface is called eno1 and not enp0s3 (but I think I corrected that just fine?).
  3. I get an error when mapping the interface:

    Error in network definition //etc/netplan/01-netcfg.yaml line 12 column 15: expected mapping

Here is the file:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes

  version: 2
  bridges:
        br0:
           interfaces: [eno1]
        dhcp4: no
        dhcp6: no
        addresses: [172.168.0.10/24]
        gateway4: 172.168.0.1
        nameservers:
           addresses: [172.168.0.1]

As you can see it is complaining about my mapping: interfaces: [eno1]

So here are a few questions

  1. What is wrong with the mapping on line 12?
  2. Should I be replacing the 172.168.0.X IPs with the IP of the host machine? Or is 172.168.0.X some special internal IP for KVM? (sorry if this is a dumb question)
  3. The VMs will each have their own IP address on the network, assigned by my router, so should I be setting dhcp4 to 'yes' on line 13?

Much appreciated!

NEW2WEB
  • 119
  • 1
  • 6
  • I think you have to indent the block starting with `dhcp4: no` to match with `interfaces: [eno1]`. – Thomas Oct 06 '18 at 09:06
  • 1
    Why are you trying to start a DHCP client on eno1? This is going to be a port on your bridge. Nothing should be on it directly. – Michael Hampton Oct 06 '18 at 12:32
  • @MichaelHampton , I'm just following the instructions that were laid out in the step by step instructions setup in the article I referenced in my first paragraph. I figured the bridge was supposed to allow the Guest OS'es (on the VMs) in KVM to use the main NIC. TBH I don't know what I'm doing here except blindly following directions and seeing if they work – NEW2WEB Oct 08 '18 at 15:15
  • @Thomas, indentation seems to have worked in getting the 'netplan' to apply. Any thoughts on Michael's comments wrt setting up DHCP client on eno1? To be clear, this is the HOST Os (Ubuntu 18.04.1) running directly on hardware - hence I thought that eno1 was reference to the NIC. I feel slightly[ahem] out of my depth here. – NEW2WEB Oct 08 '18 at 15:20
  • Well, MichaelHampton is absolutely right. IP address configuration is done on the bridge. – Thomas Oct 08 '18 at 16:01

0 Answers0