Networking

Configure QoS on your Cisco router with this template

Using quality of service (QoS) on Cisco network devices helps provide both bandwidth and priority to certain types of network traffic. In this edition of Cisco Routers and Switches, David Davis walks you through the basics of configuring QoS on a Cisco router and shows you how <a href="http://www.techrepublic.com/downloads/abstract.aspx?docid=269947" target="_blank">our downloadable template</a> makes it easier.

Using quality of service (QoS) on Cisco network devices helps provide both bandwidth and priority to certain types of network traffic. The network administrator tells the network devices which traffic requires what bandwidth and priority.

It's important to understand the difference between bandwidth and priority. As the network devices (switches or routers) encounter the designated traffic, they give that traffic priority by sending it before other traffic; they give the traffic bandwidth by sending more of it than other traffic.

As I mentioned last time, configuring QoS is very complex. There are many different ways of using QoS as well as different types of QoS. Last time, I discussed how to use Cisco IOS AutoQoS to automatically configure a router to give bandwidth and priority to VoIP traffic ("Learn the benefits of Cisco AutoQoS").

This time, let's take a step back and look at how to configure basic QoS for a given scenario using a downloadable template. Let's begin with a sample scenario.

Our sample scenario

Let's say you have a Cisco 871W router at home. You use this router for Skype VoIP service, to play Counter-Strike over the Internet, and for traditional Internet activities (e.g., Web browsing and e-mail).

However, you're experiencing performance issues with your Skype phone service when simultaneously surfing the Web. When downloading a file, your phone service sounds horrible. In addition, your Internet game suffers when you download FTP files.

This is a prime example of how QoS comes in handy—you need to give these different types of traffic the bandwidth and the priority they require. Once you've configured QoS, you should be able to talk on the phone, play your game, and download files—all at the same time—without experiencing any performance issues.

Keep in mind that this is only an example. Once you understand how to configure QoS, you can customize it to fit your organization's needs. In addition, the downloadable template will create the configuration file, and you can modify it to fit your company's needs.

Configure QoS

Let's review the steps to configuring QoS on a Cisco router.

Step 1: Define the traffic

You must tell the router which traffic you want to give QoS, which you can accomplish either using an access control list (ACL) or using Network Based Application Recognition (NBAR). An ACL is the traditional way to define any traffic for a router.

With NBAR, however, the router just recognizes the traffic traveling through the router—it knows that HTTP is HTTP, Skype is Skype, etc. But there's a limited list of protocols and applications that the router recognizes.

While the router won't recognize every single application, each IOS upgrade adds more to the list. In addition, you can create custom application recognition files.

Step 2: Create a class-map

A class-map defines the traffic into groups. For example, you could create a class-map called VoIP traffic and put all VoIP protocols under it.

Step 3: Create a policy-map

A policy-map matches the classes from the class-map with how much bandwidth and/or priority you want to give this traffic.

Step 4: Apply the policy-map to the interface

Like an ACL, you must apply the policy-map to the specific interface you want it to affect. You can apply the policy-map in either output or input mode. Here's the command to use:

service-policy output|input {name of policy-map}

If you're using NBAR to recognize the traffic, you must also use the ip nbar protocol-discovery command on the interface. This enables NBAR to begin looking at the traffic.

Download the QoS template

