Two way of rate-limit configuration
It can configure by port or by ACL.
"Configure by port" is a simple way to configure the rate-limit which based on port.
"Configure by ACL" can be used to configure the rate-limit which based on special traffic policy/flow, it will need to configure ACL first, and then apply the ACL to the port.
1) Rate-limit configure by port
Configuration Guide:
Example:
sudo config interface qos interface-rate-limit interface-name [ -pir pir-value ] [ -pbs pbs-value ] Options: -pir, --pir INTEGER RANGE Peak information rate. Kbit/s [required] -pbs, --pbs INTEGER RANGE Peak Burst Size. Kbytes |
Rate-limit 2.5G,Burst Size 1024.
admin@sonic:~$ sudo config interface qos interface-rate-limit Ethernet1 -pir 2500000 -pbs 1024 admin@sonic:~$ sudo config interface qos interface-rate-limit Ethernet2 -pir 2500000 -pbs 1024 |
Note: This configuration can't be applied on all ports at the same time. It needs to be applied in each port one by one.
Check configure result:
admin@sonic:~$ show inter qos interface-rate-lim Ethernet1 Port pir pbs --------- ------- ----- Ethernet1 2500000 1024 |
2) Rate-limit configure by ACL
- Write IPv4 QoS ACL rules to be added into a .json file, and then run the sudo config acl update incremental acl_rule.json command to configure the rules.
- Configure a policer profile for IPv4 QoS ACLs.
root@sonic:/home/admin# sudo config policer add policer_test -mode sr_tcm -meter_type bytes -cir 12500000 -cbs 8192 -pbs 8192 -red_action drop -yellow_action drop |
- Create an IPv4 QoS ACL and apply it to a physical port, aggregate interface, or virtual extensible local area network (VXLAN).
root@sonic:/home/admin# config acl add table TEST2 L3_QOS -p Ethernet1 -s ingress |
- Example of a .json file defining rules for an IPv4 QoS ACL
{ "acl": { "acl-sets": { "acl-set": { "TEST2": { "acl-entries": { "acl-entry": { "1": { "actions": { "config": { "policer-action": "policer_test", "dscp-action": "10", "log-action": "LOG_SYSLOG" } }, "config": { "sequence-id": 1 }, "icmp": { "config": { "type": "1", "code": "1" } }, "ip": { "config": { "protocol":"IP_ICMP", "source-ip-address": "172.20.3.1/32", "destination-ip-address":"172.20.2.0/24" } } }, "2": { "actions": { "config": { "forwarding-action": "ACCEPT" } }, "config": { "sequence-id": 2 }, "ip": { "config": { "protocol": "IP_TCP", "source-ip-address": "1.1.1.1/32", "destination-ip-address": "2.2.2.2/32" } }, "transport": { "config": { "source-port": "555", "destination-port": "2222", "tcp-flags": [ "TCP_ACK", "TCP_SYN" ] } } }, "3": { "actions": { "config": { "tc-action": "2", "log-action": "LOG_SYSLOG" } }, "config": { "sequence-id": 3 }, "ip": { "config": { "protocol":"IP_UDP", "dscp": "10" } }, "transport": { "config": { "destination-port": "4791" } } } } }, "config": { "name": "TEST2" } } } } } } |
Comments
0 comments
Please sign in to leave a comment.