There is this URL which I can access from inside my network, because they allowed my public IP to access it. All other IPs are denied.

how can I configure my iptables so that I can access this website from outside my network?


SSH into a host inside of your network, and then hit the URL with curl:

ssh user@myhost.example.com 'curl http://othersite.example.com/special/snowflake'

That's not a task for iptables.

Use the SOCKS proxy feature of SSH, i.e. do ssh -L 24680:<remote ip>:80 host.in.your.network, then you can access the url on host.in.your.network:24680,

  • Henrik, thanks for your answer. Can you clarify what is "remote ip". Also host.in.your.network should be my public IP? – mquevedob May 3 '16 at 15:22
  • <remote ip> is the ip of the url that you want to access. host.in.your.network can be any ip you can reach the host in your network you want to use on, that is most likely your public ip, but there are other possibilites, if you e.g. have vpn access to your network that might give you another useable ip. - And note that doing this makes that url accesible to anyone able to connect to host.in.your.network:24680. – Henrik May 3 '16 at 15:30
  • the website i want to reach is I executed the following ssh line: ssh -L 9999: localhost. This is in server Then I open my browser on machine and it says the server rejected the connection – mquevedob May 3 '16 at 15:42
  • is it possible to make it work at all? – mquevedob May 4 '16 at 11:13
  • It should be possible, but it has been a few years since I used it myself, so I might have mixed the -L/-R option to ssh. I have also confused SOCKS proxying (done with -D to ssh and requires some browser configuration) and -L/-R. – Henrik May 4 '16 at 21:14

At first you need to encapsulate your traffic to your filtering system doesn't find your content and URL. For do this, You need to choice one of the following ways:

  • Use a tunnel via ssh
  • Use a VPN
  • Use some http tunneling such as zebedee
  • Use some tunnel such as ipip or GRE
  • Use an "Onion Routing" such as Tor

NOTE: You have to have a server outside of your filtering.

I think if you don't have any server , You can use Tor.

NOTE: If you want to use in shell , You have to use some bash variable such as : $http_proxy and $SOCKS_PROXY

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.