Debian 12 (from marketplace) netplan does not apply context with netplan

I have 2 VMs, Debian 11 and Debian 12, both from OpenNebula Public Marketplace.
Both VMs have 2 NICs (public and private bridges which are not the problem here).

I have configured public IPs on both VMs.

The context generated /etc/network/interfaces in Debian 11 works fine, with all routes working. But the context generated /etc/netplan/50-cloud-init.yaml does not work and I end with a system with no default route.

I have done nothing, just selected the virtual networks to instance both VMs. I can’t understand wtf is going on with netplan in OpenNebula’s Debian 12 image (an why tf they use netplan).

Can you help me?

image

Checking /var/log/syslog, if I have only public NIC/Network: no ip route at all.

Checking /var/log/syslog, if I have both public and private NIC/Network: Error: Conflicting default route declarations for IPv4 (table: main, metric: 0), first declared in eth1 but also in eth0.

Is there any known issue in one-context netplan config? There are no errors when I’m using /etc/network/interfaces in Debian 11, for example, and I guess it’s not a netplan issue.

Here is the /etc/netplan/50-one-context.yaml generated by one-context:

# Generated by one-context
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - <public-ip>/32
      routes:
        - to: "0.0.0.0/0"
          via: <public-gateway>
          metric: 0
    eth1:
      addresses:
        - 10.10.114.160/16
      routes:
        - to: "0.0.0.0/0"
          via: 10.10.114.1
          metric: 0

Here is the default route after the β€œError: Conflicting default route declarations for IPv4 (table: main, metric: 0), first declared in eth1 but also in eth0”:

default via 10.10.114.1 dev eth1 proto static 
10.10.0.0/16 dev eth1 proto kernel scope link src 10.10.114.160

I can’t get the ip route from my public NIC, even if I start the VM only with public NIC.

I changed NETCFG_TYPE following rollback instructions found in the one-apps releases page to get it working in Debian 12 cloud image.

NETCFG_TYPE="interfaces"

Even though this solved the route problem, the problem between one-context and netplan remains.

Can you send the VM instance template for this debian 12 issue to see if we can reproduce it ?

1 Like

The image used is Debian 12 from OpenNebula Marketplace (Apps section). Now it’s working fine using old /etc/network/interfaces and ifupdown.

Template (excluding NETCFG_TYPE = β€œinterfaces” line):

