Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

url filter on router

hi

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

thanks

2 REPLIES
VIP Purple

Re: url filter on router

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

New Member

Re: url filter on router

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

313
Views
5
Helpful
2
Replies
CreatePlease to create content