Simple port forwarding question

Saber Zrelli zrelli at jaist.ac.jp
Thu Nov 4 17:08:47 PST 2004


Julian Elischer wrote:

>
>
> Erik Trulsson wrote:
>
>> On Tue, Nov 02, 2004 at 04:36:30PM -0800, John Fox wrote:
>>  
>>
>>> Hi, folks.
>>>
>>> I'm experimenting, trying to setup a situation where connections to 
>>> port 25 on machine A are forwarded to port 25 on machine B.
>>> I've read the ipfw manpage and it looks as though what I'm doing
>>> is correct. 
>>>
>>> The IPFW rules on machine A are:
>>>   00100 fwd machineB tcp from any to any 25
>>>   65535 allow ip from any to any
>>>
>>> And there is a sendmail listening on B's port 25.
>>>
>>> But when I telnet to machine A's port 25, all I get is
>>> a perpetual "Trying" message that just sits there.
>>>   
>>
>>
>> Don't use "fwd" for this - it doesn't work that way (for one thing B is
>> unlikely to handle an IP-packet that is still adressed to A.)
>>
>> Use natd and the '-redirect_port' option to natd instead - that works.
>>
>
> you can use ipfw fwd IF you also run it on the target machine to 
> "capture/accept" the foreign packet.
> Otherwise teh packet will be forwarded back to it's stated 
> destination  (or dropped).
>
>
>>
>>

You may also try using ssh port forwarding ; Smple command :

ssh2 -L 1234:localhost:23 username at host

all traffic coming to port 1234 on the client will be forwarded to port 
23 on the server (|host|). Note that |localhost| will be resolved by the 
sshdserver after the connection is established. In this case |localhost| 
therefore refers to the server (|host|) itself.






>>
>>
>>  
>>
>
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"








More information about the freebsd-net mailing list