How to use loopback addresses other than 127.0.0.1 for local port forwarding?

I usually use 127.0.0.1 for local port forwarding to connect the server behind a jump server. Now, I wanna use another loopback address (e.g. 127.0.0.2), but it seems that it doesn't work any more, shown as below. How can I solve this problem?


command:

ssh -L 127.0.0.2:6000:target_server:22 username@jump_server


error:


iPad Pro

Posted on Sep 23, 2023 12:23 AM

Reply

Similar questions

4 replies

Sep 23, 2023 7:24 AM in response to Forence

Some background on the environment and requirements (past ssh forwarding), please?


Your footer here indicates iPad Pro. I’m not aware of an accessible, integrated ssh client.


127/8 is the IP loopback address, and is not particularly related to forwarding.


To forward anything, you would also need another app listening to some other port and forwarding that incoming traffic on that port elsewhere. You’re here attempting to use ssh for that port-forwarding purpose.


Using ssh port forwarding is not particularly useful on iPadOS, as there is no integrated ssh client provided, and as an added ssh client is inherently sandboxed.


Depending on what you’re doing, proxyman or some other external proxying or packet interception service might be useful.


If this is macOS, then ssh is available, and there are other possibilities.


Sep 23, 2023 7:44 AM in response to Forence

Forence wrote:

Sorry for this misleading information. it's not iPadOS.

I use ssh for local port forwarding in my MacBook Air with M2 chip.


Which macOS? macOS 13 Ventura is (briefly still) current.


Does adding sudo to the ssh possibly get you further?


And if you should need to reference non-existent, deliberately-bogus host names here, then example.com, example.net, and example.org, and all subdomains of those three, are available.

How to use loopback addresses other than 127.0.0.1 for local port forwarding?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.