NAT/Port Forward Issue

TheServerGuys

New Member
Feb 8, 2020
4
0
1
38
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