diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm
index 11e8084f0..60667e0ac 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -843,6 +843,7 @@ sub initialize( $;$$) {
TRACK_RULES => undef,
REJECT_ACTION => undef,
INLINE_MATCHES => undef,
+ BASIC_FILTERS => undef,
#
# Packet Disposition
#
@@ -5585,6 +5586,9 @@ sub get_configuration( $$$$$ ) {
default_yes_no 'CHAIN_SCRIPTS' , 'Yes';
default_yes_no 'TRACK_RULES' , '';
default_yes_no 'INLINE_MATCHES' , '';
+ default_yes_no 'BASIC_FILTERS' , '';
+
+ require_capability( 'BASIC_EMATCH', 'BASIC_FILTERS=Yes', 's' ) if $config{BASIC_FILTERS};
if ( $val = $config{REJECT_ACTION} ) {
fatal_error "Invalid Reject Action Name ($val)" unless $val =~ /^[a-zA-Z][\w-]*$/;
diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm
index a49434589..b4da4d87c 100644
--- a/Shorewall/Perl/Shorewall/Tc.pm
+++ b/Shorewall/Perl/Shorewall/Tc.pm
@@ -2512,7 +2512,7 @@ sub process_tc_filter() {
fatal_error 'CLASS must be specified' if $devclass eq '-';
- if ( have_capability 'BASIC_EMATCH' ) {
+ if ( $config{BASIC_FILTERS} ) {
for my $proto ( split_list $protos, 'Protocol' ) {
process_tc_filter2( $devclass, $source, $dest , $proto, $portlist , $sportlist, $tos, $length, $priority );
}
diff --git a/Shorewall/Samples/Universal/shorewall.conf b/Shorewall/Samples/Universal/shorewall.conf
index a0d2ebe3b..1e01be800 100644
--- a/Shorewall/Samples/Universal/shorewall.conf
+++ b/Shorewall/Samples/Universal/shorewall.conf
@@ -120,6 +120,8 @@ ADD_SNAT_ALIASES=No
ADMINISABSENTMINDED=Yes
+BASIC_FILTERS=No
+
IGNOREUNKNOWNVARIABLES=No
AUTOCOMMENT=Yes
diff --git a/Shorewall/Samples/one-interface/shorewall.conf b/Shorewall/Samples/one-interface/shorewall.conf
index 8c18e586f..6a95de9a9 100644
--- a/Shorewall/Samples/one-interface/shorewall.conf
+++ b/Shorewall/Samples/one-interface/shorewall.conf
@@ -131,6 +131,8 @@ ADD_SNAT_ALIASES=No
ADMINISABSENTMINDED=Yes
+BASIC_FILTERS=No
+
IGNOREUNKNOWNVARIABLES=No
AUTOCOMMENT=Yes
diff --git a/Shorewall/Samples/three-interfaces/shorewall.conf b/Shorewall/Samples/three-interfaces/shorewall.conf
index 2b10a5873..ce30abb8a 100644
--- a/Shorewall/Samples/three-interfaces/shorewall.conf
+++ b/Shorewall/Samples/three-interfaces/shorewall.conf
@@ -129,6 +129,8 @@ ADD_SNAT_ALIASES=No
ADMINISABSENTMINDED=Yes
+BASIC_FILTERS=No
+
IGNOREUNKNOWNVARIABLES=No
AUTOCOMMENT=Yes
diff --git a/Shorewall/Samples/two-interfaces/shorewall.conf b/Shorewall/Samples/two-interfaces/shorewall.conf
index 43b284705..a1373d32b 100644
--- a/Shorewall/Samples/two-interfaces/shorewall.conf
+++ b/Shorewall/Samples/two-interfaces/shorewall.conf
@@ -132,6 +132,8 @@ ADD_SNAT_ALIASES=No
ADMINISABSENTMINDED=Yes
+BASIC_FILTERS=No
+
IGNOREUNKNOWNVARIABLES=No
AUTOCOMMENT=Yes
diff --git a/Shorewall/configfiles/shorewall.conf b/Shorewall/configfiles/shorewall.conf
index f3dd065a7..26bb4aec6 100644
--- a/Shorewall/configfiles/shorewall.conf
+++ b/Shorewall/configfiles/shorewall.conf
@@ -120,6 +120,8 @@ ADD_SNAT_ALIASES=No
ADMINISABSENTMINDED=Yes
+BASIC_FILTERS=No
+
IGNOREUNKNOWNVARIABLES=No
AUTOCOMMENT=Yes
diff --git a/Shorewall/manpages/shorewall.conf.xml b/Shorewall/manpages/shorewall.conf.xml
index 82fa1e181..787b840e0 100644
--- a/Shorewall/manpages/shorewall.conf.xml
+++ b/Shorewall/manpages/shorewall.conf.xml
@@ -389,6 +389,30 @@
+
+ BASIC_FILTERS=[Yes|No]
+
+
+ Added in Shorewall-4.6.0. When set to Yes, causes entries in shorewall-tcfilters(5) to
+ generate a basic filter rather than a u32 filter. This setting
+ requires the Basic Ematch capability in your
+ kernel and iptables.
+
+
+ One of the advantages of basic filters is that ipset matches
+ are supported in newer iproute2 and kernel versions. Because
+ Shorewall cannot reliably detect this capability, use of basic
+ filters is controlled by this option.
+
+
+ The default value is No which
+ causes u32 filters to be generated.
+
+
+
BLACKLIST=[{ALL|
+
+ BASIC_FILTERS=[Yes|No]
+
+
+ Added in Shorewall-4.6.0. When set to Yes, causes entries in shorewall6-tcfilters(5) to
+ generate a basic filter rather than a u32 filter. This setting
+ requires the Basic Ematch capability in your
+ kernel and iptables.
+
+
+ One of the advantages of basic filters is that ipset matches
+ are supported in newer iproute2 and kernel versions. Because
+ Shorewall6 cannot reliably detect this capability, use of basic
+ filters is controlled by this option.
+
+
+ The default value is No which causes u32 filters to be
+ generated.
+
+
+
BLACKLIST=[{ALL|