summaryrefslogtreecommitdiff
path: root/templates/firewall/source-validation/node.def
blob: bbd44e44bab3e01579ed09b417aeff14f42fc52a (plain)
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
# rp_filter
# default value - 0
# conf/all/rp_filter and conf/[interface]/rp_filter both must be set to
# a value greater than 0 to do source validation on the interface


type: txt

help: Policy for source validation by reversed path, as specified in RFC3704

val_help: strict; Enable Strict Reverse Path Forwarding as defined in RFC3704
val_help: loose; Enable Loose Reverse Path Forwarding as defined in RFC3704
val_help: disable; No source validation

default: "disable"

syntax:expression: $VAR(@) in "strict", "loose", "disable"; "source-validation must be set to 'loose', 'strict' or 'disable'"

update:
        array=(`ls /proc/sys/net/ipv4/conf/`)
        array_len=${#array[*]}
        i=0
        if [ x$VAR(@) == xstrict ]; then
            while [ $i -lt $array_len ]; do
               sudo sh -c "echo 1 > \
                 /proc/sys/net/ipv4/conf/${array[$i]%:*}/rp_filter"
               let i++
            done
        elif [ x$VAR(@) == xloose ]; then
            while [ $i -lt $array_len ]; do
               sudo sh -c "echo 2 > \
                 /proc/sys/net/ipv4/conf/${array[$i]%:*}/rp_filter"
               let i++
            done
        else
           sudo sh -c "echo 0 > \
               /proc/sys/net/ipv4/conf/all/rp_filter"
	fi

delete:
	sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter"