[SOLVED] Proxmox container no internet

popallo

Well-Known Member
Jul 2, 2019
36
6
48
France
apacher.eu
Hello everyone, I have a problem that I can not solve on a SCALEWAY GP1-XS instance.

I installed debian 9 on it then proxmox 5.4. Good for this part, I can connect to the proxmox web interface without any problems.

I would like to give the opportunity to my LXC containers to access the internet without ip failover but i'm lost when i need to configure the network interfaces.

Currently i have an interface named "ens2" and I do not know what else to do.

I followed various tutorial indicating to create an interface vmbr0 then vmbr1. So I manage to make my containers ping the host via an ip type 192.168.1.x but they can not reach any website.

Here is the configuration I did (which does not work) and any help would be appreciated :)


Code:
auto lo
    iface lo inet loopback

    source /etc/network/interfaces.d/*.cfg

    iface eth0 inet manual

    iface eth1 inet manual

    auto vmbr0
    iface vmbr0 inet static
        address  10.x.x.x #Scaleway private ip
        netmask  255.255.255.254
        gateway  10.x.x.y
        bridge-ports eth0
        bridge-stp off
        bridge-fd 0

    auto vmbr1
    iface vmbr1 inet static
        address 192.168.1.254
        netmask 255.255.255.0
        broadcast 192.168.1.255
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE

The content of interfaces.d/

Code:
auto lo
    iface lo inet loopback

    auto ens2
    iface ens2 inet dhcp


Same file for my first container

auto lo
iface lo inet loopback

Code:
auto eth0
    iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.254

traceroute 1.1.1.1 give me this

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    0      0        0 ens2
10.x.x.198   0.0.0.0         255.255.255.254 U     0      0        0 ens2
I think that I made several errors, in particular I see under the interface of proxmox that the interface eth0 is not active and I have a doubt on the use of the private ip on vmbr0.

Thank you in advance !
 
Last edited:
Hello everyone, so I found after fifty unsuccessful attempts. This is my last attempt and it works:

Code:
auto lo
iface lo inet loopback

iface ens2 inet manual

source /etc/network/interfaces.d/*.cfg

auto vmbr0
iface vmbr0 inet static
    address 192.168.1.254
    netmask 255.255.255.0
    broadcast 192.168.1.255
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up iptables -t nat -A POSTROUTING -o ens2 -j MASQUERADE
    post-down iptables -t nat -A POSTROUTING -o ens2 -j MASQUERADE

And for my first container (lxc):
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.254

Hope that this can help others!
 
  • Like
Reactions: tw9mini

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!