Skip to contentSkip to conversation

OUTPUT chain DNAT problem

DISCUSSION Fox 1 participant 1 message Jul 2, 2003

lore
Share & tools
lore

Fox

author
#0 lore raw

Hi.

I'm having problems with rewriting outgoing packets. I've specified the following rule:
iptables -t nat -A OUTPUT -d 10.0.0.2 -j DNAT --to-destination 192.168.0.2

When I ping 10.0.0.2 i get them rewritten (i check it with tcpdump and get stats with iptables -t nat -L -v -n). But when an application sends a packet to 10.0.0.2 it's not rewritten. I can't understand why.

I need to to the following thing:

A B C
10.0.0.2 ---> 192.168.0.1 ---> 192.168.0.2

A send requests to B and B replies to A. But i want those replies go to C and only C.

Your help is appreciated.
thanks.
fox