Struggling with LXC/VM Networking on OVH

mrboh

Member
Apr 23, 2017
4
0
6
44
New user here, have Proxmox installed via the OVH v4.4 template. No problems with installation and no issues with the network connection from the server itself.

However, when I try and create an LXC or VM and use a bridged network connection, there is no connectivity inside the container/VM. Pings fail as 'destination unreachable'. If I create a VM using NAT the network works normally.

I have read through the wiki documentation relating to OVH and as far as I can tell my setup is exactly as described. I've been pulling my hair out for a couple of days now, I just can't figure out how to make it work.

I have a single IP through OVH. The /etc/network/interfaces file on the server is:

Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage part of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface eth0 inet manual

iface eth1 inet manual

auto vmbr1
iface vmbr1 inet manual
        bridge_ports dummy0
        bridge_stp off
        bridge_fd 0
        post-up /etc/pve/kvm-networking.sh

auto vmbr0
iface vmbr0 inet static
        address  x.y.z.114
        netmask  255.255.255.0
        gateway  x.y.z.254
        broadcast  x.y.z.255
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        network x.y.z.0

The /etc/network/interfaces file on the container is:

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address x.y.z.114
        netmask 255.255.255.255
# --- BEGIN PVE ---
        post-up ip route add x.y.z.254 dev eth0
        post-up ip route add default via x.y.z.254 dev eth0
        pre-down ip route del default via x.y.z.254 dev eth0
        pre-down ip route del x.y.z.254 dev eth0
# --- END PVE ---

I'd appreciate any advice about where I might be going wrong.

(incidentally, I can't seem to figure out why the vmbr1 bridge exists, but removing it from the system does nothing to change the result)
 
Depending on whether you have a server with vrack or not will determine how you network things.

If you don't have a vrack then every IP needs to have a virtual mac created in the OVH GUI, you then need to put in this mac address when you create the vm/container.

if not using the vrack, your ip in the vm needs to be ip/32. The gateway needs to be the first 3 octets of your HOST with .254 at the end.
 
Oh my goodness, thank you for your help. I finally got it working! For other clueless people like myself, you have to have a failover (i.e. at least a second) IP address to be able to create a virtual MAC. And when assigning the LXC network configuration, you use the failover address for the container address but your primary IP gateway for the gateway. Hooray!
 
You DO NOT use your primary IP as gateway, that may work for a day or two but you will get locked out by the OVH switches.

You use your primary IP with .254 at the end, ie if ip is 1.1.1.1 you use 1.1.1.254 as the gateway.

This is actually same gateway as your server.
 
Sorry, poor choice of words. By 'primary IP gateway' I meant the gateway associated with the primary IP (i.e. the .254 one).
 

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!