title: How to write multiple iptables rules in chef?
body: <p>I was trying to write multiple iptables for blocking certain subnets and it turns out <strong>that the very last iptables rule is only getting implemented</strong>. This is what I've put in the recipe:</p>
  <pre><code>execute &quot;block_ports&quot; do
      command &quot;iptables -A OUTPUT -p tcp -d &lt;subnet 1&gt; --dport &lt;port&gt; -j DROP&quot;
      command &quot;iptables -A OUTPUT -p tcp -d &lt;subnet 2&gt; --dport &lt;port&gt; -j DROP&quot;
      command &quot;iptables -A OUTPUT -p tcp -d &lt;subnet 3&gt; --dport &lt;port&gt; -j DROP&quot;
      command &quot;iptables -A OUTPUT -p tcp -d &lt;subnet 4&gt; --dport &lt;port&gt; -j DROP&quot;
  end
  </code></pre>
  <p>Can someone please tell me how to write multiple iptables rules so that all get executed in Chef recipe?</p>