Networking Forums

Networking Forums > Computer Networking > Linux Networking > Fwd: Simple IP-Forwarding problem

Reply
Thread Tools Display Modes

Fwd: Simple IP-Forwarding problem

 
 
Marc Mueller
Guest
Posts: n/a

 
      07-13-2005, 09:19 AM
Hi guys,

i read tons of dokumentation, but i still have not found a fitting
solution for my problem - perhaps anyone of you can help me.

There are 3 servers (A,B,C), each running a ssh-daemon. None of them
has a connection to the internet for security reasons - neither
incoming nor outgoing.

Only one server in the internet (X) is allowed to open a direct
connection to the three servers.


Local # Internet # Local
A---\ # #
B---->--#----X-----#---Me
C---/ # #
# #

I'm aiming to setup IP-Forwarding on server X that I can connect
from my local PC to the server A,B or C.
For example:
Everytime I'm opening a ssh-connection to server X on
port 60001 - server X forwards this request to server A port 22, and
translates all addresses, so server A thinks the ssh-sessions
origins from server X. Server X retranslates all the responses from
server A and sends them back to my PC.

When I'm opening a ssh-connection on server X:60002 the same thing will
happen for server B and so on.


Is there any way to do that with iptables?
The only thing I have found is portforwarding on the local machine,
but I can not figure out how to forward connections to another machine.

Thanks a lot,
-Marc-



 
Reply With Quote
 
 
 
 
Eric Teuber
Guest
Posts: n/a

 
      07-13-2005, 06:22 PM
Marc Mueller wrote:
> Hi guys,
>
> i read tons of dokumentation, but i still have not found a fitting
> solution for my problem - perhaps anyone of you can help me.
>
> There are 3 servers (A,B,C), each running a ssh-daemon. None of them
> has a connection to the internet for security reasons - neither
> incoming nor outgoing.
>
> Only one server in the internet (X) is allowed to open a direct
> connection to the three servers.
>
>
> Local # Internet # Local
> A---\ # #
> B---->--#----X-----#---Me
> C---/ # #
> # #
>
> I'm aiming to setup IP-Forwarding on server X that I can connect
> from my local PC to the server A,B or C.
> For example:
> Everytime I'm opening a ssh-connection to server X on
> port 60001 - server X forwards this request to server A port 22, and
> translates all addresses, so server A thinks the ssh-sessions
> origins from server X. Server X retranslates all the responses from
> server A and sends them back to my PC.
>
> When I'm opening a ssh-connection on server X:60002 the same thing will
> happen for server B and so on.
>
>
> Is there any way to do that with iptables?
> The only thing I have found is portforwarding on the local machine,
> but I can not figure out how to forward connections to another machine.
>
> Thanks a lot,
> -Marc-
>
>
>


Did you try...

iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60001 -j DNAT
--to a.a.a.a:22
iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60002 -j DNAT
--to b.b.b.b:22

.... aso.

Eric
 
Reply With Quote
 
Eric Teuber
Guest
Posts: n/a

 
      07-13-2005, 06:33 PM
Marc Mueller wrote:
> Hi guys,
>
> i read tons of dokumentation, but i still have not found a fitting
> solution for my problem - perhaps anyone of you can help me.
>
> There are 3 servers (A,B,C), each running a ssh-daemon. None of them
> has a connection to the internet for security reasons - neither
> incoming nor outgoing.
>
> Only one server in the internet (X) is allowed to open a direct
> connection to the three servers.
>
>
> Local # Internet # Local
> A---\ # #
> B---->--#----X-----#---Me
> C---/ # #
> # #
>
> I'm aiming to setup IP-Forwarding on server X that I can connect
> from my local PC to the server A,B or C.
> For example:
> Everytime I'm opening a ssh-connection to server X on
> port 60001 - server X forwards this request to server A port 22, and
> translates all addresses, so server A thinks the ssh-sessions
> origins from server X. Server X retranslates all the responses from
> server A and sends them back to my PC.
>
> When I'm opening a ssh-connection on server X:60002 the same thing will
> happen for server B and so on.
>
>
> Is there any way to do that with iptables?
> The only thing I have found is portforwarding on the local machine,
> but I can not figure out how to forward connections to another machine.
>
> Thanks a lot,
> -Marc-
>
>
>


Did you try...

iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60001 -j DNAT
--to a.a.a.a:22
iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60002 -j DNAT
--to b.b.b.b:22

.... aso?

I am not sure, but your problem could be much more complex. Check the
incoming traffic of A,B and C. If the origin IP (not X) wants to connect
to your ssh servers, you probably need also SNAT on your X box.

Let us know.

Eric

 
Reply With Quote
 
