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

Skyrider

Member
May 11, 2020
51
1
13
37
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!