Container with lan interface outgoing connection problem


New Member
Jul 16, 2019

I have an installation of Proxmox on my server and my idea is the following:
5 container without public ip and with LAN interface
1 container with LAN interface and public IP

My problem is when i try to download some packages with yum for example in the containers without public ip.
How can i fix mi problem with outgoing networking?
Solved, thank you so much!

My CT os is centos 7 and the network interface config is a little bit different, instead of "post-up" and "post-down" in /etc/network/interfaces i've created two files in /sbin/

The first one is "ifup-local" and the content is:
if [[ "$1" == "eth1" ]]
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -s '' -o eth0 -j MASQUERADE

The second one is "ifup-down" and the content is:
if [[ "$1" == "eth1" ]]
    iptables -t nat -D POSTROUTING -s '' -o eth0 -j MASQUERADE
Last edited:
you can also set up forwarding directly on your proxmox host, and create a private sub network for your containers and use port forwarding to reach them from outside


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!