View Full Version : [SOLVED] iptables: multiple -m switches in 1 rule

January 20th, 2011, 04:54 PM
How is it possible to write something like this ?

iptables -A INPUT -p tcp -s $ME -m mac --mac-source $MAC_ME -d $WEBSERVER --dport 2222 -m state --state NEW,ESTABLISHED -j ACCEPT -m comment --comment "incoming SSH request by Me"

does it have to be split in several rules ?
what I want is:
check for source ip and mac, destination port,state and add a comment

January 21st, 2011, 09:32 AM
I thought I made a syntax error using multiple matches in 1 rule but I found the mistake. I forgot to change 1 variable whilest copy pasting. Issue is solved.