启动内核ip转发和其他优化

1.临时修改

echo 1 > /proc/sys/net/ipv4/ip_forward

echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse 

2.配置文件修改

vim /etc/sysctl.conf

net.ipv4.ip_forward = 1

net.ipv4.tcp_tw_reuse = 1

vm.swappiness = 0
kernel.sysrq = 1

net.ipv4.neigh.default.gc_stale_time = 120
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_announce = 2
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_slow_start_after_idle

net.ipv4.tcp_tw_reuse = 1

你可能感兴趣的:(Cent,OS,tcp/ip,网络协议,网络,linux)