wordpress数据库显示图片,成都网站建设方案优化,微信开放平台怎么解除绑定,交互网站 百度1、使用hashlimit来限速
#从eth0网卡进入INPUT链数据#xff0c;使用模块hashlimit 限制网速为100kb/s或2mb/s,超过限制的数据包会被DROP。OUTPUT链同理#xff0c;mode为srcip#xff0c;有4个mode选项:
srcip#xff08;默认匹配每个源地址IP#xff0c;配置指定源地址…1、使用hashlimit来限速
#从eth0网卡进入INPUT链数据使用模块hashlimit 限制网速为100kb/s或2mb/s,超过限制的数据包会被DROP。OUTPUT链同理mode为srcip有4个mode选项:
srcip默认匹配每个源地址IP配置指定源地址IP使用-s参数dstip(默认匹配每个目的地址IP配置指定目的地址IP使用-d参数srcport(默认匹配每个源端口配置指定源端口使用-sport参数dstport默认匹配目的端口配置指定目的端口使用-dport参数
2、限制从eth0网卡到IP地址网速
2.1 限制从eth0网卡到所有IP地址INPUT/OPUTPU数据网速为100kb/s:
[rootlocalhost ~]# iptables -A INPUT -i eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode srcip --hashlimit-name in -j DROP
[rootlocalhost ~]# iptables -A OUTPUT -o eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode dstip --hashlimit-name out -j DROP
[rootlocalhost ~]# iptables -L -n --line-numbers #查看添加的iptables规则
[rootlocalhost ~]# iptables -D INPUT 1 #根据查到iptables规则编号进行删除 2.2 限制从eth0网卡到固定IP地址INPUT/OUTPUT数据网速为100kb/s
[rootlocalhost ~]# iptables -A INPUT -i eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode srcip -s 192.168.3.36 --hashlimit-name in -j DROP
[rootlocalhost ~]# iptables -A OUTPUT -o eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode dstip -d 192.168.3.36 --hashlimit-name out -j DROP
[rootlocalhost ~]# iptables -L -n --line-numbers #查看添加的iptables规则
[rootlocalhost ~]# iptables -D INPUT 1 #根据查到iptables规则编号进行删除
[rootlocalhost ~]# iptables -D OUTPUT 1 3、限制从eth0网卡到端口网速
3.1 限制从eth0网卡所有端口INPUT/OPUTPU数据网速为100kb/s:
[rootlocalhost ~]# iptables -A INPUT -i eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode srcport --hashlimit-name in -j DROP
[rootlocalhost ~]# iptables -A OUTPUT -o eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode dstport --hashlimit-name out -j DROP
[rootlocalhost ~]# iptables -D INPUT 1 #根据查到iptables规则编号进行删除
[rootlocalhost ~]# iptables -D OUTPUT 1 3.2 限制从eth0网卡到固定端口IPINPUT/OUTPUT数据网速为100kb/s
[rootlocalhost ~]# iptables -A INPUT -i eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode srcport -p tcp --sport 9985 --hashlimit-name in -j DROP
[rootlocalhost ~]# iptables -A OUTPUT -o eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode dstport -p tcp --dport 9985 --hashlimit-name out -j DROP
[rootlocalhost ~]# iptables -D INPUT 1 #根据查到iptables规则编号进行删除
[rootlocalhost ~]# iptables -D OUTPUT 1 3.3 限制从eth0网卡到固定端口IPINPUT/OUTPUT数据网速为100kb/s
[rootlocalhost ~]# iptables -A INPUT -i eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode srcport -s 192.168.3.36 -p tcp --sport 9985 --hashlimit-name in -j DROP
[rootlocalhost ~]# iptables -A OUTPUT -o eth0 -m hashlimit --hashlimit-above 100kb/s --hashlimit-mode dstport -d 192.168.3.36 -p tcp --dport 9985 --hashlimit-name out -j DROP
[rootlocalhost ~]# iptables -D INPUT 1 #根据查到iptables规则编号进行删除
[rootlocalhost ~]# iptables -D OUTPUT 1 注默认是来所有IP对应的端口如果指定固定IP请参考使用-s和-d参数。
原文链接https://blog.csdn.net/mayifan0/article/details/116149344