pfSense Gold Subscription

Author Topic: $100 - Specification of mask as dotted quad in Traffic Limiter in pfSense 2.1  (Read 3087 times)

0 Members and 1 Guest are viewing this topic.

Offline jcyr

  • Full Member
  • ***
  • Posts: 151
  • Karma: +2/-30
    • View Profile
Currently Traffic Shaper: Limiter uses hardcoded mask of 0xffffffff. This allows only per host shaping when dest or source address shaping is selected. Create field allowing specification of an actual mask as dotted quad value such that limiter queues can be used for group of hosts.

ie. I have four kids, each with multiple devices. I want to allow 5mbps per kid. Each can use up to that limit across his/her devices.

kid1 ip addresses: 192.168.2.16, 192.168.2.17
kid2 ip addresses: 192.168.2.32. 192.168.2.33, 192.168.2.34
kid3 ip addresses: 192.168.2.48
...

If this was implemented, specifying a mask of 255.255.255.240 would do the trick.

Presently I achieve this by modifying /etc/inc/sharper.inc as follows:

                $mask = $this->GetMask();
                if (!empty($mask)) {
                        /* XXX TODO extend this to support more complicated masks */
                        switch ($mask) {
                        case 'srcaddress':
                                $pfq_rule .= " mask src-ip 0xfffffff0 ";
                                break;
                        case 'dstaddress':
                                $pfq_rule .= " mask dst-ip 0xfffffff0 ";
                                break;
                        default:
                                break;
                        }
                }

It would be far more elegant and flexible if this were implemented in the GUI.

Offline jcyr

  • Full Member
  • ***
  • Posts: 151
  • Karma: +2/-30
    • View Profile
This offer is withdrawn