Find the answer to your Linux question:
Results 1 to 3 of 3
Uhu, yet another question about port forwarding. However, I only want to forward internal TCP packages. An example situation of where we want to use this is: server1: ip: 10.0.0.200 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    2

    Internal port forwarding


    Uhu, yet another question about port forwarding.
    However, I only want to forward internal TCP packages.

    An example situation of where we want to use this is:

    server1:
    ip: 10.0.0.200
    ssh port: 22

    server2:
    ip: 10.0.0.220
    ssh port: 10201

    server3:
    ip: 10.0.0.230
    ssh port: 10212

    Now, when a request is made from server1 to server2, we do not want to specify a port, so just 'ssh user@10.0.0.220' should be sufficient. The same for 'ssh user@10.0.0.230'.

    Therefor, TCP traffic to 10.0.0.200 on port 22 should not be directed as that would make the box inaccessable. Only traffic from server1 to other servers - and only when specified.

    My iptables is lacking a lot - but the manual pages aren't giving any help either. From how it looks, iptables is not capable of just doing that, is it? If so, what other tools should I be looking for?

    Thanks!

  2. #2
    Linux Newbie framp's Avatar
    Join Date
    Jul 2006
    Location
    Stuttgart, Germany
    Posts
    240
    There's an easier way to get it done. Create a ~/.ssh/config file and insert statements
    Code:
    host 10.0.0.220
    port 10201
    host 10.0.0.230
    port 10212
    Details see man ssh_config.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    2
    Quote Originally Posted by framp View Post
    There's an easier way to get it done. Create a ~/.ssh/config file and insert statements
    Code:
    host 10.0.0.220
    port 10201
    host 10.0.0.230
    port 10212
    Details see man ssh_config.
    Maybe I gave the wrong example by using SSH, it's mainly intended for Exim. Maybe it's possible to accomplish that by configuration as well, but I'm not so sure it can.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •