2017-04-05 34 views
0

我試圖開發一個控制兩個IP的QoS系統。取決於兩個IP的OpenWRT中的QoS

使用基於OpenWRT的路由器固件,我嘗試過使用TC並遇到不兼容的問題。是否有另外一套或一套可用於實現此目的的軟件包?

版本:CHAOS平靜(15.05,r46767)

我已經試過如圖後續的wiki頁面之後的結果。 https://wiki.openwrt.org/doc/howto/packet.scheduler/packet.scheduler#examples

由於包不兼容,下面的文章中顯示的示例使用「CLASSIFY」,它是無效的參數。 https://wiki.openwrt.org/doc/howto/packet.scheduler/packet.scheduler.example3

引導的結果:

Failed to find ipt_TOS. Maybe it is a built in module ? 
Failed to find ipt_tos. Maybe it is a built in module ? 
Failed to find ipt_length. Maybe it is a built in module ? 
module is already loaded - sch_hfsc 
module is already loaded - sch_ingress 
Bad argument `CLASSIFY' 

任何幫助是非常讚賞

回答

0
# Delete qdisc rule 
tc qdisc del dev br-lan root 

# Add qdisc rule 
tc qdisc add dev br-lan root handle 1: htb default 10 

# Setup parent class 
tc class add dev br-lan parent 1: classid 1:1 htb rate 2000kbit ceil 2000kbit 

# Add child classes of parent class 1: 
#Wired 
tc class add dev br-lan parent 1:1 classid 1:10 htb rate 2000kbit ceil 2000kbit 
#Wired2 
tc class add dev br-lan parent 1:1 classid 1:11 htb rate 1000kbit ceil 1000kbit 
#Wireless1 
tc class add dev br-lan parent 1:1 classid 1:12 htb rate 250kbit ceil 150kbit 

# Create packet filter rule using parent 1: class, matching to IP (src = outbound traffic, dst = inbound traffic) 
# and assigning child class rule via flowid 

tc -s filter show dev br-lan 

tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.35 flowid 1:10 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.35 flowid 1:10 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.67 flowid 1:11 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.67 flowid 1:11 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.104 flowid 1:12 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.104 flowid 1:12 
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.104 flowid 1:12 

tc -s filter show dev br-lan