AUTOMATIC_DS_REQUIREMENTS = β€œ("CLUSTERS/ID" @> 100)”
AUTOMATIC_NIC_REQUIREMENTS = β€œ("CLUSTERS/ID" @> 100)”
AUTOMATIC_REQUIREMENTS = β€œ(CLUSTER_ID = 100) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED)”
CONTEXT = [
DISK_ID = β€œ1”,
ETH0_DNS = β€œ8.8.8.8 8.8.4.4”,
ETH0_EXTERNAL = β€œβ€,
ETH0_GATEWAY = β€œβ€,
ETH0_IP = β€œβ€,
ETH0_IP6 = β€œβ€,
ETH0_IP6_GATEWAY = β€œβ€,
ETH0_IP6_METHOD = β€œβ€,
ETH0_IP6_METRIC = β€œβ€,
ETH0_IP6_PREFIX_LENGTH = β€œβ€,
ETH0_IP6_ULA = β€œβ€,
ETH0_MAC = β€œ02:00:00:e9:a6:c6”,
ETH0_MASK = β€œ255.255.255.255”,
ETH0_METHOD = β€œstatic”,
ETH0_METRIC = β€œβ€,
ETH0_MTU = β€œβ€,
ETH0_NETWORK = β€œβ€,
ETH0_SEARCH_DOMAIN = β€œβ€,
ETH0_VLAN_ID = β€œβ€,
ETH0_VROUTER_IP = β€œβ€,
ETH0_VROUTER_IP6 = β€œβ€,
ETH0_VROUTER_MANAGEMENT = β€œβ€,
ETH1_DNS = β€œ8.8.8.8 8.8.4.4”,
ETH1_EXTERNAL = β€œβ€,
ETH1_GATEWAY = β€œ10.10.114.1”,
ETH1_IP = β€œ10.10.114.160”,
ETH1_IP6 = β€œβ€,
ETH1_IP6_GATEWAY = β€œβ€,
ETH1_IP6_METHOD = β€œβ€,
ETH1_IP6_METRIC = β€œβ€,
ETH1_IP6_PREFIX_LENGTH = β€œβ€,
ETH1_IP6_ULA = β€œβ€,
ETH1_MAC = β€œ02:00:0a:0a:72:a0”,
ETH1_MASK = β€œ255.255.0.0”,
ETH1_METHOD = β€œβ€,
ETH1_METRIC = β€œβ€,
ETH1_MTU = β€œβ€,
ETH1_NETWORK = β€œ10.10.0.0”,
ETH1_SEARCH_DOMAIN = β€œβ€,
ETH1_VLAN_ID = β€œβ€,
ETH1_VROUTER_IP = β€œβ€,
ETH1_VROUTER_IP6 = β€œβ€,
ETH1_VROUTER_MANAGEMENT = β€œβ€,
NETWORK = β€œYES”,
SSH_PUBLIC_KEY = β€œβ€,
TARGET = β€œhda” ]
CPU = β€œ0.3”
DISK = [
ALLOW_ORPHANS = β€œFORMAT”,
CLONE = β€œYES”,
CLONE_TARGET = β€œSYSTEM”,
CLUSTER_ID = β€œ100”,
DATASTORE = β€œDefault-D02”,
DATASTORE_ID = β€œ101”,
DEV_PREFIX = β€œvd”,
DISK_ID = β€œ0”,
DISK_SNAPSHOT_TOTAL_SIZE = β€œ0”,
DISK_TYPE = β€œFILE”,
DRIVER = β€œqcow2”,
FORMAT = β€œqcow2”,
IMAGE = β€œDebian 12 D02 Image”,
IMAGE_ID = β€œ24”,
IMAGE_STATE = β€œ2”,
LN_TARGET = β€œSYSTEM”,
ORIGINAL_SIZE = β€œ20480”,
READONLY = β€œNO”,
SAVE = β€œNO”,
SIZE = β€œ20480”,
SOURCE = β€œ/var/lib/one//datastores/101/c8c3121cc1996024293cb50ee39a4cd1”,
TARGET = β€œvda”,
TM_MAD = β€œshared”,
TM_MAD_SYSTEM = β€œssh”,
TYPE = β€œFILE” ]
GRAPHICS = [
LISTEN = β€œ0.0.0.0”,
PORT = β€œ5949”,
TYPE = β€œVNC” ]
MEMORY = β€œ2048”
MEMORY_MAX = β€œ16384”
MEMORY_RESIZE_MODE = β€œBALLOONING”
NIC = [
AR_ID = β€œ0”,
BRIDGE = β€œbr0”,
BRIDGE_TYPE = β€œlinux”,
CLUSTER_ID = β€œ100”,
GATEWAY = β€œβ€,
IP = β€œβ€,
MAC = β€œ02:00:00:e9:a6:c6”,
METHOD = β€œstatic”,
NAME = β€œNIC0”,
NETWORK = β€œPonte externa D02”,
NETWORK_ID = β€œ32”,
NIC_ID = β€œ0”,
SECURITY_GROUPS = β€œ0”,
TARGET = β€œone-49-0”,
VN_MAD = β€œbridge” ]
NIC = [
AR_ID = β€œ1”,
BRIDGE = β€œbr1”,
BRIDGE_TYPE = β€œlinux”,
CLUSTER_ID = β€œ100”,
GATEWAY = β€œ10.10.114.1”,
IP = β€œ10.10.114.160”,
MAC = β€œ02:00:0a:0a:72:a0”,
NAME = β€œNIC1”,
NETWORK = β€œPonte interna D02”,
NETWORK_ID = β€œ31”,
NETWORK_UNAME = β€œleandro”,
NIC_ID = β€œ1”,
SECURITY_GROUPS = β€œ0”,
TARGET = β€œone-49-1”,
VN_MAD = β€œbridge” ]
OS = [
UUID = β€œ3f811896-1e3b-4094-87f6-6532415e29da” ]
SECURITY_GROUP_RULE = [
PROTOCOL = β€œALL”,
RULE_TYPE = β€œOUTBOUND”,
SECURITY_GROUP_ID = β€œ0”,
SECURITY_GROUP_NAME = β€œdefault” ]
SECURITY_GROUP_RULE = [
PROTOCOL = β€œALL”,
RULE_TYPE = β€œINBOUND”,
SECURITY_GROUP_ID = β€œ0”,
SECURITY_GROUP_NAME = β€œdefault” ]
TEMPLATE_ID = β€œ23”
TM_MAD_SYSTEM = β€œssh”
VCPU = β€œ1”
VCPU_MAX = β€œ16”
VMID = β€œ49”

Try issuing different metric values for each of the interfaces configuration. For example set ETH0_METRIC to 100 and ETH1_METRIC to 200. In the yaml you sent, both are 0, which could be the cause of the conflict.

Alternatively, use only 1 default gw and static routes.