OpenNebula / one-apps

Toolchain to build OpenNebula appliances
Apache License 2.0
12 stars 9 forks source link

one-context fails to config ip default route with netplan on Debian 12 #74

Closed leandroembu closed 2 months ago

leandroembu commented 3 months ago

I'm using two NICs (private and public) in two VMs. In Debian 11, with /etc/network/interfaces, everything works fine with one-context and I get my IP route via public NIC/Network. In Debian 12 I get a lot of issues:

I am using the same two virtual networks for both VMs, but the one with Debian 11 and /etc/network/interfaces has no issues. I guess its not a Netplan's problem.

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.

leandroembu commented 3 months ago

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

NETCFG_TYPE="interfaces"

rsmontero commented 3 months ago

Thanks, this probably need to be added to the marketplace template. I'll keep this issue open to do so

rsmontero commented 2 months ago

https://github.com/OpenNebula/one-apps/wiki/linux_feature#network-configuration We have included a note there about using METRIC to set route preferences when multiple gateways are defined.