Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Redirect using ipchain

Posted on 2002-04-08
Medium Priority
Last Modified: 2010-05-18
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,
Question by:km_saran
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Expert Comment

ID: 6927426
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?

Expert Comment

ID: 6927432
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

Accepted Solution

escheider earned 80 total points
ID: 6935749
dabomb, hes using ipchains, not iptables

download ipmasqadm from http://www.tuxfinder.com/thematic/tree.php3?category=92

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

Expert Comment

ID: 6935948
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.

Expert Comment

ID: 9078514
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.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question