linux下使用iptables和tc限制速度
linux下使用iptables和tc限制速度的方法,记录一下。假设本地搭建了PPTPD服务,又或者有多个网卡,需要对其中一些接口做限速处理的情况,非常有用,本文基于CentOS 6.4 64bit。
1,初始配置
yum install /sbin/tc
vim /etc/sysctl.conf
修改net.ipv4.ip_forward = 1
sysctl -p
#清除原来的mangle表规则
iptables -t mangle -F
#加载sch_htb模块
modprobe sch_htb
echo "modprobe sch_htb" >> /etc/rc.local
2,TC限速设置
假设现在有两块网卡
eth0: xx.xx.xx.xx(外网的上网地址)
eth1: 172.16.44.1(做为内网的网关) (more…)