NAT/Port Forward Issue

TheServerGuys

New Member
Feb 8, 2020
4
0
1
37
Hi All,

I have the current setup.

WAN IP at ProxMox VE Host Level.

Port Forwarding using IPTABLES to the internal IP of my ProxMox Mail Gateway VM.

iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 25 -j DNAT --to-destination 10.10.10.190:25

This "works" but all traffic entering the mail gateway appears to be from the host internal IP of 10.10.10.1.
This means that SPF keeps flagging the mail as spam.

Recipient address rejected: Rejected by SPF: 10.10.10.1 is not a designated mailserver

Does anyone have a solution to this?

Thanks, Josh.
 
WAN IP at ProxMox VE Host Level.

Port Forwarding using IPTABLES to the internal IP of my ProxMox Mail Gateway VM.

iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 25 -j DNAT --to-destination 10.10.10.190:25




This "works" but all traffic entering the mail gateway appears to be from the host internal IP of 10.10.10.1.

Probably MASQUEREADE is also set. Remove it and adapt your routing accordingly.


This means that SPF keeps flagging the mail as spam.

Recipient address rejected: Rejected by SPF: 10.10.10.1 is not a designated mailserver

Also possible: set SPF to no.
 
I needed to add this line to make it work correctly.

IPTABLES -A FORWARD -d 10.10.10.190/32 -p tcp -m tcp --dport 25 -j ACCEPT
 

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!