iptables equivalent of ssh local port forward.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

What I'm trying to do seem simple, but I haven't managed to get it to work yet.

I can get ssh to do what I want, but it seems a little excessive.

This is my working ssh command:

ssh -f -N -g -L 143:192.168.1.4:143 root@xxxxxxxxxxx (this is run from
192.168.1.3)

Basically I'm trying to forward imap from 192.168.1.3 to 192.168.1.4,
but for when I am connecting from the 192.168.1.x network.

I can get iptables forwarding to work fine if the source address is
from the internet, well a different interface anyway.  Using a DNAT
works fine in these circumstances.  But a DNAT doesn't work to forward
within the same subnet/interface it seems.

I'm sure this possible, but I can't figure out the correct rule.

So to be really clear I want to be able to connect to port 143 on
192.168.1.3 from 192.168.1.29 (for example) and have that request
forwarded to port 143 on 192.168.1.4

Can someone point me in the right direction?

Cheers,

-Joel
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux