Results 1 to 2 of 2

Thread: Retrieve forwarded IP in SSH

  1. #1
    Join Date
    Apr 2014

    Retrieve forwarded IP in SSH

    I have a usecase where SSH request go through a load balancer. in order to provide Client IP visibility to servers, the LB does Client IP forwarding. Now is there a way to have the SSHD retrieve the forwarded IP, like something similar to X-Forwarded-for in HTTP ? Thanks.

  2. #2
    Join Date
    Nov 2008
    Metro Boston
    Kubuntu 14.04 Trusty Tahr

    Re: Retrieve forwarded IP in SSH

    It sounds like it's using a form of network address translation so the answer is no.

    X-Forwarded-For is an "application-level" protocol. You'd need to have customized versions of the forwarding software on the load balancer and on the SSH server to add that information. Plus it would add an enormous amount of overhead because that information would need to be included in every packet.

    That's one of the drawbacks of NAT; the originating IP address is rewritten. I use application-level TCP proxies for some services, and the IP is overwritten in that case as well. Any other solution would break routing. If the traffic originates on and passed out from the load balancer at, the recipient machine wouldn't know how to reach Simply passing reply traffic out the default gateway wouldn't work. That gateway might not know how to reach either. So the replies are sent back to, which knows to forward them back to

    You might be able to create a set of routing rules on the Cisco that would preserve the address, but I can't help with that, I'm afraid. I haven't thought much about that approach, and I have no experience configuring Cisco equipment.
    Last edited by SeijiSensei; April 25th, 2014 at 03:31 PM.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Tags for this Thread


Posting Permissions

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