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

    LOG firewall and haproxy

    Scheduled Pinned Locked Moved Firewalling
    6 Posts 2 Posters 1.4k 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.
    • P
      pino121
      last edited by

      Hello,
      pfsens 2.4.4-RELEASE-p3
      haproxy net 0.59_21 Package Dependencies: haproxy17-1.7.12

      Where are the logs the haproxy and firewall?

      I would like to block external IPs that generate a lot of traffic

      thanks

      johnpozJ 1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator @pino121
        last edited by johnpoz

        @pino121 the firewall log would only show stuff that was allowed by your rules, if you enable logging on the rules that you set to allow traffic to your haproxy on the wan. You would then see IPs that hit your rule that allow access to whatever port(s) your haproxy is listening on.

        Normally allow rules are not logged, only the default deny is logged by default.

        If you want to see logs from haproxy, you have to set haproxy to log - by default it does not. And even if you set it to log, in the haproxy settings. Those would not be viewable in the normal log gui of pfsense.

        btw, your pfsense is out of date and actually no longer listed as supported. I would highly suggest you update to current if at all possible. The only still supported version of 2.4.x is the 2.4.5p1 version. Current version of CE is 2.5.2, while + (if your on netgate hardware) is 21.05.2

        This would also allow you to update your haproxy package, dev version which is really the recommended version to use is currently at 0.62-4, with haproxy-2.2.14

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • P
          pino121
          last edited by

          @johnpoz said in LOG firewall and haproxy:

          @pino121 the firewall log would only show stuff that was allowed by your rules, if you enable logging on the rules that you set to allow traffic to your haproxy on the wan. You would then see IPs that hit your rule that allow access to whatever port(s) your haproxy is listening on.
          Normally allow rules are not logged, only the default deny is logged by default.
          If you want to see logs from haproxy, you have to set haproxy to log - by default it does not. And even if you set it to log, in the haproxy settings. Those would not be viewable in the normal log gui of pfsense.
          btw, your pfsense is out of date and actually no longer listed as supported. I would highly suggest you update to current if at all possible. The only still supported version of 2.4.x is the 2.4.5p1 version. Current version of CE is 2.5.2, while + (if your on netgate hardware) is 21.05.2
          This would also allow you to update your haproxy package, dev version which is really the recommended version to use is currently at 0.62-4, with haproxy-2.2.14

          Hello johnpoz,
          i have enable the log on firewall rules for http and https traffic.
          I have enable the local log for haproxy, Services -> HAProxy -> Settings, "Logging" section.
          In "Remote syslog host" put /var/run/log.

          Please help me,
          i would like to check the external and internal ip that make more traffic from the firewall or haproxy logs,

          Thank you

          johnpozJ 1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator @pino121
            last edited by johnpoz

            @pino121 well now you can see in your firewall logs which IP hit your allow rules.

            here is my phone from cell connection hitting my wan IP on 443

            firewallhit.jpg

            And you can look in your haproxy log for client IPs.

            cat /var/log/haproxy.log

            now the way I do my haproxy, I only see localhost, since I do a port share.. Let me change my rules so it shows public IP.

            But I clearly see connections being logged

            log.jpg

            edit: Here I changed up my forwards so haproxy would see the external IP.

            externalip.jpg

            That is my phone hitting website I use via haproxy..

            edit2: If your curious what IPs are using most traffic - you could look in your state table.

            trafficstates.jpg

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            P 1 Reply Last reply Reply Quote 0
            • P
              pino121 @johnpoz
              last edited by

              @johnpoz said in LOG firewall and haproxy:

              edit2: If your curious what IPs are using most traffic - you could look in your state table.

              thanks for your kind reply,
              I did not understand this:
              edit2: If your curious what IPs are using most traffic - you could look in your state table.
              Could you please tell me where to look?

              johnpozJ 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator @pino121
                last edited by

                @pino121 diagnostic menu, states

                states.jpg

                You can filter it on specific ips or ports, etc.

                filter.jpg

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

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