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

    How to prioritize traffic on a single interface over others?

    Scheduled Pinned Locked Moved General pfSense Questions
    66 Posts 4 Posters 10.5k 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
      pfguy2018
      last edited by

      I searched but was unable to find the answer to this...

      I have an SG5100, with 4 vlans (LAN, VOIP, Guest, IOT) each assigned to a separate physical interface and connected to a switch (single WAN connection, in case this is relevant).

      I want to prioritize all traffic on the VOIP vlan/interface above all other traffic (the only traffic on this vlan is from voip phones, no other devices on the vlan). No other traffic prioritization rules are needed with regard to the other vlans. Is there a way to do this in pfSense?

      Any help appreciated.

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

        Sure, you can do that with traffic shaping. If all traffic on one interface is to be prioritised that makes the firewall rules very easy.
        https://docs.netgate.com/pfsense/en/latest/trafficshaper/index.html

        Steve

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

          Thanks. I have to admit I am a little lost here with all the options and types of traffic shaping available. Can you point me towards the simplest way to accomplish my goal of prioritizing all the traffic on a single interface above all other traffic?

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

            Run the wizard to create the queues, you only need two levels of priority here. Choose the PRIQ scheduler.
            The wizard will probably create a bunch of rules so you can probably simplify it a lot for just VoIP to the higher priority and everything else using the default queue.

            Steve

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

              Thanks. Maybe I misunderstood, but when I read through the PRIQ documentation, I got the impression that is was designed to assign priorities to different traffic WITHIN each interface, rather than between interfaces? Is this incorrect?

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

                It can do that yes. But what you want here is VoIP to get priority on the WAN over other traffic also on the WAN.
                It will only really be effective outbound but that's usually where you see issues anyway.

                Steve

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

                  Does that mean I should enable the traffic shaper on the WAN interface and disable it for other interfaces?

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

                    You would usually have queues on all interfaces that you want to limit traffic on.

                    So if you have queues on LAN and a client there starts downloading a massive file the shaper can drop packets leaving the LAN to slow the TCP session and prioritise VoIP traffic.

                    Otherwise is has no control on download since it cannot affect what arrives inbound on WAN.

                    Steve

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

                      I think I get it. So this means that voip traffic on any interface will be prioritized by pfSense (even though it will only be on my VOIP interface)? So I apply traffic shaping to every interface, such that voip is prioritized and everything else is lower priority?

                      1 Reply Last reply Reply Quote 0
                      • JKnottJ
                        JKnott @pfguy2018
                        last edited by

                        @pfguy2018

                        That's usually a switch function. Generally, you can assign priority to a specific VLAN, by port or by type of traffic.

                        PfSense running on Qotom mini PC
                        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                        UniFi AC-Lite access point

                        I haven't lost my mind. It's around here...somewhere...

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

                          I ran the wizard and landed up with 3 queues on each interface. For WAN, these are qACK, qVOIP, and qDefault, with priorities 6, 7, 3 respectively. For LAN, these are qACK, qVOIP, and qSync, with priorities 6, 7, 2 respectively.

                          Does that look right?

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

                            Yeah that will be fine.

                            If you entered VoIP details in the wizard that may also be fine. You probably want add additional floating match rules for all traffic on the VoIP VLAN that puts it into the VoIP queue to be sure.

                            Are you actually experiencing VoIP issues currently?

                            Steve

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

                              Great point. I will do that. I did add an alias for the voip servers in use and that is being used by a floating match rule also.

                              Not sure if this will work better than having the switch prioritize the traffic as suggested a couples of posts ago?

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

                                The switch is probably not WAN side which is almost always where VoIP issues will be. It can prioritise traffic based on the 802.1p tag which VoIP traffic usually has and you can tag the VoIP vlan with that so traffic over the trunk is prioritised. I don't think I've ever had to set that.

                                Steve

                                JKnottJ 1 Reply Last reply Reply Quote 0
                                • P
                                  pfguy2018
                                  last edited by

                                  Makes sense. I actually have each interface from pfSense connected to the switch by its own Ethernet cable (not trunked) , so not sure if that would help. Although one voip phone is connected to the main switch via a trunk carrying the LAN and VOIP vlans .

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

                                    One more question. I am noticing drops in the WAN qDefault queue - a lot of them after I ran the speedtest at DSL Reports (which rated the connection and bufferbloat at A+ each), and a few others here and there. Is that normal, or do I have to tweak a setting somewhere?

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

                                      You can increase the length of that queue if you wish. That will likely reduce or remove any drops if there is no traffic in the VoIP queue.
                                      That is the expected action though, the scheduler will drop packets from the default or low priority queues in order to pass traffic in high priority queues.

                                      Steve

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

                                        What length would be reasonable? 500? 1000?

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

                                          Should I set all queues to same length? (e.g. 500? or something else?) Many of them are at 50

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

                                            Nope only the default.

                                            Increasing the queue length potentially adds lag so, especially for VoIP, the queues should be kept as short as possible.

                                            Steve

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