Re: Will this work for htb

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




1.I am not sure if i have to apply it eth0 or eth1.Correct me if i am wrong.
2.I want to apply this for upload and download as well.Will the above be effective for both.?

Apply it to eth1 to shape the upload bandwidth.  If yuo want to shape download bandwidth, i'm not sure the best way to do this but if the linux pc itself doesn't need to be shaped, then you could apply it to eth0 and change all those filters from ip src to ip dst. 

3.I am using fedora core4. so do i have to install any other additional packages like iproute,htb or any thing else?But i can move to redhat9 if i don't have to install any other things.

I  am not familiar with  redhat/fedora, but you will need various modules enabled in the kernel such as HTB, and will need to install iptables. I have no idea what the normal kernel options are or if iptables is installed by default.

4.match ip 0xffff ---Does this mean match the IP with the given mac address?
5.prio 1 u32 ----what does this mean?
Thanks in Adv

I think you have your syntax all wrong for these match filters.
http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.qdisc.filters.html#LARTC.FILTERING.SIMPLE
This page has some examples on how to create tc filters. The u32 part is the name of the matching module for tc to use, the 'match ip' portion says you want to match based on ip parameters, in this case the src or dst.  Your above filters should probably be:

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 202.79.0.0/16 flowid 1:10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 202.80.0.0/16 flowid 1:11
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 202.81.0.0/16 flowid 1:12
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 202.82.0.0/16 flowid 1:13

Which sets it to match all packets where the ip packet's source address's first 16 bits (the /16 part) match the first 16 bits of the ip address 202.82.0.0.  each part of the ip address is 8 bits, so if you wanted to instead match the first 3 digits you'd use /24, or all 4 would be /32

In general the 0xffff shows up when matching based on port #'s such as:
tc filter add dev eth0 parent 1: protocol ip prio 18 u32 \
           match ip dport 80 0xffff flowid 1:13
Where the 0xffff is a bit mask of what bits in the specified number to match against the port.

The prio 1 has to do with the order that filters are processed.  A lower prio filter will be used over a higher # prio filter. I seem to remember issues where you have to add filters with prio that is equal or greater than the last one you added.  So in my script I ordered all my filter adds in the order I wanted them applied and just had the prio #'s either the same for a group, or incrementing for the next different group.

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux