0

I'm trying to forward a local port to a remote telnet host. Something like this.

MyHost -----> |2222 Proxy |------> |23 Destination |

  • MyHost: I'm on a Windows PC.
  • Proxy: Is a linux box which I control.
  • Destination: Is a custom device which only accepts connections via telnet.

My ultimate goal is to telnet to Destination from MyHost through Proxy. I've read several guides but can't seem to get the right command to run on Proxy to have this work.

Also, if it's not possible to do this via ssh forwarding, would netcat cut it? Lack of encryption is not a problem.

1 Answer 1

1

If the proxy is running iptables, it is as simple as

iptables -t nat -A PREROUTING -d proxy.ip.add.ress -p tcp --dport 2222 -j DNAT --to-destination des.tina.tion.IP:23

5
  • Wouldn't I have to also allow the other way around?
    – cookM
    Jul 13, 2012 at 10:37
  • Yes, you would need to allow ESTABLISHED traffic back in.
    – adaptr
    Jul 13, 2012 at 11:50
  • Nevermind, I ended up using: netcat -L destination:23 -p 8888 on proxy. Thanks a lot for your help though.
    – cookM
    Jul 13, 2012 at 12:10
  • good luck when that dies.
    – adaptr
    Jul 13, 2012 at 12:16
  • What do you mean, will it leave a mess behind?
    – cookM
    Jul 14, 2012 at 9:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .