Restructure config file and make functionality easier to understand in the readme#36
Restructure config file and make functionality easier to understand in the readme#36
Conversation
59e48f4 to
2ecca2e
Compare
69f3f96 to
dba804e
Compare
Kernels prior to 5.13 do not have mappings for LE in the layer-cake diffserv tins
dba804e to
4d780d0
Compare
|
Hi @ldir-EDB0 I've made some pretty heavy changes in support of making functionality clearer and adding more control to the automatic classification methods, considering making this a v2 release. I have tested and compared the table created in my local OpenWrt 24.10 VM, but would appreciate a once over on your end. I still need to finish the function for migrating config to the new structure. |
|
@jeverley I know I am not a contributor here, but I have tested your changes here on a live setup using your new config and new changes. Here is my specs: |
|
Hi @jumpsmm7, please could you share a copy of your config file? |
config service config client_class_adoption config bulk_client_detection config high_throughput_service_detection config ipset config ipset config rule config rule config rule config rule config rule config rule config rule config rule config rule config rule config rule config rule config rule # A rule which marks all non-HTTP UDP connections from a specific IP as cs4 and count new connection matches |
|
@jeverley it is the ICMP rule. |
commit dc90a41 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 14:03:21 2025 +0100 Fix spacing in rename_section_type commit c4e7ef2 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:57:31 2025 +0100 Rename compatibility function commit a3b6251 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:49:51 2025 +0100 Use of service constants and remove redundant set check commit f6e3fe0 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:35:11 2025 +0100 Compatibility for kernels not supporting nft destroy commit cf310b1 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 12:21:51 2025 +0100 Indentation consistency commit a71ef4e Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 20:14:54 2025 +0100 Config migration log level changed to info commit 68dc5ae Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 20:10:47 2025 +0100 Indent consistency commit 3e47cdf Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 19:48:35 2025 +0100 Config migration is logged commit 2031072 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Thu Jun 19 17:24:15 2025 +0100 Implement function for migrating config file to new structure commit 6792a30 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Apr 7 13:36:19 2025 +0100 Resolve issue with non tcp/udp protocol user rules Fixes #36 (comment) commit 8c66738 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:43:07 2025 +0100 Change Low Effort class fallback log level to info commit 3f0395c Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:42:09 2025 +0100 Add log message for Low Effort default fallback commit c021b32 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:33:18 2025 +0100 Update meter set names commit b174838 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 20:42:52 2025 +0100 Fix exclude_class config option commit ab09a1b Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 20:11:30 2025 +0100 Make check_set_against_existing function checks more robust commit 4d780d0 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 18:34:02 2025 +0100 Fall back to class cs1 for low effort on kernel releases < 5.13 Kernels prior to 5.13 do not have mappings for LE in the layer-cake diffserv tins commit ce9dab0 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Mar 25 17:53:03 2025 +0000 Restructure config file and update readme to improve readability
* Init script refactor - Move config defaults into static variables - Explicit return 0 when service stops/starts successfully - Code readability improvements * Move service action success log to after cleanup * Clearer function names and use of named variables in config_foreach_reverse * Move client hints assessment into dynamic_classify chain This is intended to address clients which only apply their class after establishing a connection. #34 * Preserve the dynamic bit when a dynamic class is applied Additional changes: - Config option to enable/disable dynamic classification - Client hints can override dynamic class - Rename static_classify to rule_classify * Move dynamic rule chain creation into init script We now only create these if enabled in config * Ensure unused sets are removed when dynamic rules are not enabled * Add individual config options for threaded client/service detection Add automatic classification options to readme - `threaded_service_detection` - `threaded_client_detection` Include threaded client/service detection options in default config * Merge in config-restructure branch commit dc90a41 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 14:03:21 2025 +0100 Fix spacing in rename_section_type commit c4e7ef2 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:57:31 2025 +0100 Rename compatibility function commit a3b6251 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:49:51 2025 +0100 Use of service constants and remove redundant set check commit f6e3fe0 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 13:35:11 2025 +0100 Compatibility for kernels not supporting nft destroy commit cf310b1 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 12:21:51 2025 +0100 Indentation consistency commit a71ef4e Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 20:14:54 2025 +0100 Config migration log level changed to info commit 68dc5ae Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 20:10:47 2025 +0100 Indent consistency commit 3e47cdf Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Jun 23 19:48:35 2025 +0100 Config migration is logged commit 2031072 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Thu Jun 19 17:24:15 2025 +0100 Implement function for migrating config file to new structure commit 6792a30 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Apr 7 13:36:19 2025 +0100 Resolve issue with non tcp/udp protocol user rules Fixes #36 (comment) commit 8c66738 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:43:07 2025 +0100 Change Low Effort class fallback log level to info commit 3f0395c Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:42:09 2025 +0100 Add log message for Low Effort default fallback commit c021b32 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Apr 1 13:33:18 2025 +0100 Update meter set names commit b174838 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 20:42:52 2025 +0100 Fix exclude_class config option commit ab09a1b Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 20:11:30 2025 +0100 Make check_set_against_existing function checks more robust commit 4d780d0 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Mon Mar 31 18:34:02 2025 +0100 Fall back to class cs1 for low effort on kernel releases < 5.13 Kernels prior to 5.13 do not have mappings for LE in the layer-cake diffserv tins commit ce9dab0 Author: Jack <46714706+jeverley@users.noreply.github.com> Date: Tue Mar 25 17:53:03 2025 +0000 Restructure config file and update readme to improve readability * Revert "Merge in config-restructure branch" This reverts commit 32dbad7. * Restructure config file and make functionality easier to understand in the readme (#36) * Restructure config file and update readme to improve readability * Fall back to class cs1 for low effort on kernel releases < 5.13 Kernels prior to 5.13 do not have mappings for LE in the layer-cake diffserv tins * Make check_set_against_existing function checks more robust * Add log message for Low Effort default fallback * Resolve issue with non tcp/udp protocol user rules Fixes #36 (comment) * Implement function for migrating config file to new structure * Config migration is logged * Compatibility for kernels not supporting nft destroy * Use of service constants and remove redundant set check * Add ability to supply a file for inclusion into an ipset (#37) * Added basic loading of an existing ipset file * Second pass. Applied KISS principle and minimized new code. * Augment the loadfile parsing to check for and exclude invalid values * Use an ipv4 regex without a word boundary (BusyBox compatibility) --------- Co-authored-by: Jack <46714706+jeverley@users.noreply.github.com> * Add documentation for ipset loadfile option * Revise check_addr6 and parse_set_loadfile functions (BusyBox grep limitations) * Replace remaining static service name references * Add migration for deprecated element option in ipsets * Fix reload due to service command being unavailable within init scripts * Add Zoom Meetings and Webinars (#38) * Add Zoom Meetings and Webinars * Updated addresses and added Zoom Phone details I intend to add support for referencing mixed set types (ipv4/6) which should help keep config simple. --------- Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> * Handle addr6 CIDR notation Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> * Support for mixed dest/source ip families in rules commit 74ce456 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 12:59:34 2025 +0100 Log the debug file locaction commit 44474a4 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 12:54:34 2025 +0100 Fix saddr and daddr rule creation commit 08d5549 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 12:46:59 2025 +0100 Further logging refinements commit ecbc5c3 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 12:41:21 2025 +0100 Prevent set creation if no family is specified and there are mixed entries commit d0f1481 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 11:36:01 2025 +0100 Improve logging on determine_set_family commit 9c43e44 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 11:23:07 2025 +0100 Fix name expansion in set family logs commit 717a435 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 3 10:31:11 2025 +0100 Implement ipset family detection and entry family validation commit f7dec1c Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 1 21:18:01 2025 +0100 Name saddr and daddr list variables consistent with being a list commit 825a434 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 1 18:25:31 2025 +0100 Use constants for chain names commit 5c1c6f3 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 1 08:47:43 2025 +0100 Move source match conditions to start of rule Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> commit c4de2de Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 23:23:51 2025 +0100 Prevent extra empty address rule creation Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> commit 43464c2 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 23:16:36 2025 +0100 Refactor config rules to use multi family ipsets Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> commit 3f5084c Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 23:04:06 2025 +0100 Add rule name to address parse error log Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> commit f78e4ef Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 22:44:53 2025 +0100 Handle addr6 CIDR notation Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> commit 31d230a Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Aug 31 22:04:43 2025 +0100 Initial implementation of multi family ipset rules Co-Authored-By: Jack <46714706+jeverley@users.noreply.github.com> * Update ipset and rule documentation in README.md * Interval now defaults to 1 (matching fw4) * Update README.md * Update README.md * Add config tables for `rule` and `ipset` sections * Handle the "any" family value * Fix client class adoption when src_ip isn't specified * Fix issues with config migration, use set instead of ipset in config sections commit 1874589 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 19 16:59:57 2025 +0100 Change ipset to set in documentation and config commit d274a52 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Thu Sep 18 12:25:55 2025 +0100 Config migration hardening commit c8d68fa Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 17 14:30:34 2025 +0100 Fix rename_section_type commit a9ff6b1 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 17 12:29:38 2025 +0100 Use config section name 'set' instead of 'ipset' due to divergence with fw4 use commit 92e6ce5 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 17 09:28:07 2025 +0100 Define class default constants, remove optional debug commit b6da99b Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Tue Sep 16 16:41:32 2025 +0100 Making var naming for addr in create user rule less ip specific commit dbc4cc6 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Tue Sep 16 16:19:35 2025 +0100 Correct config_get for src addr in client class adoption commit 6b88f58 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Tue Sep 16 15:35:25 2025 +0100 Fix issue where mixed rule saddr/daddr was not working commit 4198c6e Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Tue Sep 16 09:21:56 2025 +0100 Correct locals in rule_addr function commit 3a4d59e Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 15 17:05:29 2025 +0100 Used constants for nft conntrack variables commit e86d012 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 15 16:50:25 2025 +0100 Refinements to client class adoption commit ed73b56 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Mon Sep 15 14:47:07 2025 +0100 Resolve issue with creating addr rules, use constants for set names commit fcaf433 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 12 16:23:30 2025 +0100 Update dscpclassify commit 53cc794 Merge: faac8b2 361af98 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 12 15:59:03 2025 +0100 Merge branch 'dev' of https://github.com/jeverley/dscpclassify into dev commit faac8b2 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 12 15:57:40 2025 +0100 Update dscpclassify commit 78eb5bf Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 12 15:26:25 2025 +0100 Improve efficiency of rule_addr and compatibility checks commit 361af98 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Fri Sep 12 15:26:25 2025 +0100 Improve efficiency of rule_addr and compatibility checks commit efbd41f Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Wed Sep 10 16:07:54 2025 +0100 Support for mac address matching commit 7cb6c83 Author: jeverley <46714706+jeverley@users.noreply.github.com> Date: Sun Sep 7 22:14:01 2025 +0100 Fix client class adoption when src_ip isn't specified * Enhance README with src_mac and dest_mac descriptions * Add uninstall steps --------- Co-authored-by: Mark B <mark@vpost.net>



What's changed
wmmrenamed towmm_mark_lanto make its function clearerclass_low_effortsets the default Low Effort DSCP mark, default islecs1becauseleis not implemented in layer-cakeclass_high_throughputsets the default High Throughput DSCP mark, default isaf13client_class_adoptionfor applying non-wan client DSCP marks to response packetsenabledexclude_classignores DSCP client class, defaults toCS6andCS7src_addrused to specify client IPs to include/exclude in adoptionbulk_client_detectionfor P2P type clientsenabledmin_bytesmin_connectionsclass, overrides the service default (class_low_effort)high_throughput_service_detectionfor high throughput downloads like Windows Update & Steamenabledmin_bytesmin_connectionsclass, overrides the service default (class_high_throughput)