Create a file named sysctl.conf in your local /etc folder
This needs again to be done as root!
Go to the command line, become root and fire up your preferred editor (vi) by typing vi /etc/sysctl.conf
Put the following into the newly created file, (shown for example only, but where your keepalive goes),
net.inet.tcp.delayed_ack=0
net.inet.tcp.mssdflt=1460
net.inet.tcp.newreno=1
and save the file. The file rights must be set to: owner root:wheel and -rw-r--r-- please make sure by typing ls -al /etc/sysctl.conf on the command line and if not change it by running chown root:wheel /etc/sysctl.conf and chmod 0644 /etc/sysctl.conf from the command line.