Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a linux based router. I'm trying to create an iptable rule to redirect traffic for a specific client using its mac address. Here is the rule I have now (which isn't working):

 iptables -t nat -A prerouting_lan -m mac --mac-source $mac -i br-lan -p tcp --dport 80 -j DNAT --to $ipaddr

What am I doing wrong? Any suggestions would be appreciated.


share|improve this question

Try changing the "--to" in the DNAT field to "--to-destination". From "man iptables":

   This  target  is  only  valid in the nat table, in the PREROUTING and OUTPUT chains, and user-defined chains which are only called
   from those chains.  It specifies that the destination address of the packet should be modified (and all  future  packets  in  this
   connection will also be mangled), and rules should cease being examined.  It takes one type of option:

   --to-destination [ipaddr][-ipaddr][:port[-port]]
share|improve this answer
Hmmm...Unfortunately, that doesn't work. I'm still working on it. Any other ideas? – user548971 Nov 1 '12 at 4:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.