Hello, I''m having problem adding filters using tc. I get the response back RTNETLINK answers-invalis argument. Though the tc qdisc and tc class commands work fine. In my kernel config, QoS related parameters are enabled (CONFIG_NET_SCHED, CONFIG_NET_QOS, CONFIG_NET_CLS, CONFIG_NET_CLS_U32, CONFIG_NET_SCH_HTB). Also CONFIG_NETLINK, CONFIG_RTNETLINK and CONFIG_NETLINK_DEV are set to ''y'' __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 09 October 2003 23:58, Praveen Mehrotra wrote:> Hello, > > I''m having problem adding filters using tc. I get the > response back RTNETLINK answers-invalis argument. > > Though the tc qdisc and tc class commands work fine. > In my kernel config, QoS related parameters are > enabled (CONFIG_NET_SCHED, CONFIG_NET_QOS, > CONFIG_NET_CLS, CONFIG_NET_CLS_U32, > CONFIG_NET_SCH_HTB). Also CONFIG_NETLINK, > CONFIG_RTNETLINK and CONFIG_NETLINK_DEV are set to ''y''Can you post your tc commands? Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Praveen Mehrotra
2003-Oct-10 20:06 UTC
Re: Problem with tc filter (tc qdisc/class works ok)
--- Stef Coene <stef.coene@docum.org> wrote:> On Thursday 09 October 2003 23:58, Praveen Mehrotra > wrote: > > Hello, > > > > I''m having problem adding filters using tc. I get > the > > response back RTNETLINK answers-invalis argument. > > > > Though the tc qdisc and tc class commands work > fine. > > In my kernel config, QoS related parameters are > > enabled (CONFIG_NET_SCHED, CONFIG_NET_QOS, > > CONFIG_NET_CLS, CONFIG_NET_CLS_U32, > > CONFIG_NET_SCH_HTB). Also CONFIG_NETLINK, > > CONFIG_RTNETLINK and CONFIG_NETLINK_DEV are set to > ''y'' > Can you post your tc commands? > > StefHi Stef, I''m using following commands (i''m trying to use it with IMQ). I''m trying the example given in IMQ section of adv-routing-howto doc. # tc qdisc add dev imq0 root handle 1: htb default 11 # tc class add dev imq0 parent 1: classid 1:1 htb \ rate 4mbit burst 10k # tc class add dev imq0 parent 1:1 classid 1:10 \ htb rate 2mbit # tc class add dev imq0 parent 1:1 classid 1:11 \ htb rate 2mbit # tc qdisc add dev imq0 parent 1:10 handle 10 pfifo #tc qdisc add dev imq0 parent 1:11 handle 11: pfifo # tc filter add dev imq0 parent 10:0 protocol ip \ prio 1 u32 match u32 00100000 00ff0000 at 0 \ flowid 1:10 All commands except the last one work fine. Thanks for your help, Praveen __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Friday 10 October 2003 22:06, Praveen Mehrotra wrote:> # tc filter add dev imq0 parent 10:0 protocol ip \ > prio 1 u32 match u32 00100000 00ff0000 at 0 \ > flowid 1:10 > > All commands except the last one work fine.soyou have an error in your filter statement. I have the same error if I execute it on my box. I''m not familiar with the u32 syntax, but check out the docs for examples. I think you copied this filter command from the lartc howto, but it''s not working for me either. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi> # tc filter add dev imq0 parent 10:0 protocol ip \ > prio 1 u32 match u32 00100000 00ff0000 at 0 \ > flowid 1:10 > > All commands except the last one work fine.I assume you''re trying to match the tos field. u32 uses strtol to read numeric values. Values prefixed with a 0 are assumed to be octal you have to write 0x0011... and 0x00ff.... in order to have it interpreted in hex. Try this: tc filter add dev imq parent 10:0 protocol ip \ prio 1 u32 match ip tos 0x10 0xff flowid 1:10 Regards -- Thomas GRAF <tgraf@suug.ch> _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi I finally had some time to clean up (read: completely re-write) the shaper script I''ve been using for over a year now. I was hoping it would be useful to others, but before I "release" it, I would like some comments from you guys. Please let me know about any bugs, annoyances or ideas. The script (ezshaper) is a "simple" bash script (although pretty large) with very few extra dependencies (I''m planning on running it on a IPCop box soon). Basically all it really needs are iptables and tc (htb version). At the moment ezshaper is intended for simple situations like this: LAN <-----> Linux Firewall/router <------> Internet But I believe it could be used in (or adapted to) other situations as well. Ezshaper reads a simple config file (ezshaper.cfg) that contains the definitions for the tc classes (with prio, rates and ceils) and the rules to mark packets for each class. Ezshaper generates iptables and tc commands from that. I believe I have made the syntax in the cfg file as easy as possible, but you can also include more complex iptables options (matches etc) for more advanced rules. There are some resctrictions I might fix some day. The ezshaper script itself can be run with several options (e.g.: -h for help; -d for debugmode) and then a command (start, stop, status, ...). In the "status" command I added a nice easy-to-read table showing all classes and the most important statistics. Any comments are welcome! Thanks, Jannes Faber