mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 12:14:32 +01:00
First (untested) attempt to implement ip address addition
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5620 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
faa431718e
commit
41ac708a5d
@ -217,6 +217,22 @@ sub setup_one_masq($$$$$$)
|
||||
#
|
||||
expand_rule $chainref , POSTROUTE_RESTRICT , $rule, $networks, $destnets, '', $target, '', '' , '';
|
||||
|
||||
if ( $add_snat_aliases ) {
|
||||
my ( $interface, $alias ) = split /:/, $fullinterface;
|
||||
$alias = 0 unless defined $alias;
|
||||
for my $address ( split /,/, $addresses ) {
|
||||
my ( $addrs, $port ) = split /:/, $address;
|
||||
next unless $addrs;
|
||||
for my $addr ( ip_range_explicit $addrs ) {
|
||||
unless ( $addresses_to_add{$addr} ) {
|
||||
emit "del_ip_addr $addr $interface" unless $config{RETAIN_ALIASES};
|
||||
$addresses_to_add{$addr} = 1;
|
||||
push @addresses_to_add, "$interface:$alias";
|
||||
$alias++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
progress_message " Masq record \"$line\" $done";
|
||||
|
||||
@ -303,9 +319,8 @@ sub do_one_nat( $$$$$ )
|
||||
if ( $interface =~ s/:$// ) {
|
||||
$add_ip_aliases = '';
|
||||
} else {
|
||||
#
|
||||
# Fixme
|
||||
#
|
||||
my ( $iface , undef ) = split /:/, $interface;
|
||||
emit "del_ip_addr $external $iface" unless $config{RETAIN_ALIASES};
|
||||
}
|
||||
} else {
|
||||
$interface =~ s/:$//;
|
||||
@ -324,9 +339,13 @@ sub do_one_nat( $$$$$ )
|
||||
|
||||
add_nat_rule 'OUTPUT' , "-d $external$policyout -j DNAT --to-destination $internal " if $localnat;
|
||||
|
||||
#
|
||||
# Fixme -- add_ip_aliases
|
||||
#
|
||||
if ( $add_ip_aliases ) {
|
||||
unless ( $addresses_to_add{$external} ) {
|
||||
$addresses_to_add{$external} = 1;
|
||||
push @addresses_to_add, "$external $interface";
|
||||
}
|
||||
}
|
||||
|
||||
progress_message " NAT entry \"$line\" $done";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user