diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index effe2bdda..10b600423 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -596,7 +596,7 @@ sub use_forward_chain($) { # # Interface associated with a single zone -- Must use the interface chain if # the zone has multiple interfaces - # + # and this chain has option rules $interfaceref->{options}{use_forward_chain} && keys %{ zone_interfaces( $zone ) } > 1; } @@ -1565,7 +1565,8 @@ sub match_source_net( $;$ ) { $restriction |= NO_RESTRICT; - if ( $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ) { + if ( $family == F_IPV4 && $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ || + $family == F_IPV6 && $net =~ /^(!?)(.*:.*)-(.*:.*)$/ ) { my ($addr1, $addr2) = ( $2, $3 ); $net =~ s/!// if my $invert = $1 ? '! ' : ''; validate_range $addr1, $addr2; @@ -1591,7 +1592,8 @@ sub match_source_net( $;$ ) { sub match_dest_net( $ ) { my $net = $_[0]; - if ( $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ ) { + if ( $family == F_IPV4 && $net =~ /^(!?)(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)$/ || + $family == F_IPV6 && $net =~ /^(!?)(.*:.*)-(.*:.*)$/ ) { my ($addr1, $addr2) = ( $2, $3 ); $net =~ s/!// if my $invert = $1 ? '! ' : ''; validate_range $addr1, $addr2; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index e25db8683..3c61ae4b3 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -624,6 +624,8 @@ sub add_common_rules() { for $interface ( @$list ) { set_interface_option $interface, 'use_input_chain', 1; + set_interface_option $interface, 'use_forward_chain', 1; + for $chain ( input_chain $interface, output_chain $interface ) { add_rule $filter_table->{$chain} , "-p udp --dport $ports -j ACCEPT"; }