On -10.01.-28163 20:59, Gedalya wrote:
On 08/25/2014 08:26 AM, Jochen Bern wrote:
Assuming Red Hat or similar with no conflicting iptables rules (yet), # iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143
Since you're redirecting to a port on the same host, the following is perhaps more correct: iptables -t nat -A PREROUTING -p tcp --dport 30143 -j REDIRECT --to-port 143
The operational word being "perhaps". My approach will break if the server does any forwarding, yours will break if dovecot listens only on a secondary IP address, or at least that's what the manpage I grabbed off a CentOS 6 says:
REDIRECT [...] It redirects the packet to the machine itself by changing the ^^^^^^^^^^^^ destination IP to the primary address of the incoming interface ^^^^^^^^^^^^^^^^^^^^^^#######^^^^^^^^ (locally-generated packets are mapped to the 127.0.0.1 address).
Regards, J. Bern
*NEU* - NEC IT-Infrastruktur-Produkte im http://www.linworks-shop.de/: Server--Storage--Virtualisierung--Management SW--Passion for Performance Jochen Bern, Systemingenieur --- LINworks GmbH http://www.LINworks.de/ Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27 Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202 Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel