1.vim /etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.ip_local_reserved_ports = 8001 11000
預留端口避免被佔用, 所以這邊就把8001 到 11000的端口預留。
然後重啓/sbin/sysctl -p
2.echo "8001,11000 " >> /proc/sys/net/ipv4/ip_local_reserved_ports,
再重啓 /etc/init.d/network restart
這修改需要內核2.6.38版本以上才能用。