Universal firewall for filtering traffic on link and network layer