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

    How to get traffic graph to show all subnets, not just the directly attached

    General pfSense Questions
    4
    7
    3.1k
    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.
    • J
      jsvg
      last edited by

      My network is about ~250 workstations, voip phones, and BYODs. This is divided into several subnets and each are on their own router. Pfsense is on listening 192.168.127.254/24 and the routers are 192.168.126.254/24 through 192.168.119.254/24

      I found this old post with the same problem: http://forum.pfsense.org/index.php/topic,23411.0.html

      I really need to have some insight on my network who is eating bandwidth in realtime. Short of putting everything on the same subnet, which would be a disaster, how can I do this? the traffic graph would work perfectly, is there some code I can modify to show hosts on all subnets?

      1 Reply Last reply Reply Quote 0
      • J
        jsvg
        last edited by

        Ok, I figured this out. This is definitely a hack so don't do this.

        Edit the following: sudo vi /usr/local/www/bandwidth_by_ip.php

        About line ~30, there is this line:

        $intsubnet = gen_subnet($intip, $netmask) . "/$netmask"; change to:

        Take that line out and substitute this:

        if ($real_interface == "em0")
          {$intsubnet = "192.168.0.0/16";}
        else
          {$intsubnet = gen_subnet($intip, $netmask) . "/$netmask";}

        em0, 192.168.0.0/16 will need to be changed for your network

        1 Reply Last reply Reply Quote 0
        • E
          evilsmo
          last edited by

          Ok man i make this now its only show subnet 192.168.2.0/24
          My pricipal lan not show.
          What to show all ips on intrface 192.168.3.0/24 and 192.168.2.0/24  ???

          My code:

          //$intsubnet = gen_subnet($intip, $netmask) . "/$netmask";

          if ($real_interface == "em0")
            {$intsubnet = "192.168.2.0/24";}
          else
            {$intsubnet = gen_subnet($intip, $netmask) . "/$netmask";}

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            You need a wider mask to encompass 192.168.2-3.
            192.168.2.0/23 should do it.

            Is your LAN interface em0 though?

            This is a horrible hack as the OP said.  ::)

            Steve

            1 Reply Last reply Reply Quote 0
            • E
              evilsmo
              last edited by

              Its work like a charm

              if ($real_interface == "em0")
                {$intsubnet = "192.168.2.0/23";}
              else
                {$intsubnet = gen_subnet($intip, $netmask) . "/$netmask";

              If i need to add subnet 192.168.4.xx 192.168.6.xx 192.168.9.xx ithe rules is same?

              1 Reply Last reply Reply Quote 0
              • E
                evilsmo
                last edited by

                SOLVED - Man this script list all subnets thanks

                if ($real_interface == "em0")
                  {$intsubnet = "192.168.0.0/16";}
                else
                  {$intsubnet = gen_subnet($intip, $netmask) . "/$netmask";}

                1 Reply Last reply Reply Quote 0
                • P
                  phil.davis
                  last edited by

                  During 2.1 development, there was a time when the "rate" utility returned stats for all IP addresses and I added the "Filter" option to the Traffic Graph GUI - Filter "All", "Local" or "Remote". Some time later, the "rate" utility was put back to just displaying what it was asked to (a subnet specified with the "-c" parameter to "rate").
                  Reading this got me thinking that actually the Filter option can be fixed up using the current "rate" binary but driving it creatively from bandwidth_by_ip.php
                  This pull request fixes up the Filter option so it works as intended: https://github.com/pfsense/pfsense/pull/906
                  Hopefully this will be fixed in 2.1.1. From there, it should be relatively easy to add more filter options to display wider sets of IP addresses - people could suggest what groupings of subnets would be useful.

                  TrafficGraphAllFQDN.png
                  TrafficGraphAllFQDN.png_thumb

                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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