Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

Redirect using ipchain

Dear experts,
How to redirect the request cominig from x.x.x.x to the firewall server for port xxxx to x.x.x.x.:xx which is available in my internal network.  Using ipchain    command and then how to get the ipmasqadm package from where.

With advance thanks,
  • 3
1 Solution
so lemme get this straight? you need to get say a web port (80) to redirect back from the firewall into the internal network to a certain port? so that all requests on such port go through it?
if the above is what you are trying to do this would do it, substitute hostnames and ports

iptables -t nat -A PREROUTING -i eth0 -s ! <OTHER_HOST> -p tcp --dport <REQUEST_PORT> -j DNAT --to <OTHER_HOST>:<PORT_TO>

iptables -t nat -A POSTROUTING -o eth0 -s <local-network> -d <OTHER_HOST> -j SNAT --to <THIS_HOST>

iptables -A FORWARD -s <local-network> -d <OTHER_HOST> -i eth0 -o eth0 -p tcp --dport <PORT_TO> -j ACCEPT
dabomb, hes using ipchains, not iptables

download ipmasqadm from

compile it, and install --

then in your firewall script add the following

ipmasqadm portfw -a -P tcp -L <externalip> 80 -R <internalip> 80

Where externalip is the ip of your external interface and internalip is the machine you want to forward requests to.  Ive used port 80 in the example to forward http requests
oh, escheider's right, well either way would do it, iptables is for the newer or older kernels one of the two, it depends on which kernel version is on that disk, and it may be that one of the two is already installed.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now