#!/usr/bin/perl

writeEntry("/proc/sys/net/ipv4/ip_always_defrag","1");
writeEntry("/proc/sys/net/ipv4/tcp_fin_timeout","30");
writeEntry("/proc/sys/net/ipv4/tcp_keepalive_time","100");
writeEntry("/proc/sys/net/ipv4/tcp_window_scaling","1");
writeEntry("/proc/sys/net/ipv4/tcp_sack","1");
writeEntry("/proc/sys/net/ipv4/tcp_timestamps","1");
writeEntry("/proc/sys/net/core/rmem_default","65535");
writeEntry("/proc/sys/net/core/rmem_max","65535");
writeEntry("/proc/sys/net/core/wmem_default","32767");
writeEntry("/proc/sys/net/core/wmem_max","32767");
writeEntry("/proc/sys/net/ipv4/conf/all/arp_filter","1");
writeEntry("/proc/sys/net/ipv4/conf/eth0/arp_filter","1");
writeEntry("/proc/sys/net/ipv4/conf/eth1/arp_filter","1");
writeEntry("/proc/sys/net/ipv4/conf/eth0/rp_filter","1");
writeEntry("/proc/sys/net/ipv4/conf/eth1/rp_filter","1");
writeEntry("/proc/sys/net/ipv4/conf/all/rp_filter","1");
writeEntry("/proc/sys/net/ipv4/icmp_echo_ignore_all","1");
writeEntry("/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts","1");
writeEntry("/proc/sys/net/ipv4/icmp_ignore_bogus_error_response","1");
writeEntry("/proc/sys/net/ipv4/tcp_max_syn_backlog","327686");
writeEntry("/proc/sys/net/core/somaxconn","32767");
writeEntry("/proc/sys/net/core/somaxconn","30000");
writeEntry("/proc/sys/net/ipv4/tcp_max_orphans","3200000");
writeEntry("/proc/sys/net/ipv4/tcp_max_syn_backlog","30000");
writeEntry("/proc/sys/net/ipv4/tcp_retries2","4");
writeEntry("/proc/sys/net/ipv4/tcp_mem","1800000  1850000  1900000");
writeEntry("/proc/irq/169/smp_affinity","1");
writeEntry("/proc/sys/net/ipv4/route/gc_elasticity","2");
writeEntry("/proc/sys/net/ipv4/route/gc_thresh","2500000");
writeEntry("/proc/sys/net/ipv4/route/gc_interval","1");
writeEntry("/proc/sys/net/ipv4/route/secret_interval","60000");

system("ifconfig eth0 txqueuelen 15000");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");
#writeEntry("","");

sub writeEntry(){
	
	my $path	= shift;
	my $val		= shift;

	open(WH,">$path") or warn "Write $path failed\n";
		print WH $val;
	close;
	
	return 1;

}; # sub writeEntry(){

#/etc/init.d/networking restart