{"id":3690,"date":"2012-04-05T13:10:58","date_gmt":"2012-04-05T19:10:58","guid":{"rendered":"http:\/\/gregsowell.com\/?p=3690"},"modified":"2012-04-05T13:10:58","modified_gmt":"2012-04-05T19:10:58","slug":"rate-limit-a-cisco-3560-3570-3560e-port","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=3690","title":{"rendered":"Rate Limit A Cisco 3560, 3570, 3560E Port"},"content":{"rendered":"<p>I sometimes use 3560Es as edge routers.  This means that I no switchport the interfaces and put IPs on them to connect to customers.<\/p>\n<p>Here on the edge is where I rate-limit a user&#8217;s connection speed.  On a 3550 this is pretty straight forward, but on a 3560, or a variation of it, this is a little trickier.<\/p>\n<p>One thing of interest is the rate-limit interface sub command itself.  This would appear to allow you to limit ingress and egress traffic.  It will even allow you to configure the commands&#8230;however these commands do absolutely nothing. \ud83d\ude1b<\/p>\n<p>Due to the change in interface queueing you will need to use two methods:  SRR and service policies.<\/p>\n<h1>SRR<\/h1>\n<p><strong>srr-queue bandwidth limit %<\/strong><br \/>\nYou have to set the bandwidth as a percentage of the link speed.  The options are 10-99 percent.  This means that if you want a limit less than 10Mb you must set the port&#8217;s physical speed to 10 and the duplex to full.  You will then have to statically configure the client to 10\/full.  This, however, only limits the egress traffic.<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">int fa0\/1\r\nsrr-queue bandwidth limit 10<\/code><\/pre>\n<h1>Service Policy<\/h1>\n<p>We use this to match and limit our ingress traffic.<\/p>\n<p>First, you must enable mls qos on your switch, otherwise your matching won&#8217;t work.<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">mls qos<\/code><\/pre>\n<p>Next we define our class map.  We have it set to match ip traffic with DSCP set to 0.<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">class-map match-all rate-limit\r\n  description Bandwidth Control\r\n match ip dscp default<\/code><\/pre>\n<p>We then create policy maps that have our desired speeds:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">policy-map 8meg\r\n class rate-limit\r\n  police 8192000 192000 exceed-action drop<\/code><\/pre>\n<p>Last we apply this to the interface:<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">int fa0\/1\r\nservice-policy input 8meg<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I sometimes use 3560Es as edge routers. This means that I no switchport the interfaces and put IPs on them to connect to customers.\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,20,8],"tags":[],"class_list":["post-3690","post","type-post","status-publish","format-standard","hentry","category-cisco","category-hardware","category-networking"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/3690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3690"}],"version-history":[{"count":7,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/3690\/revisions"}],"predecessor-version":[{"id":3697,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/3690\/revisions\/3697"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}