title: iptables string match accept connection
body: <p>I have a question with iptables and string matching.  Most of what I have read drops packets that match a rule. When I use this, iptables will drop any connection with the string "test"</p>
  
  <pre><code>iptables -A INPUT  -p tcp --dport 80 -m string --string ! "test" --algo bm -j LOG --log-prefix ' INPUT TCP--- ' --log-level 4
  iptables -A INPUT -p tcp --dport 80 -m string --string ! "test" --algo bm  -j DROP
  </code></pre>
  
  <p>So when I go to <a href="http://www.abc.com/?test" rel="nofollow">http://www.abc.com/?test</a>, the connection will not go through.</p>
  
  <p>What I want to do is the reverse, can I use string matching to approve a connection?</p>
  
  <pre><code>iptables -A INPUT  -p tcp --dport 80 -m string --string  "test" --algo bm -j LOG --log-prefix ' INPUT TCP--- ' --log-level 4
  iptables -A INPUT -p tcp --dport 80 -m string --string  "test" --algo bm  -j ACCEPT
  iptables -A INPUT -p tcp --dport 80 -j DROP
  </code></pre>
  
  <p>I want to only allow connections to port 80 that have the word test in it, somthing like this... <a href="http://www.abc.com/?test" rel="nofollow">http://www.abc.com/?test</a></p>
  
  <p>Can this be done?</p>
  
  <p>Thank you for the assistance,
  golgiapparatus</p>