| verzia 2.123, 2023/11/08 22:29:04 |
verzia 2.124, 2026/01/06 16:41:45 |
|
|
| # Licensed under terms of GNU General Public License. |
# Licensed under terms of GNU General Public License. |
| # All rights reserved. |
# All rights reserved. |
| # |
# |
| # $Platon: scripts/shell/firewall/fw-universal.sh,v 2.122 2020/09/17 18:58:29 nepto Exp $ |
# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.123 2023/11/08 22:29:04 nepto Exp $ |
| # |
# |
| # Changelog: |
# Changelog: |
| # 2003-10-24 - created |
# 2003-10-24 - created |
|
|
| else |
else |
| port_rule="--dport $port" |
port_rule="--dport $port" |
| fi |
fi |
| |
last_port=""; |
| for iface in $INTERFACES; do |
for iface in $INTERFACES; do |
| riface="IFname_$iface"; |
riface="IFname_$iface"; |
| if [ "$last_port" != "$port" -a -n "$src_ip" ]; then counter=0; print_info ""; fi |
if [ -n "$last_port" -a "$last_port" != "$port" -a -n "$src_ip" ]; then |
| |
counter=0; |
| |
print_info ""; |
| |
fi |
| print_info -en " $port($iface)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
print_info -en " $port($iface)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
| if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
| last_port="$port"; |
last_port="$port"; |
| Riadok 1028 allow_input() |
|
| Riadok 1032 allow_input() |
|
| else |
else |
| port_rule="--dport $port" |
port_rule="--dport $port" |
| fi |
fi |
| |
last_port=""; |
| for iface in $INTERFACES; do |
for iface in $INTERFACES; do |
| riface="IFname_$iface"; |
riface="IFname_$iface"; |
| if [ "$last_port" != "$port" -a -n "$src_ip" ]; then counter=0; print_info ""; fi |
if [ -n "$last_port" -a "$last_port" != "$port" -a -n "$src_ip" ]; then |
| |
counter=0; |
| |
print_info ""; |
| |
fi |
| print_info -en " $port($iface)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
print_info -en " $port($iface)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
| if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
| last_port="$port"; |
last_port="$port"; |
| Riadok 1053 allow_input() |
|
| Riadok 1061 allow_input() |
|
| |
|
| if [ ! -z "$REAL_ACCEPT_INPUT_TCP" ]; then |
if [ ! -z "$REAL_ACCEPT_INPUT_TCP" ]; then |
| print_info -e "Accepting REAL all INPUT TCP connections for ALL interfaces on ports:" |
print_info -e "Accepting REAL all INPUT TCP connections for ALL interfaces on ports:" |
| |
last_port=""; |
| for port in $REAL_ACCEPT_INPUT_TCP; do |
for port in $REAL_ACCEPT_INPUT_TCP; do |
| src_ip="" |
src_ip="" |
| eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
| if [ "$last_port" != "$port" -a -n "$src_ip" ]; then counter=0; print_info ""; fi |
if [ -n "$last_port" -a "$last_port" != "$port" -a -n "$src_ip" ]; then |
| |
counter=0; |
| |
print_info ""; |
| |
fi |
| print_info -en " $port(ALL)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
print_info -en " $port(ALL)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
| if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
| last_port="$port"; |
last_port="$port"; |
| Riadok 1077 allow_input() |
|
| Riadok 1089 allow_input() |
|
| fi |
fi |
| if [ ! -z "$REAL_ACCEPT_INPUT_UDP" ]; then |
if [ ! -z "$REAL_ACCEPT_INPUT_UDP" ]; then |
| print_info -e "Accepting REAL all INPUT UDP connections for ALL interfaces on ports:" |
print_info -e "Accepting REAL all INPUT UDP connections for ALL interfaces on ports:" |
| |
last_port=""; |
| for port in $REAL_ACCEPT_INPUT_UDP; do |
for port in $REAL_ACCEPT_INPUT_UDP; do |
| src_ip="" |
src_ip="" |
| eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
| if [ "$last_port" != "$port" -a -n "$src_ip" ]; then counter=0; print_info ""; fi |
if [ -n "$last_port" -a "$last_port" != "$port" -a -n "$src_ip" ]; then |
| |
counter=0; |
| |
print_info ""; |
| |
fi |
| print_info -en " $port(ALL)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
print_info -en " $port(ALL)"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
| if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
| last_port="$port"; |
last_port="$port"; |
| Riadok 1213 allow_input() |
|
| Riadok 1229 allow_input() |
|
| if [ ! -z "$ACCEPT_INPUT_TCP" ]; then |
if [ ! -z "$ACCEPT_INPUT_TCP" ]; then |
| print_info -e "$iface: Accepting INPUT TCP connections on ports:" |
print_info -e "$iface: Accepting INPUT TCP connections on ports:" |
| counter=0; |
counter=0; |
| |
last_port=""; |
| for port in $ACCEPT_INPUT_TCP; do |
for port in $ACCEPT_INPUT_TCP; do |
| src_ip="" |
src_ip="" |
| eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
eval `echo $port | awk -v FS=: '/:/ { printf "src_ip=\"%s\"; port=\"%s\";", $1, $2; }'` |
| if [ -n "$src_ip" -a "$port" = "0" ]; then |
if [ -n "$src_ip" -a "$port" = "0" ]; then |
| port="ALL"; |
port="ALL"; |
| fi |
fi |
| if [ "$last_port" != "$port" -a -n "$src_ip" ]; then counter=0; print_info ""; fi |
if [ -n "$last_port" -a "$last_port" != "$port" -a -n "$src_ip" ]; then |
| |
counter=0; |
| |
print_info ""; |
| |
fi |
| print_info -en " $port"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
print_info -en " $port"`[ ! -z "$src_ip" ] && echo "[$src_ip]"` |
| if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
if [ $(( ++counter )) -ge 5 ]; then counter=0; print_info ""; fi; |
| last_port="$port"; |
last_port="$port"; |