[LARTC] HTB: Filtering flat out not working :(

Linux Advanced Routing and Traffic Control

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

 



--------------E4841FB5455F589B23B777C2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tim Carr wrote:

I guess that's because your router does masquerading so source addresses
are changed , and filters don't match.



> Please please help, i've lost lots of sleep over this. Here's my
> set-up: 4 computers on a LAN in my house, having IPs 192.168.0.7,
> 192.168.0.50, 192.168.0.52, 192.168.0.58.A router/linux-box (which
> runs the shaping/tc_commands), which is the default gateway of the 4
> machines: 192.168.0.1. It masquerades the internet connection.Internet
> connection: ADSL PPPoE. The ADSL modem is connected to eth0 of the
> router, and PPPoE makes ppp0. eth1 is the LAN.  Yes, kernel is
> compiled correctly (has advanced router option, patched with HTB,
> etc). Here's my script. Essentially what I want to do is give each of
> the 4 ppl a fourth of the bandwidth, giving myself a higher ceiling
> because I use more bandwidth than they do.
> ---------------------------------tc qdisc add dev eth1 root handle 1:
> htb default 14 tc class add dev eth1 parent 1: classid 1:1 htb rate
> 12kbps ceil 12kbpstc class add dev eth1 parent 1:1 classid 1:10 htb
> rate 4kbps ceil 10kbps burst 1k prio 1tc class add dev eth1 parent 1:1
> classid 1:11 htb rate 4kbps ceil 7kbps burst 1k prio 2tc class add dev
> eth1 parent 1:1 classid 1:12 htb rate 4kbps ceil 7kbps burst 1k prio
> 2tc class add dev eth1 parent 1:1 classid 1:13 htb rate 4kbps ceil
> 7kbps burst 1k prio 2tc class add dev eth1 parent 1:1 classid 1:14 htb
> rate 1kbps ceil 10kbps burst 1k prio 2
> # use SFQ (stochastic fair queueing) for everything
> tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev eth1 parent 1:11 handle 11: sfq perturb 10
> tc qdisc add dev eth1 parent 1:12 handle 12: sfq perturb 10
> tc qdisc add dev eth1 parent 1:13 handle 13: sfq perturb 10
> tc qdisc add dev eth1 parent 1:14 handle 14: sfq perturb 10 #
> matchings
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src
> 192.168.0.7/32 flowid 1:10
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src
> 192.168.0.58/32 flowid 1:11
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src
> 192.168.0.50/32 flowid 1:12
> tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip src
> 192.168.0.52/32 flowid 1:13-------------------------------------- The
> PROBLEM: no matter how hard I try, NO packets EVER get onto any flow
> but the default, 1:14. Eg. my computer (192.168.0.7) can send many
> packets thru the gateway, and none of them get put on flow 1:10 like
> they should, they all go onto 1:14, the default.  Why? Add'l
> QUESTIONS: Which interface should I be using?! Ideally i'd like to use
> ppp0, but I guess I can't because i'm masquerading? Therefore I should
> use eth1, the internal lan-side ethernet card? Also, have I got the
> SFQ tied in right? Perhaps my matchings/filters should use
> 10:something instead of 1:10 etc?  ... I've tried MARKing packets with
> IPtables, that doesn't work either. Is that a better method ? (I feel
> that it isn't, right now...) Lots of questions eh?!  All answers
> appreciated! Thanks, Tim Carr

--
Vincent EGAL
Email : egal@ipanematech.com



--------------E4841FB5455F589B23B777C2
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
Tim Carr wrote:
<p>I&nbsp;guess that's because your router does masquerading so source
addresses are changed , and filters don't match.
<br>&nbsp;
<br>&nbsp;
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Please
please help, i've lost lots of sleep over this.</font></font> <font face="Arial"><font size=-1>Here's
my set-up:</font></font> <font face="Arial"><font size=-1>4 computers on
a LAN in my house, having IPs 192.168.0.7, 192.168.0.50, 192.168.0.52,
192.168.0.58.A router/linux-box (which runs the shaping/tc_commands), which
is the default gateway of the 4 machines: 192.168.0.1. It masquerades the
internet connection.Internet connection: ADSL PPPoE. The ADSL modem is
connected to eth0 of the router, and PPPoE makes ppp0. eth1 is the LAN.&nbsp;
Yes, kernel is compiled correctly (has advanced router option, patched
with HTB, etc).</font></font> <font face="Arial"><font size=-1>Here's my
script. Essentially what I want to do is give each of the 4 ppl a fourth
of the bandwidth, giving myself a higher ceiling because I use more bandwidth
than they do.</font></font> <font face="Arial"><font size=-1>---------------------------------tc
qdisc add dev eth1 root handle 1: htb default 14</font></font> <font face="Arial"><font size=-1>tc
class add dev eth1 parent 1: classid 1:1 htb rate 12kbps ceil 12kbpstc
class add dev eth1 parent 1:1 classid 1:10 htb rate 4kbps ceil 10kbps burst
1k prio 1tc class add dev eth1 parent 1:1 classid 1:11 htb rate 4kbps ceil
7kbps burst 1k prio 2tc class add dev eth1 parent 1:1 classid 1:12 htb
rate 4kbps ceil 7kbps burst 1k prio 2tc class add dev eth1 parent 1:1 classid
1:13 htb rate 4kbps ceil 7kbps burst 1k prio 2tc class add dev eth1 parent
1:1 classid 1:14 htb rate 1kbps ceil 10kbps burst 1k prio 2</font></font>
<br><font face="Arial"><font size=-1># use SFQ (stochastic fair queueing)
for everything</font></font>
<br><font face="Arial"><font size=-1>tc qdisc add dev eth1 parent 1:10
handle 10: sfq perturb 10</font></font>
<br><font face="Arial"><font size=-1>tc qdisc add dev eth1 parent 1:11
handle 11: sfq perturb 10</font></font>
<br><font face="Arial"><font size=-1>tc qdisc add dev eth1 parent 1:12
handle 12: sfq perturb 10</font></font>
<br><font face="Arial"><font size=-1>tc qdisc add dev eth1 parent 1:13
handle 13: sfq perturb 10</font></font>
<br><font face="Arial"><font size=-1>tc qdisc add dev eth1 parent 1:14
handle 14: sfq perturb 10</font></font> <font face="Arial"><font size=-1>#
matchings</font></font>
<br><font face="Arial"><font size=-1>tc filter add dev eth1 parent 1:0
protocol ip prio 1 u32 match ip src 192.168.0.7/32 flowid 1:10</font></font>
<br><font face="Arial"><font size=-1>tc filter add dev eth1 parent 1:0
protocol ip prio 1 u32 match ip src 192.168.0.58/32 flowid 1:11</font></font>
<br><font face="Arial"><font size=-1>tc filter add dev eth1 parent 1:0
protocol ip prio 1 u32 match ip src 192.168.0.50/32 flowid 1:12</font></font>
<br><font face="Arial"><font size=-1>tc filter add dev eth1 parent 1:0
protocol ip prio 1 u32 match ip src 192.168.0.52/32 flowid 1:13--------------------------------------</font></font>
<font face="Arial"><font size=-1>The PROBLEM: no matter how hard I try,
NO packets EVER get onto any flow but the default, 1:14. Eg. my computer
(192.168.0.7) can send many packets thru the gateway, and none of them
get put on flow 1:10 like they should, they all go onto 1:14, the default.&nbsp;
Why?</font></font> <font face="Arial"><font size=-1>Add'l QUESTIONS: Which
interface should I be using?! Ideally i'd like to use ppp0, but I guess
I can't because i'm masquerading? Therefore I should use eth1, the internal
lan-side ethernet card? Also, have I got the SFQ tied in right? Perhaps
my matchings/filters should use 10:something instead of 1:10 etc?&nbsp;
... I've tried MARKing packets with IPtables, that doesn't work either.
Is that a better method ? (I feel that it isn't, right now...)</font></font>
<font face="Arial"><font size=-1>Lots of questions eh?!&nbsp; All answers
appreciated!</font></font> <font face="Arial"><font size=-1>Thanks,</font></font>
<font face="Arial"><font size=-1>Tim Carr</font></font></blockquote>

<pre>--&nbsp;
Vincent EGAL
Email : egal@ipanematech.com</pre>
&nbsp;
</body>
</html>

--------------E4841FB5455F589B23B777C2--



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