I have a linux box with two NIC cards: eth0 and eth1.

In one card i have 3 public IP:

  • eth0 =
  • eth0:1=
  • eth0:2=

In the other card I have one local IP

  • eth1 =

I want to redirect all the wan traffic for to the LAN and the same for to

I have tried with this rule but doesn't work

iptables -t nat -A PREROUTING -i eth0 -d -j DNAT --to-destination
iptables -t nat -A PREROUTING -i eth0 -d -j DNAT --to-destination

IP forward is enabled in /etc/sysctl.conf

  • Can we get the output of service iptables status (or iptables -n -L if you are not on Red Hat / Centos).
    – Rilindo
    Nov 18, 2011 at 3:54
  • It's not clear what it is you're trying to do. What do you mean by "redirect all the wan traffic"? Nov 18, 2011 at 4:16

1 Answer 1


If you don't have forwarding allow rule you might have to explicitly allow it using:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .