#!/bin/bash


#INPUT: $1 is either ipv4 or ipv6
#		$2 is the l3 interface name
#		$3 is enable or disable operation
#DESC:	
#		this script will set or clear the corresponding arp proxy bit
#		under /proc/sys/net
#CALLER:
#		sif/arp, sif/fea
#RETURN:
#		0

if [ "$1" = "ipv4" ] ; then
	if [ "$3" = "enable" ] ; then
		echo 1 > /proc/sys/net/ipv4/conf/"$2"/proxy_arp
	else
		echo 0 > /proc/sys/net/ipv4/conf/"$2"/proxy_arp
	fi
else
	if [ "$3" = "enable" ] ; then
		echo 1 > /proc/sys/net/ipv6/conf/"$2"/proxy_ndp
	else
		echo 0 > /proc/sys/net/ipv6/conf/"$2"/proxy_ndp
	fi
fi

exit 0

