File: firewall7.fw.orig

package info (click to toggle)
fwbuilder 5.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 41,192 kB
  • sloc: cpp: 185,790; sh: 71,182; ansic: 4,345; xml: 3,488; python: 83; makefile: 74; perl: 49
file content (113 lines) | stat: -rwxr-xr-x 1,816 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/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: * firewall7.fw /etc/firewall7.fw
#
#
#
# Compiled for ipfw 
#
# testing rules with broadcasts





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() {
    :
    
}

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
"$IPFW" add 1 set 1 check-state ip from any to any




# ================ IPv4


# ================ Rule set Policy
# 
# Rule  0 (eth0)
"$IPFW" add 10 set 1 drop    log all  from any  to 192.168.1.255  in  recv eth0  || exit 1
# 
# Rule  1 (eth1)
"$IPFW" add 20 set 1 drop    log all  from any  to me  in  recv eth1  || exit 1
# 
# Rule  2 (global)
"$IPFW" add 30 set 1 permit udp  from any  to 192.168.1.255 68     keep-state  || exit 1
# 
# Rule  fallback rule
#    fallback rule 
"$IPFW" add 40 set 1 drop   all  from any  to any       || exit 1

epilog_commands

"$IPFW" set swap 0 1 || exit 1
"$IPFW" delete set 1