Now that you know the basic steps to configuring QoS, you can get started with our downloadable QoS template. (This is the same template that TechRepublic's George Ou has used to explain how to configure the Cisco 871W router for basic configurations, advanced 871W configurations, and an IPSec site-to-site VPN.)

Follow these steps:

  1. Download the template.
  2. Open the Excel file, and fill out the yellow sections on the Variables worksheet.
  3. Click the Replace button; it will generate the appropriate QoS configuration on a new sheet called QOS-1.
  4. Copy the configuration from the Excel file, and paste it into the Cisco CLI. You can copy directly from Excel into a Telnet or SSH session or even the console port.

Miss a column?

Check out the Cisco Routers and Switches Archive, and catch up on David Davis' most recent columns.

Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!

David Davis has worked in the IT industry for 12 years and holds several certifications, including CCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.

36 comments
nur_raziel
nur_raziel

Hi everyone! I need help on how to use the template. I typed in the values in the yellow area but after i clicked the Replace button, nothing happened. I'm not sure if it's my fault that nothing is happening. Please guide me on the usage. Thanks!

mohammed.moumen
mohammed.moumen

Hello, I have a VSS 4560 Switches on a Site 1, and a 7200 on SIte 2. I need to configure QoS for VoIP traffic between the 2 Sites. I applied this configuretion on each port of the access swiches 3560 POE : switchport priority extend trust mls qos trust cos switchport voice vlan dot1p switchport access vlan x switchport mode access switchport voice vlan 173 The problem for me is this: the configuration above is for Layer 2 QoS with 802.1p, I need to know how to configure QoS on layer 3 so that the Layer 2 configuration is translated on layer 3 while packets are sent between the 7200 on Site 1 and the VSS switches 4560 on Site 2! Can you help me please?

fredhunda
fredhunda

I get this error log when i try to load the template. What do I do? -error071480_02.xmlErrors were detected in file 'C:\Users\felix\Downloads\ddavis_QoS_worksheet.xls'-This workbook has lost its VBA project, ActiveX controls and any other programmability-related features.

b372028
b372028

Anyone else have this problem? Keeps putting me back to the profile page. EDIT: It was FireFox. Problem Solved!

Paulk201270
Paulk201270

Lets say that an ISP has Cable modem customers and Fiber based customers, and they have a 200Mb backbone which is getting congested. How would they setup QOS for the Fiber based customers to have priority on all traffic traversing the link, with everyone else having a fair chance for what is left....?

mtitu
mtitu

I need help, I have traffic internet traffic via port no 12307 and data traffic, i want to configure the router to give say 90 percent priority to data traffic to avoid internet congesting the link. please assist me via mtituh@yahoo.com

great69wall
great69wall

Hi, Could you please to explain, why the QoS policy is applied to outward direction ? While the biggest traffic when we are downloading file is on inward direction. Don't we need to manage/apply inward direction also ? thanks.

vivek_gwn
vivek_gwn

This might be helpful. Can you help me to configure QoS on 1841 router?

zahir.ahmed1
zahir.ahmed1

Does not work on the office suite for the mac!

usrhlp
usrhlp

It has a spelling mistake in the auto config. You have written bandwidith when it needs to be bandwidth

BugMeNot123-21716768053511332277940431636204
BugMeNot123-21716768053511332277940431636204

I realize this is an old article, but in case anyone else is trying to get this working on an 871 and having trouble, here is something I worked out after much trial and error. In order to get effective QOS for my IP phone (as in pick up the phone and it takes bandwidth/queue position away from anything else happening on the network sufficiently to have ZERO sound quality issues) I had to add a simple traffic shaping policy in addition to the steps listed in the article for making a qos policy. So, follow the article/spreadsheet with one change: instead of applying the qos policy directly to the outbound interface (i.e. service-policy output MyQOSwhatever), make a traffic shaping policy that references the qos policy and apply that: (make a shaper) policy-map shaper class class-default shape peak 150000

jrussell
jrussell

My requirement is simpler, actually, but never having used QoS, I'm confused. I have 2 Cisco 2800 routers (IOS 12.4(15)T5 on one (R1) and 12.4 (18)b on the other(R2)). The PRI is attached to R2 I have an Engage IP Tube attached to the 3m link between the 2 routers and a Voice T1 plugged into each IP Tube. We are getting echoing and broken up speech on the outbound side of R1. I believe Qos may solve the issue, but have no idea how to configure. Can you help? Thanks, John

steventan
steventan

Hi, I would like to check with you that : do i need to configure cisco switches for LLQ /QoS?

tdjastrzebski
tdjastrzebski

Hi, My router (c870-advsecurityk9-mz.124-9.T.bin) does not recognize "skype" in the following command: match protocol skype Do I need any a different IOS version?

erckis
erckis

Dear David, First I would like to thank you for your post it is very helpfull. But till now I try to find a way to fix this issue: I have Ciscao 7200, 12Mbps down and 10Mbps up I use VoIP (SIP server), now I the Quality of voice is worst and I want to limit the bandwidth for all packet except SIP. Best regards.

robinson
robinson

I have a switch that I want to configure Qos and I would like to know how can i use the template for the switch, my bandwidth is of 14Mbps ???

bienvenurukundo
bienvenurukundo

Hi i need your help for configuring QoS on cisco 2500

ps_somu
ps_somu

like to know abt qos

castillojc1
castillojc1

Please, Can you help? I need for configuring QoS on Cisco 1600, to VoIP and Video

jericho_g
jericho_g

Great article and template! I have one question though: does the created policy also control inbound traffic as well? I see that the template applies the policy as 'output' on the WAN facing interface.

ddavis
ddavis

Hello to All, What do you think of the template? Can you see where you could use this in other situations? How could it help you to do other things? Thanks for reading TechRepublic! -David Davis

mitchell.drage
mitchell.drage

Because unless you have paid for it from a service provider, we have no control over which order packets arrive at our gateway router. All we can do is control how WE send packets out.

onebusonly
onebusonly

NO, it only controls packets egressing the interface. Must have matching policy-map on the other side. Routers are not "flow aware" so complete, single sided control is not possible for TCP traffic.

gondreus
gondreus

no, because as david explained on the attachment "We can only perform QoS on the traffic that we send, NOT the traffic we receive."

jtano83
jtano83

Unable to open the template. Say file is unreadable.

waterman911
waterman911

I am using the template for creating my QoS. But I need to load balance over multiple Internet links. Can you tell me how this is done. We are currently using static routes.

uwaqar
uwaqar

Great work David, ...But apparently 'ip nbar protocol-discovery' is not supported on 4948s I am running. Wonder how I could enable priority on SIP and RTP protocols without having NBAR on my router...? Thanks, -- Umer

mauro
mauro

Hello, I have Ciscos 2500 with IOS 11.0 does it work for me ? thanks in advance Mauro Giller - IT manager

silceski
silceski

hi i have c2821, he is connected to 2 diferent ISP. i mark priority traffic from ISP, and apply policy on inside interface (vlan). results wasn't as i like to be. than i try with you template, results are the some. my question is, how to debug or verify does qos policy is ok or not. best regards

daneshmand
daneshmand

Hi I saw your info on www:\\techtrpublic sit and your info are very helpful.. I jest need to have the commands. If you have the commands for configuring Qos please email it to me. I work for a school in New York City. Thank you for your consideration. Sincerely A. Daneshmand, IT Director

techrepublic
techrepublic

Does not work with the OS X version of Office 2004. I have not tried it in Open Office, but it looks like this feature will be a Windows only feature. Cannot click on the button. You can see the button, and when you mouse over it you get a hand to click on the button, but you cannot actually click on the button. Macros were enabled.

ggraham2
ggraham2

I've been waiting for this article. I'm ordering Packet 8 VOIP and I'll try out your template and give my feed back. What will we be covering next in the 871w tutorial? Easy VPN for Cisco 871w (windows Client to 871w router connection). I've been try to find an article on how to configure this from CLI, but no success yet. Keep up the good work.

aphale
aphale

show policy-map inter which will give the reseult whether the QoS is applied in the interface or not

georgeou
georgeou

We didn't expect it not to work on Mac Office 2004.

Editor's Picks