For some reason, I have a smtp server running completely as user and which cannot open port 25; it listens to port 2225 instead. So, I want to redirect port 25 to port 2225, using iptables. The standard redirection is simple and can be easily found on your favorite search engine:
However, due to the way iptables works, this redirection won't work if you're trying to connect to port 25 from the machine itself, through localhost or through one of the IPs of the machine. The problem is that there's no The solution I've kept is to simply do a maching based on the IPs of the machine. It means doing basically one rule per IP of the machine, which is not that great but probably ok as long as you don't often change of IPs. In my case, this machine has 2 IPs and of course the localhost interface. In pratice, for the two IPs:
And for localhost:
|
Entries >