Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi: I have a problema, i want to enter a site that blocks by default all ips, except some ones, my server ip is not allowed, but i have another server ip allowed, so i have done a local ssh port forwarding localhost:81 to this site, works fine, if i enter on my non allowed server and i do: lynx localhost:81 I see perfect site.

My problem is, i have to see the same if i enter on shell: lynx

(keep in mind that is the site that dont allow traffic from every ip) Si what i want is that redirect it to localhost:81 Instead of i can route all traffic of the ip hosting that site, dont have to be FQD routing, anyone know how to do this with iptables, the routing process?


share|improve this question

migrated from Apr 28 '11 at 13:13

This question came from our site for professional and enthusiast programmers.

@Michael: that's not a programming related question. Anyway, if I understood correctly your question, try edit /etc/hosts putting – 0verbose Apr 28 '11 at 12:14
So on abc host u need to redirect traffic from abc:80 to localhost:81 is that right? – Troydm Apr 28 '11 at 13:35

Forget iptables.

Do a ssh -D 1234 to have a SOCKS proxy. Then you can configure your navigator to use this. (Or configure tsocks).

Of course you can also do it with iptables, but since you already have a ssh, it should be easier. Look for NAT and iptables keywords.

share|improve this answer
ssh i have used it to have a localport but i want to use iptables because i want to access that site without modifying any configuration on browser due i will access site with more programs than browser (for example a torrent program) – user79780 Apr 28 '11 at 13:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.