#!/bin/bash

COMMAND=$1

if [ "${COMMAND}" != "new" ]; then
    exit 0
fi

cat >> /etc/sysctl.conf <<EOF
####################################
# Default perfSONAR sysctl settings
####################################
# net.core.rmem_max = 67108864
# net.core.wmem_max = 67108864
# net.ipv4.tcp_rmem = 4096 87380 33554432
# net.ipv4.tcp_wmem = 4096 87380 33554432
# net.core.netdev_max_backlog = 30000
# net.ipv4.tcp_no_metrics_save = 1
# net.ipv4.tcp_congestion_control = htcp
# net.ipv4.conf.all.arp_ignore=1
# net.ipv4.conf.all.arp_announce=2
# net.ipv4.conf.default.arp_filter=1
# net.ipv4.conf.all.arp_filter=1
####################################

net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.ipv4.tcp_rmem = 4096 87380 33554432
net.ipv4.tcp_wmem = 4096 87380 33554432
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_congestion_control = htcp
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2
net.ipv4.conf.default.arp_filter=1
net.ipv4.conf.all.arp_filter=1
EOF
