mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
Fix NET3 bug (netmap)
This commit is contained in:
parent
7689831cd7
commit
312624cef5
@ -207,6 +207,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -207,6 +207,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -214,6 +214,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -155,6 +155,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
##############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -155,6 +155,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -155,6 +155,8 @@ LOAD_HELPERS_ONLY=Yes
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -461,15 +461,15 @@ sub setup_netmap() {
|
||||
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
|
||||
|
||||
unless ( $interfaceref->{root} ) {
|
||||
$rulein = match_source_dev( $interface ) . match_source_net ( $net3 );
|
||||
$ruleout = match_dest_dev( $interface ) . match_dest_net ( $net3 );
|
||||
$rulein = match_source_dev( $interface );
|
||||
$ruleout = match_dest_dev( $interface );
|
||||
$interface = $interfaceref->{name};
|
||||
}
|
||||
|
||||
if ( $type eq 'DNAT' ) {
|
||||
add_rule ensure_chain( 'nat' , input_chain $interface ) , $rulein . "-d $net1 -j NETMAP --to $net2";
|
||||
add_rule ensure_chain( 'nat' , input_chain $interface ) , $rulein . match_source_net( $net3 ) . "-d $net1 -j NETMAP --to $net2";
|
||||
} elsif ( $type eq 'SNAT' ) {
|
||||
add_rule ensure_chain( 'nat' , output_chain $interface ) , $ruleout . "-s $net1 -j NETMAP --to $net2";
|
||||
add_rule ensure_chain( 'nat' , output_chain $interface ) , $ruleout . match_dest_net( $net3 ) . "-s $net1 -j NETMAP --to $net2";
|
||||
} else {
|
||||
fatal_error "Invalid type ($type)";
|
||||
}
|
||||
|
@ -196,6 +196,8 @@ LOAD_HELPERS_ONLY=No
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
||||
FORWARD_CLEAR_MARK=Yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
@ -278,12 +278,12 @@ None.
|
||||
|
||||
See http://www.shorewall.net/Vserver.html for details.
|
||||
|
||||
2) A new CLEAR_FORWARD_MARK option has been added to shorewall.conf
|
||||
2) A new FORWARD_CLEAR_MARK option has been added to shorewall.conf
|
||||
and shorewall6.conf.
|
||||
|
||||
Traditionally, Shorewall has cleared the packet mark in the first
|
||||
rule in the mangle FORWARD chain. This behavior is maintained with
|
||||
the default setting (CLEAR_FORWARD_MARK=Yes). If the new option is
|
||||
the default setting (FORWARD_CLEAR_MARK=Yes). If the new option is
|
||||
set to No, packet marks set in the PREROUTING chain are retained in
|
||||
the FORWARD chains.
|
||||
|
||||
|
@ -151,6 +151,8 @@ DYNAMIC_BLACKLIST=Yes
|
||||
|
||||
LOAD_HELPERS_ONLY=No
|
||||
|
||||
FORWARD_CLEAR_MARK=yes
|
||||
|
||||
###############################################################################
|
||||
# P A C K E T D I S P O S I T I O N
|
||||
###############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user