ipfw dummynet 每个 ip 公平流量整形

ipfw dummynet 每个 ip 公平流量整形

我想以这样的方式调整流量,即没有特定用户可以耗尽 WAN 连接那么多,这样其他用户就会受到影响。我有 100Mbits/s 带宽的 ISP 链接,有时一些用户在从互联网或通过 VPN 从远程办公室的 smb 下载某些内容时可能会耗尽它。所以,我制定了以下规则:

  #traffic shaping for office users 
#$ipfw pipe 1 config bw 100Mbits/s
#$ipfw queue 1 config pipe 1 weight 2 mask dst-ip 0xffffffff

#traffic from internet to local subnets (wi-fi and wire) going to the queue
#$ipfw add queue 1 ip from any to { 172.30.0.0/24 or 172.30.1.0/24 } in recv em0
# the same thing but with lower weight for guest wi-fi
#$ipfw add queue 1 ip from any to 192.168.0.0/23 in recv em0 

#traffic from remote office via vpn going to the queue 
#$ipfw add queue 1 ip from any to any in recv tun101
#$ipfw add queue 1 ip from any to any in recv tun100

所以,问题是,我不太明白以下内容:

  1. 0xffffffff 和 0x00000000 之间有什么区别以及每个 ip 公平整形应使用什么?
  2. 应该为管道设置队列的大小是多少,因为据我了解这非常重要?
  3. 也许有更简单的方法来完成这个任务?

相关内容