title: Block all traffic but on specific ports for VM
body: <p>I would like to block traffic to a VM running on my machine except for certain ports.  I added some rules to virtual bridge to accept traffic on port 80 in the filter table in the FORWARD chain, since the virtual bridge is set up to forward traffic from the VMs.</p>
  
  <p>I wrote the following:</p>
  
  <p><code>
  sudo iptables -F
  sudo iptables -I FORWARD -o [bridge_iface] -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
  sudo iptables -I FORWARD -i [bridge_iface] -p tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
  sudo iptables -I FORWARD -o [bridge_iface] -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
  sudo iptables -I FORWARD -i [bridge_iface] -p tcp --sport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
  sudo iptables -P FORWARD DROP
  </code>
  When I connect tot he vm on the bridge i can't connect to an external web site.  If i remove the last line, of course, everything works but everything is open too.  So that's not quite right.</p>