利用iptables统计ss多用户端口流量(图文教程)

本文介绍iptables防火墙常用规则,方便个人维护自行搭建梯子,分享给朋友ss账号。 利用ss一键安装脚本,可快速搭建跨国上网方案。添加多用户账号很容易。有时候,你要统计每个账号ss流量,找出滥用对象。 实现原理 添加iptables规则,统计指定ss端口流量使用情况,生成日志。 本文假定你明白如何ssh连接vps,并且已经搭建好了梯子。 ss一键安装教程 高性价比vps推荐:Vultr和Linode 操作步骤 使用以下命令,可直接查看当前连线的ss用户情况: #显示当前所有正在使用SS的用户客户端IP netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $5}’ |awk -F “:” ‘{print $1}’ |sort -u #显示当前服务器用户正使用的ss端口 netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |awk ‘{print $4}’ |sort -u #列出当前正使用的指定ss端口客户端数量 netstat -anp |grep ‘ESTABLISHED’ |grep ‘python’ |grep ‘tcp6’ |grep 服务器IP:ss端口号 假定你要统计ss端口10000的用户流量数据,输入命令: iptables […]

Linux Ubuntu使用wondershaper限制上传下载速度教程

Ubuntu Linux服务器限速非常容易,我们可以使用wondershaper限制服务器上传速度、下载速度,防止恶意刷流量。 wondershaper是一个脚本,可有效控制服务器网卡端口速度。(wondershaper官网源码) 我们以Linode机房VPS举例: Ubuntu安装wondershaper: apt-get install wondershaper 使用规则: wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>] 解释: -h Display help -a <adapter> Set the adpter -d <rate> Set maximum download rate (in Kbps) -u <rate> Set maximum upload rate (in Kbps) -p Use the presets in /etc/conf.d/wondershaper.conf -c Clear the limits from adapter -s […]

Begin typing your search term above and press enter to search. Press ESC to cancel.