Container with lan interface outgoing connection problem

andreadragotta

New Member
Jul 16, 2019
4
0
1
27
Hi,

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:
Code:
#!/bin/bash
if [[ "$1" == "eth1" ]]
  then
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eth0 -j MASQUERADE
fi

The second one is "ifup-down" and the content is:
Code:
#!/bin/bash
if [[ "$1" == "eth1" ]]
  then
    iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eth0 -j MASQUERADE
fi
 
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
 

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!