|
|
|
|
@ -55,6 +55,9 @@ read -p "Would you want to disable client-to-client routing? [yes] " ANSDROP |
|
|
|
|
if [ "$DROP" == "$ANSDROP" ]; then |
|
|
|
|
# disable forwarding |
|
|
|
|
iptables -I FORWARD -s $LOCALIPMASK -d $LOCALIPMASK -j DROP |
|
|
|
|
else |
|
|
|
|
echo "Deleting DROP rule if exists..." |
|
|
|
|
iptables -D FORWARD -s $LOCALIPMASK -d $LOCALIPMASK -j DROP |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# MSS Clamping |
|
|
|
|
@ -84,3 +87,21 @@ if [ $? -ne 0 ]; then |
|
|
|
|
echo "Cannot save iptables-restore from $IPTABLES to $RCLOCAL." |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
IPTABLESRESTOR=$(which iptables-restore) |
|
|
|
|
RESTORPRESENTS=$(grep iptables-restore $RCLOCAL) |
|
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
|
if [[ ! -z $IPTABLESRESTOR ]]; then |
|
|
|
|
sed -i -e "/exit 0/d" $RCLOCAL |
|
|
|
|
echo "$IPTABLESRESTOR < $IPTABLES" >> $RCLOCAL |
|
|
|
|
echo "exit 0" >> $RCLOCAL |
|
|
|
|
else |
|
|
|
|
echo "Cannot save iptables-restore from $IPTABLES to $RCLOCAL." |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
iptables -F |
|
|
|
|
|
|
|
|
|
if [[ ! -z $IPTABLERESTOR ]]; then |
|
|
|
|
$IPTABLESRESTOR < $IPTABLES |
|
|
|
|
fi |
|
|
|
|
|