summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vyatta-link-detect9
-rw-r--r--templates/protocols/static/arp/node.def4
2 files changed, 6 insertions, 7 deletions
diff --git a/scripts/vyatta-link-detect b/scripts/vyatta-link-detect
index 9dc17e05..078053cc 100755
--- a/scripts/vyatta-link-detect
+++ b/scripts/vyatta-link-detect
@@ -17,16 +17,15 @@ fi
# 0 - always receive
# 1 - ignore receive if admin_down
# 2 - ignore receive if admin_down or link down
-set-sysctl () {
- sudo sh -c "echo $2 >/proc/sys/net/ipv4/conf/$1/link_filter"
-# sudo sh -c "echo $2 >/proc/sys/net/ipv6/conf/$1/link_filter"
+set_linkfilter () {
+ net_set /proc/sys/net/ipv4/conf/$1/link_filter=$2
}
case $2 in
-on) set-sysctl $1 2
+on) set_linkfilter $1 2
exec vtysh -c "configure terminal" -c "interface $1" \
-c "link-detect" ;;
-off) set-sysctl $1 1
+off) set_linkfilter $1 1
exec vtysh -c "configure terminal" -c "interface $1" \
-c "no link-detect" ;;
*) usage;;
diff --git a/templates/protocols/static/arp/node.def b/templates/protocols/static/arp/node.def
index 0174b24c..8bf88225 100644
--- a/templates/protocols/static/arp/node.def
+++ b/templates/protocols/static/arp/node.def
@@ -36,8 +36,8 @@ end:
ipaddr=$VAR(@)
hwaddr=$VAR(hwaddr/@)
- sudo arp -d $ipaddr > /dev/null
+ arp -d $ipaddr > /dev/null
if [ -n "$hwaddr" ]; then
- sudo arp -s $ipaddr $hwaddr
+ arp -s $ipaddr $hwaddr
fi
exit 0