[SOLVED] Imported lxc container (from non-prox to proxmox) gets no gateway address.

Skyrider

Active Member
May 11, 2020
55
1
28
38
As of yesterday, I've been attempted to export my non-proxmox lxc containers:

Code:
tar -cvpzf /tmp/filename.tar.gz --exclude=/filename.tar.gz --exclude="sys" --exclude="dev" --exclude="run" --exclude="proc" --exclude="*.log" --exclude="*.log*" --exclude="*.gz" --exclude="*.sql" --exclude="swap.img" /

And import it to proxmox:

Code:
pct create 100 "/tmp/filename.tar.gz" -description LXC -hostname filename --features nesting=1 -memory 512 -net0 name=eth0,ip=10.248.110.2/24,gw=10.248.110.1,bridge=vmbr0 --rootfs 25 -storage local-lvm -password somepassword

It created the proxmox lxc container just fine with the tar.gz file imported. Here's the config file of the container:

Code:
arch: amd64
description: LXC%0A
features: nesting=1
hostname: filename
memory: 512
net0: name=eth0,bridge=vmbr0,gw=10.248.110.1,hwaddr=4E:2C:FE:27:1D:80,ip=10.248.110.3/24,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-100-disk-0,size=25G
swap: 512

GUI shows the IP / Gateway address set as well, however.. No gateway is actually set.

ip a shows:
Code:
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: eth0@if48: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 4e:2c:fe:27:1d:80 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::4c2c:feff:fe27:1d80/64 scope link
       valid_lft forever preferred_lft forever
and ip r gives an empty result back.

hostname -i returns 10.248.110.3 (the IP i've given the container).

If I create a lxc container within proxmox using a default template, everything works as it should. So what did go wrong in exporting/importing the tar file?
 
Last edited:
**RESOLVED**

/etc/netplan/50-cloud.init.yaml

Was the cause, overwriting network settings. Erased it and rebooted the container. IP/Gateway is now properly set.