"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "share/arno-iptables-firewall/plugins/50multiroute.plugin" between
aif-2.1.0.tar.gz and aif-2.1.1.tar.gz

About: Arno’s iptables firewall is a stateful firewall script for both single and multi-homed machines with DSL/ADSL support.

50multiroute.plugin  (aif-2.1.0):50multiroute.plugin  (aif-2.1.1)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# -= Arno's Iptables Firewall(AIF) - Multirouting plugin =- # -= Arno's Iptables Firewall(AIF) - Multirouting plugin =-
# #
PLUGIN_NAME="Multirouting plugin" PLUGIN_NAME="Multirouting plugin"
PLUGIN_VERSION="0.31BETA (EXPERIMENTAL!)" PLUGIN_VERSION="1.00"
PLUGIN_CONF_FILE="multiroute.conf" PLUGIN_CONF_FILE="multiroute.conf"
# #
# Last changed : March 17, 2009 # Last changed : February 6, 2020
# Requirements : iproute2 (package) + kernel 2.6 with the following opt ions set in: # Requirements : iproute2 (package) + kernel 2.6 with the following opt ions set in:
# Networking, Networking support, TCP/IP networking: # Networking, Networking support, TCP/IP networking:
# CONFIG_IP_ADVANCED_ROUTER=y (IP: advanced router ) # CONFIG_IP_ADVANCED_ROUTER=y (IP: advanced router )
# CONFIG_IP_MULTIPLE_TABLES=y (IP: policy routing) # CONFIG_IP_MULTIPLE_TABLES=y (IP: policy routing)
# CONFIG_IP_ROUTE_MULTIPATH=y (IP: equal cost mult ipath) # CONFIG_IP_ROUTE_MULTIPATH=y (IP: equal cost mult ipath)
# #
# Comments : This plugin enables IP multirouting (load balancing). Note # Comments : This plugin enables IP multirouting (load balancing). Note
# that it does NOT support redundant connections (fallba ck when # that it does NOT support redundant connections (fallba ck when
# one of the links is down). This is NOT a limitation of this # one of the links is down). This is NOT a limitation of this
# plugin, but of the current Linux kernel that does not support # plugin, but of the current Linux kernel that does not support
# this(yet). To obtain the information needed to configu re this plugin # this(yet). To obtain the information needed to configu re this plugin
# use the 'ifconfig' and 'route' commands. # use the 'ifconfig' and 'route' commands.
# #
# Author : (C) Copyright 2005-2009 by Arno van Amersfoort # Author : (C) Copyright 2005-2020 by Arno van Amersfoort
# Homepage : https://rocky.eld.leidenuniv.nl/ # Homepage : https://rocky.eld.leidenuniv.nl/
# Email : a r n o v a AT r o c k y DOT e l d DOT l e i d e n u n i v DOT n l # Email : a r n o v a AT r o c k y DOT e l d DOT l e i d e n u n i v DOT n l
# (note: you must remove all spaces and substitute the @ and the . # (note: you must remove all spaces and substitute the @ and the .
# at the proper locations!) # at the proper locations!)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation. # version 2 as published by the Free Software Foundation.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
skipping to change at line 87 skipping to change at line 87
ip route replace $MULTIROUTE_INT_NET via $MULTIROUTE_INT_IP table 2 ip route replace $MULTIROUTE_INT_NET via $MULTIROUTE_INT_IP table 2
# Destroy old routes # Destroy old routes
ip route del default via $MULTIROUTE_EXT_ROUTER1 dev $MULTIROUTE_EXT_IF1 2>/de v/null ip route del default via $MULTIROUTE_EXT_ROUTER1 dev $MULTIROUTE_EXT_IF1 2>/de v/null
ip route del default via $MULTIROUTE_EXT_ROUTER2 dev $MULTIROUTE_EXT_IF2 2>/de v/null ip route del default via $MULTIROUTE_EXT_ROUTER2 dev $MULTIROUTE_EXT_IF2 2>/de v/null
# Setup the actual loadbalancing # Setup the actual loadbalancing
echo "${INDENT}Enabling loadbalancing" echo "${INDENT}Enabling loadbalancing"
echo "${INDENT} Adding external interface $MULTIROUTE_EXT_IF1, gw=$MULTIROUTE_ EXT_ROUTER1, weight=$MULTIROUTE_EXT_WEIGHT1" echo "${INDENT} Adding external interface $MULTIROUTE_EXT_IF1, gw=$MULTIROUTE_ EXT_ROUTER1, weight=$MULTIROUTE_EXT_WEIGHT1"
echo "${INDENT} Adding external interface $MULTIROUTE_EXT_IF2, gw=$MULTIROUTE_ EXT_ROUTER2, weight=$MULTIROUTE_EXT_WEIGHT2" echo "${INDENT} Adding external interface $MULTIROUTE_EXT_IF2, gw=$MULTIROUTE_ EXT_ROUTER2, weight=$MULTIROUTE_EXT_WEIGHT2"
ip route add default equalize \ ip route add default scope global \
nexthop via $MULTIROUTE_EXT_ROUTER1 dev $MULTIROUTE_EXT_IF1 weight $MULTIROU TE_EXT_WEIGHT1 \ nexthop via $MULTIROUTE_EXT_ROUTER1 dev $MULTIROUTE_EXT_IF1 weight $MULTIROU TE_EXT_WEIGHT1 \
nexthop via $MULTIROUTE_EXT_ROUTER2 dev $MULTIROUTE_EXT_IF2 weight $MULTIROU TE_EXT_WEIGHT2 nexthop via $MULTIROUTE_EXT_ROUTER2 dev $MULTIROUTE_EXT_IF2 weight $MULTIROU TE_EXT_WEIGHT2
# Flush route cache # Flush route cache
# echo "1" >/proc/sys/net/ipv4/route/flush # echo "1" >/proc/sys/net/ipv4/route/flush
ip route flush cache ip route flush cache
return 0 return 0
} }
skipping to change at line 166 skipping to change at line 166
# Check where to find the config file # Check where to find the config file
CONF_FILE="" CONF_FILE=""
if [ -n "$PLUGIN_CONF_PATH" ]; then if [ -n "$PLUGIN_CONF_PATH" ]; then
CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE" CONF_FILE="$PLUGIN_CONF_PATH/$PLUGIN_CONF_FILE"
fi fi
# Preinit to success: # Preinit to success:
PLUGIN_RET_VAL=0 PLUGIN_RET_VAL=0
# Check if the config file exists # Check if the config file exists
if [ ! -e "$CONF_FILE" ]; then if [ ! -f "$CONF_FILE" ]; then
printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_ NAME v$PLUGIN_VERSION\" ignored!\n" >&2 printf "NOTE: Config file \"$CONF_FILE\" not found!\n Plugin \"$PLUGIN_ NAME v$PLUGIN_VERSION\" ignored!\n" >&2
else else
# Source the plugin config file # Source the plugin config file
. "$CONF_FILE" . "$CONF_FILE"
if [ "$ENABLED" = "1" ] || if [ "$ENABLED" = "1" ] ||
[ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "stop" ] || [ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "stop" ] ||
[ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "status" ]; then [ -n "$PLUGIN_LOAD_FILE" -a "$PLUGIN_CMD" = "status" ]; then
# Show who we are: # Show who we are:
echo "${INDENT}$PLUGIN_NAME v$PLUGIN_VERSION" echo "${INDENT}$PLUGIN_NAME v$PLUGIN_VERSION"
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)