| verzia 2.99, 2013/09/28 09:25:35 |
verzia 2.100, 2013/09/28 10:07:18 |
|
|
| # 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.98 2013-09-28 09:22:42 nepto Exp $ |
# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.99 2013-09-28 09:25:35 nepto Exp $ |
| # |
# |
| # Changelog: |
# Changelog: |
| # 2003-10-24 - created |
# 2003-10-24 - created |
| Riadok 1221 allow_output() |
|
| Riadok 1221 allow_output() |
|
| accept_output_udp="${iface}_ACCEPT_OUTPUT_UDP" |
accept_output_udp="${iface}_ACCEPT_OUTPUT_UDP" |
| ACCEPT_OUTPUT_UDP="${!accept_output_udp}" |
ACCEPT_OUTPUT_UDP="${!accept_output_udp}" |
| |
|
| |
|
| # TCP |
# TCP |
| if [ -z "$ACCEPT_OUTPUT_TCP" ]; then |
if [ -z "$ACCEPT_OUTPUT_TCP" ]; then |
| for ip in ${!IPS}; do |
for ip in ${!IPS}; do |
| output_tcp_str="$output_tcp_str $ip($iface)"; |
output_tcp_str="$output_tcp_str $ip(${!riface})"; |
| $IPTABLES -A OUTPUT -p TCP -o ${!riface} -s $ip -j ACCEPT |
$IPTABLES -A OUTPUT -p TCP -o ${!riface} -s $ip -j ACCEPT |
| done |
done |
| else |
else |
| Riadok 1252 allow_output() |
|
| Riadok 1253 allow_output() |
|
| # UDP |
# UDP |
| if [ -z "$ACCEPT_OUTPUT_UDP" ]; then |
if [ -z "$ACCEPT_OUTPUT_UDP" ]; then |
| for ip in ${!IPS}; do |
for ip in ${!IPS}; do |
| output_udp_str="$output_udp_str $ip($iface)"; |
output_udp_str="$output_udp_str $ip(${!riface})"; |
| $IPTABLES -A OUTPUT -p UDP -o ${!riface} -s $ip -j ACCEPT |
$IPTABLES -A OUTPUT -p UDP -o ${!riface} -s $ip -j ACCEPT |
| done |
done |
| else |
else |
| Riadok 1279 allow_output() |
|
| Riadok 1280 allow_output() |
|
| |
|
| # ICMP |
# ICMP |
| for ip in ${!IPS}; do |
for ip in ${!IPS}; do |
| output_icmp_str="$output_icmp_str $ip($iface)"; |
output_icmp_str="$output_icmp_str $ip(${!riface})"; |
| $IPTABLES -A OUTPUT -p ICMP -o ${!riface} -s $ip -j ACCEPT |
$IPTABLES -A OUTPUT -p ICMP -o ${!riface} -s $ip -j ACCEPT |
| done |
done |
| done |
done |