

Listening on additional ports
=============================


Here's a little trick to get servers to listen on additional ports. This can be used for SMTP as well or any other protocol. 


with Linux
==========


This requires netfilter compiled into the kernel or loaded as module and the user-space iptables command: 

---%<-------------------------------------------------------------------------
iptables -v -t nat -A PREROUTING -p tcp -j REDIRECT --dport 109 --to-ports 110---%<-------------------------------------------------------------------------



using socat
===========


You can achieve the same result: 

---%<-------------------------------------------------------------------------
socat tcp4-listen:109,setuid=nobody,fork,reuseaddr tcp4-connect:localhost:110,bind=localhost &---%<-------------------------------------------------------------------------

(This file was created from the wiki on 2007-12-11 04:42)
