Skip to content

Instantly share code, notes, and snippets.

@siculars
Last active April 25, 2022 23:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siculars/6789335 to your computer and use it in GitHub Desktop.
Save siculars/6789335 to your computer and use it in GitHub Desktop.
Set an ip on local loopback then ssh tunnel to it. If you are blocked from accessing any specific ip, you can set it up locally and ssh tunnel to it.
#unix (replace 1.2.3.4 with website/service ip address)
#add
#ip addr add 1.2.3.4/32 dev lo
#delete
#ip addr del 1.2.3.4/32 dev lo
#mac
#add
#sudo ifconfig lo0 add 1.2.3.4
#delete
#sudo ifconfig lo0 delete 1.2.3.4
#you can also forward multiple ports in one command, ie. 5000 and 5001
#(replace 1.2.3.4 with website/service ip address)
# -L format:
# [local address]:[local port]:[remote address]:[remote port]
#ssh -L 1.2.3.4:5000:1.2.3.4:5000 -L 1.2.3.4:5001:1.2.3.4:5001 user@host.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment