summaryrefslogtreecommitdiff
path: root/templates/firewall/receive-redirects/node.def
blob: e72fed7329264d04bcc7ad2fa3fa2cabd1722491 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# accept_redirects - Accept ICMP redirect messages.
# default value - 0 
# 
# accept_redirects for the interface will be enabled if:
#
# - both conf/{all,interface}/accept_redirects are TRUE 
#   in the case forwarding for the interface is enabled
# or
# - at least one of conf/{all,interface}/accept_redirects 
# is TRUE in the case forwarding for the interface is disabled
#
# accept_redirects for the interface will be disabled otherwise


type: txt

help: Set policy for handling received IPv4 ICMP redirect messages

comp_help:Possible completions:
  enable\tEnable processing of received IPv4 ICMP redirect messages
  disable\tDisable processing of received IPv4 ICMP redirect messages

default: "disable"

syntax:expression: $VAR(@) in "enable", "disable"; "receive-redirects must be enable or disable"

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

delete:
            array=(`ls /proc/sys/net/ipv4/conf/`)
            array_len=${#array[*]}
            i=0
            while [ $i -lt $array_len ]; do
               sudo sh -c "echo 0 > \
                 /proc/sys/net/ipv4/conf/${array[$i]%:*}/accept_redirects"
               let i++
            done