0

i have centos box with public ip on eth0 and private ip on eth1,4 pub ips are aliased on eth0.

I have written DNAT rule to NAT request on 1.1.1.3 to 10.10.10.3 it worked fine,

but when i add more DNAT rule it is not working.

What can be the reason,what should i do to fix this.

-A PREROUTING -d 1.1.1.3 -p tcp -j DNAT --to-destination 10.10.10.3

-A PREROUTING -d 1.1.1.4 -p tcp -j DNAT --to-destination 10.10.10.4

i thought conntrack module takes care of this,

kevin
  • 191
  • 5
  • 15

1 Answers1

0

You probably forget to add rule in FORWARD chain:

-A FORWARD -d 10.10.10.4 -j ACCEPT
dsznajder
  • 547
  • 4
  • 13
  • ALL my default policy is to accept,so do i need it to specify this rule again? – kevin Mar 25 '13 at 04:11
  • No (but yes, from security point of view you should specify ACCEPT for all traffic you need and set default policy to DROP). Could you provide rest of iptables rules, ip address configuration (what `ip addr` show) and tell how you check "not working" and "destination is not a problem"? – dsznajder Mar 25 '13 at 05:39
  • sorry it was a problem with networking in that machine,now it is working,,,sorry for wsating for time and thanks alot.. – kevin Mar 25 '13 at 06:14