Linux网络安全技术与实现(性能)
2019-02-16 本文已影响47人
SkTj
1 防火墙自上而下的规则写法,减少规则匹配

iptables -L -n -v
2 多使用multiport iprange


3 nf_conntrack_max

nf_conntrack 连接跟踪表

4 不让nf_conntrack跟踪
iptables -t raw -A PREROUTING -i eth2 -o eth1 -p tcp --dport 25 -j NOTRACK
iptables -t raw -A PREROUTING -i eth1 -o eth2 -p tcp --dport 25 -j NOTRACK

5 nf_conntrack_ftp协议处理ftp


6 DNAT

7 用recent模块抵御端口扫描

8 string和recent来拒绝密码破解

10分钟内尝试4次连接就错误

三次握手:syn_sent syn_recent established
防御syn攻击
net.ipv4.tcp_synack_retries 3
net.ipv4.tcp_max_syn_backlog 2048
net.ipv4.tcp_syncookies 1
限制1分钟内连接请求数
