Cisco – How to Block Torrents Using NBAR

bandwidthciscocisco-commandscisco-ios

I have a Cisco 1900 Series router running and I have issued whereby clients running torrents take all the bandwidth for their own use while business users suffer the damage.

I tried setting up nbar using the config as stated below;

  ip cef
  class-map match-any LIMIT-TOR
  match protocol bittorrent
  exit
  policy-map QOS-LIMIT-TOR-POLICY
  class LIMIT-TOR
  police cir 2000000
  confirm-action drop
  exceed-action drop
  exit
  exit
  exit
  int gig 0/1
  ip nbar protocol-discovery
  service-policy input QOS-LIMIT-TOR-POLICY

Where the Interface Gigabit 0/1 is the LAN Interface on the Router.

I noticed nothing changed as I was still able to use Utorrent and I changed the policy map from what i have up there to this;
policy-map QOS-LIMIT-TOR-POLICY
class LIMIT-TOR
exit
And I an still having same issue…. I could still use Utorrent.

I did a show state on the recent configuration and got this
RouterName#show policy-map int gig0/1
GigabitEthernet0/1

    Service-policy input: QOS-LIMIT-TOR-POLICY

      Class-map: LIMIT-TOR (match-any)
        9245 packets, 1103711 bytes
        5 minute offered rate 5000 bps, drop rate 5000 bps
        Match: protocol bittorrent
          9245 packets, 1103711 bytes
          5 minute rate 5000 bps
        Match: protocol gnutella
          0 packets, 0 bytes
          5 minute rate 0 bps
        drop

Class-map: class-default (match-any)
  771180 packets, 134837021 bytes
  5 minute offered rate 875000 bps, drop rate 0 bps
  Match: any 

What am I doing wrong please?

Best Answer

Thanks all. It has been rectified.

I changed the code from

  int gig 0/1
  ip nbar protocol-discovery
  service-policy input QOS-LIMIT-TOR-POLICY

to (by adding the additional line of code)

  int gig 0/1
  ip nbar protocol-discovery
  service-policy input QOS-LIMIT-TOR-POLICY
  service-policy output QOS-LIMIT-TOR-POLICY