mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-25 20:22:12 +02:00
Correct detection of IPv6 PERSISTENT_SNAT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
6035d49ede
commit
82f9ba8bb7
@ -2225,6 +2225,8 @@ determine_capabilities() {
|
|||||||
if qt $g_tool -t nat -N $chain; then
|
if qt $g_tool -t nat -N $chain; then
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
qt $g_tool -t nat -A $chain -j SNAT --to-source 1.2.3.4 --persistent && PERSISTENT_SNAT=Yes
|
qt $g_tool -t nat -A $chain -j SNAT --to-source 1.2.3.4 --persistent && PERSISTENT_SNAT=Yes
|
||||||
|
else
|
||||||
|
qt $g_tool -t nat -A $chain -j SNAT --to-source 2001::1 --persistent && PERSISTENT_SNAT=Yes
|
||||||
fi
|
fi
|
||||||
qt $g_tool -t nat -F $chain
|
qt $g_tool -t nat -F $chain
|
||||||
qt $g_tool -t nat -X $chain
|
qt $g_tool -t nat -X $chain
|
||||||
|
@ -3549,9 +3549,10 @@ sub Persistent_Snat() {
|
|||||||
have_capability( 'NAT_ENABLED' ) || return '';
|
have_capability( 'NAT_ENABLED' ) || return '';
|
||||||
|
|
||||||
my $result = '';
|
my $result = '';
|
||||||
|
my $address = $family == F_IPV4 ? '1.2.3.4' : '2001::1';
|
||||||
|
|
||||||
if ( qt1( "$iptables -t nat -N $sillyname" ) ) {
|
if ( qt1( "$iptables -t nat -N $sillyname" ) ) {
|
||||||
$result = qt1( "$iptables -t nat -A $sillyname -j SNAT --to-source 1.2.3.4 --persistent" );
|
$result = qt1( "$iptables -t nat -A $sillyname -j SNAT --to-source $address --persistent" );
|
||||||
qt1( "$iptables -t nat -F $sillyname" );
|
qt1( "$iptables -t nat -F $sillyname" );
|
||||||
qt1( "$iptables -t nat -X $sillyname" );
|
qt1( "$iptables -t nat -X $sillyname" );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user