title: Count incoming packets on specific network interface
body: <p>I'd like to count the number of incoming packets on a network interface (e.g eth0) for a specific period of time (till 5 minutes after executing the script), how can I do it via shell or python script? which one is more accurate?</p>
  
  <p>I'm aware of network tools such as iptraf but I want it to be done via an script and preferably print the counted value on screen or into a file.</p>