11-13-2022 01:36 PM
Hello! I am using Packet Tracer 8.2 and am trying to learn ACLs without success.
These is the ACL on the Router 2:
Extended IP access list denywww
10 permit tcp any host 192.168.2.2 eq www
20 deny tcp any host 192.168.2.2 eq 22
30 permit ip any any (2 match(es))
If I remove 30 permit ip any any it blocks everything, but if I have it there it allows everything.
On the switch:
Standard IP access list ssh-in
10 permit 192.168.2.0 0.0.0.255
20 deny any
access-class ssh-in in
All clients can still connect using SSH. I don't understand at all
Thanks!
11-14-2022 12:32 AM
Hi, the first and most important question is, where do you apply the ACL (interface, control plane, line vty, console etc) and direction ( in or out)
11-14-2022 02:43 AM - edited 11-14-2022 02:47 AM
On the switch:
line vty 0 4
access-class ssh-in in
login local
transport input ssh
On the router:
interface GigabitEthernet0/0
ip address 192.168.2.1 255.255.255.0
ip access-group denywww in
Thanks!
11-14-2022 12:34 AM - edited 11-14-2022 12:56 AM
two point :-
1-
R2 have two interface do you sure you apply ACL in right interface,
try apply same ACL in both R2 interface and check
2-
how is client and how is server in both HTTP and SSH ??
11-14-2022 02:45 AM
The ACL is applied on the correct interface. The switch is SSH enabled and the server is HTTP enabled
11-14-2022 04:26 AM
So there is two different device and two different service and same host ip??
That unusual,
11-14-2022 12:52 AM
@christoffer92 wrote:
Extended IP access list denywww
10 permit tcp any host 192.168.2.2 eq www
20 deny tcp any host 192.168.2.2 eq 22
30 permit ip any any (2 match(es))
If I remove 30 permit ip any any it blocks everything, but if I have it there it allows everything.
@christoffer92 there is an implicit deny at the end of an ACL (not displayed in the configuration), so when you removed "30 permit ip any any" traffic not matching any of the rules above would be denied by the implicit deny rule.
11-14-2022 02:53 AM
@Rob Ingram I see. But how come rule 30 permits traffic that should be blocked?
11-14-2022 03:05 AM
@christoffer92 on the ACL - denywww - ACE #20 denies traffic from "any" source to the destination 192.168.2.2 - but the IP address of Gi0/0 (where you've applied the ACL) is 192.168.2.1, so traffic won't match ACE #20. Therefore the ACE rule #20 is incorrect, the destination is not 192.168.2.2. Hence why it matches ACE #30
As to why the connection does not match the other ACL "ssh-in" what is the source IP address of the connection?
Enable logging and check (assuming PT supports it).
11-14-2022 03:22 AM - edited 11-14-2022 03:23 AM
Thanks for response! I tried the following but still getting the same result
Extended IP access list denywww
10 permit tcp any host 192.168.2.3 eq www
20 deny tcp any host 192.168.2.1 eq 22
30 permit ip any any (45 match(es))
Extended IP access list denywww
10 permit tcp any host 192.168.2.3 eq www
20 deny tcp any any eq 22
30 permit ip any any (48 match(es))
For ACL ssh-in the source is 192.168.1.0.
How to enable logging?
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