summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Davidson <james.davidson@vyatta.com>2013-01-08 14:54:19 -0800
committerJames Davidson <james.davidson@vyatta.com>2013-01-08 14:54:19 -0800
commit2dd6be60ba0b888d138292f5ccec3bacfc5d4949 (patch)
tree1859f9386ba60161f8c6aec274d1daeecf529972
parentb5400cc864c0c631de0291c7d535b0430f360dcd (diff)
downloadvyatta-cfg-system-2dd6be60ba0b888d138292f5ccec3bacfc5d4949.tar.gz
vyatta-cfg-system-2dd6be60ba0b888d138292f5ccec3bacfc5d4949.zip
Bug 7856: Set default neighbour table size to 8192
Also increase the max allowed value to 32768.
-rwxr-xr-xscripts/vyatta-update-arp-params81
-rw-r--r--templates/system/ip/arp/table-size/node.def7
-rw-r--r--templates/system/ipv6/neighbor/table-size/node.def7
3 files changed, 32 insertions, 63 deletions
diff --git a/scripts/vyatta-update-arp-params b/scripts/vyatta-update-arp-params
index 094d0751..36275731 100755
--- a/scripts/vyatta-update-arp-params
+++ b/scripts/vyatta-update-arp-params
@@ -35,29 +35,37 @@ print_usage()
echo -e "\t$0 delete <type of arp paramter> <ipv4/ipv6>"
}
+set_table_thresholds() {
+ local ip_type=$1
+ local arp_value=$2
+ local softmax=$((arp_value / 2));
+ local min=$((arp_value / 8));
+ sudo sysctl -q net.$ip_type.neigh.default.gc_thresh3=$arp_value
+ sudo sysctl -q net.$ip_type.neigh.default.gc_thresh2=$softmax
+ sudo sysctl -q net.$ip_type.neigh.default.gc_thresh1=$min
+}
+
syntax_arp_param ()
{
- arp_type=$1
- arp_value=$2
- ip_type=$3
+ local arp_type=$1
+ local arp_value=$2
+ local ip_type=$3
case "$arp_type" in
- table-size)
- allowed_values=(1024 2048 4096 8192 16384)
- allowed_values_len=${#allowed_values[*]}
- i=0
- while [ $i -lt $allowed_values_len ]; do
- if [ "${allowed_values[$i]}" == "$arp_value" ] ; then
- exit 0
- fi
- let i++
+ table-size)
+ local allowed_values=(1024 2048 4096 8192 16384 32768)
+ local i
+ for i in ${allowed_values[@]}; do
+ if [[ "$i" == "$arp_value" ]]; then
+ exit 0
+ fi
done
- echo "Allowed values for ARP table-size - 1024 2048 4096 8192 16384"
+ echo "Allowed values for ARP table-size - ${allowed_values[*]}"
exit 1
;;
- *)
+ *)
echo Invalid arp parameter $arp_type to set
exit 1
;;
@@ -66,40 +74,16 @@ syntax_arp_param ()
update_arp_param ()
{
- arp_type=$1
- arp_value=$2
- ip_type=$3
-
- case "$arp_type" in
-
- table-size)
- let softmax=$arp_value\/2;
- let min=$arp_value\/8;
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh3=$arp_value
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh2=$softmax
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh1=$min
- ;;
-
- *)
- echo Invalid arp parameter $arp_type to update
- ;;
- esac
-}
-
-delete_arp_param ()
-{
- arp_type=$1
- ip_type=$2
-
+ local arp_type=$1
+ local arp_value=$2
+ local ip_type=$3
case "$arp_type" in
- table-size)
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh3=1024
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh2=512
- sudo sysctl -q net.$ip_type.neigh.default.gc_thresh1=128
+ table-size)
+ set_table_thresholds $ip_type $arp_value
;;
- *)
+ *)
echo Invalid arp parameter $arp_type to update
;;
esac
@@ -126,15 +110,6 @@ case "$1" in
update_arp_param $2 $3 $4
;;
- delete)
- if [ $# -ne 3 ]; then
- print_usage
- exit 1
- fi
- delete_arp_param $2 $3
- ;;
-
-
*)
print_usage
exit 1
diff --git a/templates/system/ip/arp/table-size/node.def b/templates/system/ip/arp/table-size/node.def
index bdeea371..b4d0a9e3 100644
--- a/templates/system/ip/arp/table-size/node.def
+++ b/templates/system/ip/arp/table-size/node.def
@@ -2,9 +2,9 @@ help: Maximum number of entries to keep in the ARP cache
type: u32
-default: 1024
+default: 8192
-allowed: echo "1024 2048 4096 8192 16384"
+allowed: echo "1024 2048 4096 8192 16384 32768"
syntax:expression: exec " \
/opt/vyatta/sbin/vyatta-update-arp-params \
@@ -12,6 +12,3 @@ syntax:expression: exec " \
update:
/opt/vyatta/sbin/vyatta-update-arp-params 'update' 'table-size' '$VAR(@)' 'ipv4'
-
-delete:
- /opt/vyatta/sbin/vyatta-update-arp-params 'delete' 'table-size' 'ipv4'
diff --git a/templates/system/ipv6/neighbor/table-size/node.def b/templates/system/ipv6/neighbor/table-size/node.def
index cf4d066d..0ea4816e 100644
--- a/templates/system/ipv6/neighbor/table-size/node.def
+++ b/templates/system/ipv6/neighbor/table-size/node.def
@@ -2,9 +2,9 @@ help: Maximum number of entries to keep in the Neighbor cache
type: u32
-default: 1024
+default: 8192
-allowed: echo "1024 2048 4096 8192 16384"
+allowed: echo "1024 2048 4096 8192 16384 32768"
syntax:expression: exec " \
/opt/vyatta/sbin/vyatta-update-arp-params \
@@ -12,6 +12,3 @@ syntax:expression: exec " \
update:
/opt/vyatta/sbin/vyatta-update-arp-params 'update' 'table-size' '$VAR(@)' 'ipv6'
-
-delete:
- /opt/vyatta/sbin/vyatta-update-arp-params 'delete' 'table-size' 'ipv6'