External connections appear from the host in NAT / VLAN

Sxw1212

New Member
Jul 12, 2015
1
0
1
Hi! I currently have a VLAN setup with multiple containers. This all works fine except all incoming connections appear to come from the host's IP (xxx.x.38.140) instead of the actual source. How would I fix this?

Proxmox network config:
Code:
# network interface settings
auto lo
iface lo inet loopback


iface eth0 inet manual


iface eth1 inet manual


iface eth2 inet manual


iface eth3 inet manual


auto vmbr0
iface vmbr0 inet static
    address  xxx.x.38.140
    netmask  255.255.255.0
    gateway  xxx.x.38.1
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0


auto vmbr1
iface vmbr1 inet static
    address  192.168.15.20/23
    bridge_ports dummy0
    bridge_stp off
    bridge_fd 0
    post-up /sbin/iptables -t nat -A POSTROUTING -o vmbr0 -j MASQUERADE
 
That's what MASQUERADE does.

You want to look up DNAT instead. I don't have an exact example for proxmox but something like this will give you a start:


/sbin/iptables -t nat -A PREROUTING -p tcp -d {$PUBLICADDRESS} --dport 80 -j DNAT --to {$WEBSERVER}:80
 
Last edited:

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!