12-19-2005 09:47 PM - edited 03-03-2019 01:11 AM
hi
i was wondering if anybody can help me to filter url's on a cisco router .
thanks
12-20-2005 12:32 AM
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
12-20-2005 07:32 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide