Este contenido no está disponible en el idioma seleccionado.
3.8. net_cls
The
net_cls subsystem tags network packets with a class identifier (classid) that allows the Linux traffic controller (tc) to identify packets originating from a particular cgroup. The traffic controller can be configured to assign different priorities to packets from different cgroups.
- net_cls.classid
net_cls.classidcontains a single value that indicates a traffic control handle. The value ofclassidread from thenet_cls.classidfile is presented in the decimal format while the value to be written to the file is expected in the hexadecimal format. For example,0x100001represents the handle conventionally written as10:1in the format used by the ip utility. In thenet_cls.classidfile, it would be represented by the number1048577.The format for these handles is:0xAAAABBBB, where AAAA is the major number in hexadecimal and BBBB is the minor number in hexadecimal. You can omit any leading zeroes;0x10001is the same as0x00010001, and represents1:1. The following is an example of setting a10:1handle in thenet_cls.classidfile:echo 0x100001 > /cgroup/net_cls/red/net_cls.classid cat /cgroup/net_cls/red/net_cls.classid
~]# echo 0x100001 > /cgroup/net_cls/red/net_cls.classid ~]# cat /cgroup/net_cls/red/net_cls.classid 1048577Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Refer to the man page for tc to learn how to configure the traffic controller to use the handles that the
net_cls adds to network packets.