Complete firewall in case of network defined in rules
This commit is contained in:
@@ -400,6 +400,11 @@ else
|
||||
IPTABLES_OPTIONS=""
|
||||
GREP_OPTIONS=""
|
||||
if [ "$SOURCE_IP" != "" ]; then
|
||||
|
||||
if [ "$(echo $SOURCE_IP | cut -d . -f4)" == "0" ]; then
|
||||
SOURCE_IP="$(echo $SOURCE_IP | cut -d . -f1-3).0/24";
|
||||
fi
|
||||
|
||||
IPTABLES_OPTIONS=$IPTABLES_OPTIONS" -s $SOURCE_IP";
|
||||
GREP_OPTIONS=$GREP_OPTIONS"|grep -e $SOURCE_IP";
|
||||
|
||||
@@ -410,6 +415,11 @@ else
|
||||
fi
|
||||
|
||||
if [ "$TARGET_IP" != "" ]; then
|
||||
|
||||
if [ "$(echo $TARGET_IP | cut -d . -f4)" == "0" ]; then
|
||||
TARGET_IP="$(echo $TARGET_IP | cut -d . -f1-3).0/24";
|
||||
fi
|
||||
|
||||
IPTABLES_OPTIONS=$IPTABLES_OPTIONS" -d $TARGET_IP";
|
||||
GREP_OPTIONS=$GREP_OPTIONS"|grep -e $TARGET_IP";
|
||||
|
||||
|
Reference in New Issue
Block a user