编辑 /etc/sysctl.conf,调整TCP缓冲区及拥塞控制参数,例如:
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_congestion_control=cubic # 选择高效拥塞算法
sysctl -p 使配置生效
/etc/sysctl.conf 中添加:net.ipv4.tcp_keepalive_time=60
net.ipv4.tcp_keepalive_intvl=10
net.ipv4.tcp_keepalive_probes=6
ip link set dev eth0 mtu 1500 # 1500为常见默认值,可根据实际调整
/etc/xinetd.d/telnet(若存在),调整连接参数:instances=100 # 增加最大连接数
per_source=10 # 限制单个IP连接数
cps=100 2 # 限制连接频率
firewalld)限制仅允许特定IP访问Telnet端口:firewall-cmd --permanent --add-rich-rule='rule source address="192.168.1.0/24" service name="telnet" accept'
firewall-cmd --reload
### 四、硬件与系统资源优化
- **升级硬件**:使用更高速的网络接口卡(如千兆网卡)、增加内存以减少I/O瓶颈。
- **优化文件描述符限制**:编辑 `/etc/security/limits.conf`,增加Telnet服务进程的文件描述符限制:
```bash
* soft nofile 65535
* hard nofile 65535
yum install openssh-server
systemctl start sshd