1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-19 17:57:22 +01:00
fwbuilder/test/ipfw/firewall34.fw.orig
Vadim Kurland 0aa3eac4d4 * Compiler.cpp (expandGroupsInRuleElement): sorting objects in the
rule element by name after group is expanded, this helps ensure
stable ordering of objects in generated configuration.

* Compiler.cpp (replaceClusterInterfaceInItfRE::processNext):
sorting objects in rule element after cluster interfaces have been
replaced, this helps ensure stable ordering of objects in generated
configuration.

* FWObject.h (FWObjectNameCmpPredicate): moved this class from
gui-specific module to libfwbuilder as it is universally useful.
It can compare FWObject objects by name and can optionally can
follow references; it can be used with std::sort() to sort lists
of FWObject pointers or directly sort rule elements.
2011-03-12 19:50:24 -08:00

126 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
#
# This is automatically generated file. DO NOT MODIFY !
#
# Firewall Builder fwb_ipfw v4.2.0.3499
#
# Generated Sat Mar 12 19:44:44 2011 PST by vadim
#
# files: * firewall34.fw /etc/firewall34.fw
#
#
#
# Compiled for ipfw
#
# Testing actions Pipe, Classify, Custom
cd /etc || exit 1
IFCONFIG="/sbin/ifconfig"
PFCTL="/sbin/pfctl"
IPFW="/sbin/ipfw"
IPF="/sbin/ipf"
IPNAT="/sbin/ipnat"
SYSCTL="/sbin/sysctl"
LOGGER="/usr/bin/logger"
log() {
echo "$1"
command -v "$LOGGER" >/dev/null 2>&1 && $LOGGER -p info "$1"
}
diff_intf() {
func=$1
list1=$2
list2=$3
cmd=$4
for intf in $list1
do
echo $list2 | grep -q $intf || {
# $vlan is absent in list 2
$func $intf $cmd
}
done
}
verify_interfaces() {
:
}
set_kernel_vars() {
:
$SYSCTL -w net.inet.ip.forwarding=1
}
prolog_commands() {
echo "Running prolog script"
}
epilog_commands() {
echo "Running epilog script"
}
run_epilog_and_exit() {
epilog_commands
exit $1
}
configure_interfaces() {
:
}
log "Activating firewall script generated Sat Mar 12 19:44:44 2011 by vadim"
set_kernel_vars
configure_interfaces
prolog_commands
"$IPFW" set disable 1
# ================ IPv4
# ================ Rule set Policy
#
# Rule 0 (rl1)
# port 8668 is natd
"$IPFW" add 10 set 1 divert 8668 all from 192.168.1.0/24 to any via rl1 || exit 1
#
# Rule 1 (global)
# rule doing divert to natd (8668) should go before check-state
"$IPFW" add 20 set 1 check-state all from any to any || exit 1
#
# Rule 2 (global)
"$IPFW" add 30 set 1 divert 1234 tcp from 192.168.1.0/24 to any 22 || exit 1
#
# Rule 3 (global)
"$IPFW" add 40 set 1 queue 2 tcp from 192.168.1.0/24 to any 22 || exit 1
#
# Rule 4 (global)
"$IPFW" add 50 set 1 pipe 1 tcp from 192.168.1.0/24 to any 80 || exit 1
#
# Rule 5 (global)
"$IPFW" add 60 set 1 prob .80 log all from 192.168.1.0/24 to any || exit 1
#
# Rule 6 (global)
"$IPFW" add 70 set 1 drop log all from any to any || exit 1
#
# Rule fallback rule
# fallback rule
"$IPFW" add 80 set 1 drop all from any to any || exit 1
epilog_commands
"$IPFW" set swap 0 1 || exit 1
"$IPFW" delete set 1