Actually, if you use "access-list deny ip host 192.168.0.1 eq 80" that should be sufficient. You don't need the netmask if you use "host". That's equivalent to 255.255.255.255.
Holy Cats!!! No offense to any of the previous people posting, but I have never seen so many people write an incorrect access list line. Pixboy is correct that the "host" keyword negates the need for a mask (and everybody that did write a mask in forgot to use reverse masking), but he forgot the list number. The right example would be:
access-list 101 deny tcp host 192.168.0.1 eq 80
HOWEVER, I have not seen anybody ask a critical question here - you want to block port 80, but in what direction? Are you trying to block this user from accessing outside resources on port 80 (browsing), or are you trying to block the internal resource from using port 80 as a source from the inside (because it is a web server)? If the latter, unless you have a static NAT to this device, nobody from the outside can access its web port anyway. If the former, then the access list would read a bit differently then above:
access-list 101 deny tcp host 192.168.0.1 any eq 80
OK - if you are trying to block a certain IP from browsing and we'll say that interface e0 is the interface on the router. We'll also say that 192.168.1.100 is the user IP in question.
My list would look like this:
access-list 150 deny tcp host 192.168.1.100 any eq 80
access-list 150 permit ip any any
int e0
access-group 150 in
This will block web browsing for the user, but allow all other traffic. Remember that the "permit ip any any" statement always needs to be at the bottom of the list, so if you need to add statements to block more ports later, you will need to remove the list and reapply it in the correct order.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.