Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


SSH port forwarding with multiple remote IPs
New on LowEndTalk? Please Register and read our Community Rules.

SSH port forwarding with multiple remote IPs

0xdragon0xdragon Member
edited October 2013 in Help

Okay, here's my question.

I have three Raspberry Pi's (basically mini LEBs) hosted in my cupboard. I have a VPS with Crissic Solutions with three IPv4 IPs.

For example, for SSH, what I want happening is the following:

Raspberry Pi No.1 SSH (192.168.1.17:22) -> xx.xxx.xxx.01:22
Raspberry Pi No.2 SSH (192.168.1.18:22) -> xx.xxx.xxx.02:22
Raspberry Pi No.3 SSH (192.168.1.19:22) -> xx.xxx.xxx.03:22

I only want each local RasPi to be reachable on one IP of the remote VPS.

Anyone know how to or tried this? I've already exhausted my Google-fu.

Thanks!

Comments

  • Sounds like you need a VPN

  • 0xdragon0xdragon Member
    edited October 2013

    @Spencer said:
    Sounds like you need a VPN

    What sort of VPN? How would you recommend that I assign different users different IPs?

  • setup 3 instances of openvpn on crisis solution, and each rasp connect to each of the openvpn

  • @cosmicgate said:
    setup 3 instances of openvpn on crisis solution, and each rasp connect to each of the openvpn

    Great idea! I'll try doing that and post back here if I have any further questions or tips for others attempting to do the same thing.

  • @CastleServers said: Great idea! I'll try doing that and post back here if I have any further questions or tips for others attempting to do the same thing.

    Interested in the same. How did this go? Any follow up tips...? ;)

  • You can put each ssh on a different port and then use port forwarding...

  • I use this:
    http://duncanthrax.net/pbnc/

    It's awesome. Tell it which local IP# and what IP/PORT to send it to. I use this to setup my CDN stuff.

  • Pi no.1

    iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination xx.xxx.xxx.01:22
    

    Pi no.2

    iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination xx.xxx.xxx.02:22
    

    Pi no.3

    iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination xx.xxx.xxx.03:22
    

    Not sure why a simple DNAT rule in prerouting would not work for this?

Sign In or Register to comment.