Networking configuration after convert openVZ to LXC

sakyamuni13

Member
Feb 25, 2020
19
1
21
42
Hello, i am new on Proxmox, i have an old proxmox ve 2.1 where there is an openVZ server (vm id 404).
I also have a new proxmox ve 6.1 where i convert this machine on this new proxmox.
I have read this tutorial, very good : https://pve.proxmox.com/wiki/Convert_OpenVZ_to_LXC
Everything is ok, i see my vm on my new proxmox but there is a problem with network configuration.

Here is the network/interfaces on openVZ VM :
Code:
# This configuration file is auto-generated.
#
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and
# /etc/network/interfaces.tail instead, their contents will be
# inserted at the beginning and at the end of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.
#

# Auto generated lo interface
auto lo
iface lo inet loopback

# Auto generated venet0 interface
auto venet0
iface venet0 inet manual
        up ifconfig venet0 up
        up ifconfig venet0 127.0.0.2
        up route add default dev venet0
        down route del default dev venet0
        down ifconfig venet0 down


iface venet0 inet6 manual
        up route -A inet6 add default dev venet0
        down route -A inet6 del default dev venet0

auto venet0:0
iface venet0:0 inet static
        address 147.94.59.25
        netmask 255.255.255.255

But when on a my new proxmox interface i add a network interface, the file network/interfaces is like this:
Code:
#
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and
# /etc/network/interfaces.tail instead, their contents will be
# inserted at the beginning and at the end of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.
#

# Auto generated lo interface
auto lo
iface lo inet loopback

# Auto generated venet0 interface
auto venet0
iface venet0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
        up ifconfig venet0 up
        up ifconfig venet0 127.0.0.2
        up route add default dev venet0
        down route del default dev venet0
        down ifconfig venet0 down


auto venet0:0
iface venet0:0 inet static
        address 147.94.59.25
        netmask 255.255.255.255

So, i cannot have access on my VM.

Thank you !
 
On new Proxmox:
Code:
arch: i386
cpulimit: 1
cpuunits: 1024
hostname: gestionbibli.mydomain.fr
memory: 1024
nameserver: 147.94.59.21 147.94.59.22
net0: name=venet0,bridge=vmbr0,hwaddr=52:CB:FE:3E:EE:94,ip=147.94.59.25/32,type=veth
ostype: debian
rootfs: vmstorage:404/vm-404-disk-0.raw,size=8G
searchdomain: mydomain.fr
swap: 1024
 
Thank you, but so, what should i do ? (Excuse, i am new on proxmox...)
Here is my network config on my lxc:Presse-papiers-1.jpg
 
Ok, so i replace venet0 by vmbr0 here :
Code:
auto venet0
iface venet0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
        up ifconfig venet0 up
        up ifconfig venet0 127.0.0.2
        up route add default dev venet0
        down route del default dev venet0
        down ifconfig venet0 down


auto venet0:0
iface venet0:0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
 
No it doesn't work, my interfaces :
Code:
# Auto generated lo interface
auto lo
iface lo inet loopback

# Auto generated venet0 interface
auto vmbr0
iface vmbr0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
        up ifconfig vmbr0 up
        up ifconfig vmbr0 127.0.0.2
        up route add default dev vmbr0
        down route del default dev vmbr0
        down ifconfig vmbr0 down


auto vmbr0:0
iface vmbr0:0 inet static
        address 147.94.59.25
        netmask 255.255.255.255

auto venet0
iface venet0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
 
Ok, so what it works on openVZ version is :
Presse-papiers-2.jpg
Now i have this on my new proxmox lxc :
Presse-papiers-3.jpg
But this LXC cannot have access on internet...sorry i don't understand.
 
# --- BEGIN PVE ---
search mydomain.fr
nameserver 147.94.59.21
nameserver 147.94.59.22
# --- END PVE ---
 
also you need to enter the IP with it's netmask - 147.94.59.25/24 (instead of /32)
 
Ok i change for /24...

But now i have too much made modifications on network/intefaces...
Code:
# Auto generated lo interface
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 147.94.59.25
        netmask 255.255.255.255
        gateway 147.94.59.1
        bridge_ports eno1
        bridge_stp off
        bridge_fd 0

auto eth0
iface eth0 inet static
        address 147.94.59.25
        netmask 255.255.255.0

auto venet0
iface venet0 inet static
        address 147.94.59.25
        netmask 255.255.255.0
 
please post the containers config (`pct config 404`)
the vmbr0 interface is for the host - not for the container (also the netmask should be 255.255.255.0 (a.k.a /24)
the venet0 configs don't exist anymore with lxc
the eth0 line is what you should have inside the container (but it needs a gateway (the same as the one of the host))

check out the reference documentation on networking:
https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#sysadmin_network_configuration
 

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!