Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Logging traffic in Beta 2.0

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    2 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      toomeek
      last edited by

      Hello,

      how to log all estabilished connections in pfSense? I would like to dump data to single file everyday on multi WAN setup. It should has: when estabilished, when ended, IP+MAC of station in LAN, should take care for which WAN was outgoing, and if possible - send/received data for everyhost (daily). Is somewhere such module for pfSense?
      On simple linux I think it would be like this script (bond0 is interface for LAN):

      #!/bin/bash
      #Check if directory exists
      if test -d /home/logi/
              then echo "Directory already exists!"
              else  mkdir /home/logi
              fi
      #Change filename
      mv /home/logi/tcp-syn.dmp /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp
      #Dump as text
      tcpdump -i bond0 tcp [13] == 2 -n >> /home/logi/tcp-syn.dmp & tar cvfz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.tar.gz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp /
      rm /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp
      

      this can be also RAW data (to avoid modifications in logs):

      tcpdump -i bond0 tcp [13] == 2 -w /home/logi/tcp-syn.dmp & tar cvfz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.tar.gz /home/logi/tcp-restart-`date +%d-%B-%Y--%H-%M`.dmp
      
      1 Reply Last reply Reply Quote 0
      • jimpJ Offline
        jimp Rebel Alliance Developer Netgate
        last edited by

        Sounds like you want to run netflow (either with the pfflowd or softflowd packages) - but it doesn't queue the data locally, you need a netflow collector to receive the data and store it.

        http://doc.pfsense.org/index.php/How_can_I_monitor_bandwidth_usage%3F#Netflow

        http://doc.pfsense.org/index.php/Exporting_NetFlow_with_softflowd

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.