title: Setting up iptables for a hostapd wifi login page
body: <p>I need some custom iptables for a login page of my wifi hotspot on my raspberry pi. I want an http login page: this is how it should work, I just don't know how to configure the iptables.:</p>
  
  <p>Any connections on an ip address that is not already logged in, should be redirected to the pi's port 8181 (the server for my login page).</p>
  
  <p>Any connections on an ip address that is logged in should be allowed to access the outside internet.</p>
  
  <p>Any connections initially requesting the pi's port 8181 should be allowed.</p>
  
  <p>How should I set this up with <code>iptables</code>?</p>
  
  <p>Thanks!</p>