Eric Teuber
Guest
Posts: n/a

 
      07-13-2005, 06:58 PM
Eric Teuber wrote:
> Marc Mueller wrote:
>
>>Hi guys,
>>
>>i read tons of dokumentation, but i still have not found a fitting
>>solution for my problem - perhaps anyone of you can help me.
>>
>>There are 3 servers (A,B,C), each running a ssh-daemon. None of them
>>has a connection to the internet for security reasons - neither
>>incoming nor outgoing.
>>
>>Only one server in the internet (X) is allowed to open a direct
>>connection to the three servers.
>>
>>
>>Local # Internet # Local
>>A---\ # #
>>B---->--#----X-----#---Me
>>C---/ # #
>> # #
>>
>>I'm aiming to setup IP-Forwarding on server X that I can connect
>>from my local PC to the server A,B or C.
>>For example:
>>Everytime I'm opening a ssh-connection to server X on
>>port 60001 - server X forwards this request to server A port 22, and
>>translates all addresses, so server A thinks the ssh-sessions
>>origins from server X. Server X retranslates all the responses from
>>server A and sends them back to my PC.
>>
>>When I'm opening a ssh-connection on server X:60002 the same thing will
>>happen for server B and so on.
>>
>>
>>Is there any way to do that with iptables?
>>The only thing I have found is portforwarding on the local machine,
>>but I can not figure out how to forward connections to another machine.
>>
>>Thanks a lot,
>> -Marc-
>>
>>
>>

>
>
> Did you try...
>
> iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60001 -j DNAT
> --to a.a.a.a:22
> iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60002 -j DNAT
> --to b.b.b.b:22
>
> ... aso?
>
> I am not sure, but your problem could be much more complex. Check the
> incoming traffic of A,B and C. If the origin IP (not X) wants to connect
> to your ssh servers, you probably need also SNAT on your X box.
>
> Let us know.
>
> Eric
>


Have you read and tried "using a remote machine as a "relay"? tunnel
with SSH?"?

Eric
 
Reply With Quote
 
Eric Teuber
Guest
Posts: n/a

 
      07-13-2005, 07:00 PM
Eric Teuber wrote:
> Marc Mueller wrote:
>
>>Hi guys,
>>
>>i read tons of dokumentation, but i still have not found a fitting
>>solution for my problem - perhaps anyone of you can help me.
>>
>>There are 3 servers (A,B,C), each running a ssh-daemon. None of them
>>has a connection to the internet for security reasons - neither
>>incoming nor outgoing.
>>
>>Only one server in the internet (X) is allowed to open a direct
>>connection to the three servers.
>>
>>
>>Local # Internet # Local
>>A---\ # #
>>B---->--#----X-----#---Me
>>C---/ # #
>> # #
>>
>>I'm aiming to setup IP-Forwarding on server X that I can connect
>>from my local PC to the server A,B or C.
>>For example:
>>Everytime I'm opening a ssh-connection to server X on
>>port 60001 - server X forwards this request to server A port 22, and
>>translates all addresses, so server A thinks the ssh-sessions
>>origins from server X. Server X retranslates all the responses from
>>server A and sends them back to my PC.
>>
>>When I'm opening a ssh-connection on server X:60002 the same thing will
>>happen for server B and so on.
>>
>>
>>Is there any way to do that with iptables?
>>The only thing I have found is portforwarding on the local machine,
>>but I can not figure out how to forward connections to another machine.
>>
>>Thanks a lot,
>> -Marc-
>>
>>
>>

>
>
> Did you try...
>
> iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60001 -j DNAT
> --to a.a.a.a:22
> iptables -A PREROUTING -t nat -p tcp -d x.x.x.x --dport 60002 -j DNAT
> --to b.b.b.b:22
>
> ... aso?
>
> I am not sure, but your problem could be much more complex. Check the
> incoming traffic of A,B and C. If the origin IP (not X) wants to connect
> to your ssh servers, you probably need also SNAT on your X box.
>
> Let us know.
>
> Eric
>


Also...

Have you read and tried "using a remote machine as a "relay"? tunnel
with SSH?" in this NG?

Eric
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple port forwarding problem jrpfinch Wireless Internet 7 11-27-2006 04:07 PM
Simple Port Forwarding Without SSH anonyusenet@gmail.com Linux Networking 1 07-03-2006 10:04 AM
2003 RRAS port forwarding problem, simple but strange? help please! WildIrish Windows Networking 2 06-15-2006 05:13 PM
help with simple NAT forwarding Mark Richards Linux Networking 2 07-29-2004 12:09 PM
MN-100 Port forwarding not as simple as old router D.C. Larreau Broadband Hardware 5 06-06-2004 12:55 AM



1 2 3 4 5 6 7 8 9 10 11