cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
656
Views
5
Helpful
2
Replies

url filter on router

amitbatra
Level 1
Level 1

hi

i was wondering if anybody can help me to filter url's on a cisco router .

thanks

2 Replies 2

Hello,

you could use NBAR to filter URL´s. Lets say you want to filter all URL´s ending with ´play.htm´, you would configure a class and match that string:

Router(config)#class-map match-any HTTP

Router(config-cmap)#match protocol http url "*play.htm*"

You then would configure a policy map:

Router(config)#policy-map FILTER

Router(config-pmap)#class HTTP

Router(config-pmap)#drop

And then apply it to your interface:

interface FastEthernet0/0

service-policy input FILTER

So, the entire configuration would look like this

ip cef

!

interface FastEthernet0/0

service-policy input FILTER

!

class-map match-any HTTP

match protocol http url "*play.htm*"

!

policy-map FILTER

class HTTP

drop

You can also match on other characteristics. Here are a few examples:

Router(config-cmap)#match protocol http url "*.exe"

--> this would match all executables

Router(config-cmap)#match protocol http url "*money*.htm*"

--> this would match all URL´s containing the string ´money´ somewhere in the URL

HTH,

GP

hi

well i knew this one. i was looking is there any other way to do this

well thanks for your responce . tons of thanks

amit