I'm using iptables on my router to redirect all web traffic to my page.But i don't know how to except my mac address list.I did command like this:iptables -t nat -A PREROUTING -m mac ! --mac-source xx-xx-xx-xx-xx-xx -p tcp --dport 80  -j DNAT --to 127.0.0.1:8080 (Host A)iptables -t nat -A PREROUTING -m mac ! --mac-source xx-xx-xx-xx-xx-xx -p tcp --dport 80  -j DNAT --to 127.0.0.1:8080 (Host B)But it just execute command for host A. It means Host A can access web normally but Host B still got redirect.How can i got access normally for both mac address?
iptables - Redirect except list MAC Address
networking;iptables;router
Use this:iptables -t nat -A PREROUTING -m mac --mac-source xx-xx-xx-xx-xx-xx -j ACCEPT (Host A)iptables -t nat -A PREROUTING -m mac --mac-source xx-xx-xx-xx-xx-xx -j ACCEPT (Host B)iptables -t nat -A PREROUTING -p tcp --dport 80  -j DNAT --to 127.0.0.1:8080The first two commands ACCEPT packets from A and B, so redirection only happen if the packet is from another host.