?
Solved

Redirect using ipchain

Posted on 2002-04-08
7
Medium Priority
?
250 Views
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,
M.Saran.
0
Comment
Question by:km_saran
[X]
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
7 Comments
 
LVL 3

Expert Comment

by:DABOMB
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?
0
 
LVL 3

Expert Comment

by:DABOMB
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
0
 
LVL 4

Accepted Solution

by:
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
0
 
LVL 3

Expert Comment

by:DABOMB
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.
0
 

Expert Comment

by:CleanupPing
ID: 9078514
km_saran:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 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