summaryrefslogtreecommitdiff
path: root/templates/firewall/log-martians/node.def
blob: cee3e6af4c05ce7426e15ba4b52aa2bfccfdd2f8 (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
type: txt

help: Set policy for logging IPv4 packets with invalid addresses

comp_help:Possible completions:
  enable\tEnable logging of IPv4 packets with invalid addresses
  disable\tDisable logging of Ipv4 packets with invalid addresses

default: "enable"

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

create:
	if [ x$VAR(@) == xenable ]; then
	    sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/all/log_martians"
        else
	    sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/log_martians"
	fi

update:
	if [ x$VAR(@) == xenable ]; then
	    sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/all/log_martians"
        else
	    sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/log_martians" 
	fi

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