I want to do IP forwading using IPtables task is:
I have to forward the request to a machine -- if the request is for a specific IP address
(its NOT -from a specific address of host )
Do you mean you have a machine with a default policy of disallowing forwarding and you just want to allow any packets coming in from anywhere that are destined to go to eg. a.b.c.d?
iptables -I FORWARD -d a.b.c.d -j ACCEPT
iptables -I FORWARD -s a.b.c.d -j ACCEPT
or do you want more sophisticated behaviour like:
iptables -I FORWARD -p tcp -d a.b.c.d -j ACCEPT
iptables -I FORWARD -s a.b.c.d -m state --state RELATED,ESTABLISHED -j ACCEPT
Maybe even restricting the traffic further to only certain ports or interfaces.
Or do you mean the packets meant for a.b.c.d should be redirected to some other address?
It is hard to know what rules will work for you since it will depend on what rules already exist in your tables and how your machine is connected to other networks so I'm just guessing.
Do you have a UNIX Question?
Unix Home: Unix System Administration
Hints and Tips