編輯 /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