Thanks everyone I got the difference
For all standard ACL , there is an default deny ACE
ACE means the ACL entry:
access-list 12 permit/deny x.x.x.x x.x.x.x'
Default ACE: if a packet doesn't match any of the ACE in the ACL , then it is automatically blocked
So if you want to allow only packets from VLAN 12 ( 192.168.12.0 ) to VLAN 10
U have to create ACE
Access-list 12 permit 192.168.12.0 0.0.0.255
And apply it to VLAN 10 outbound interface ,
Here we choose out bound as the packet is coming in from VLAN 12 and
out to VLAN 10
ACL will check for packets coming into VLAN 10 from VLAN 12
So outbound = coming into the VLAN 10
(coming **out to** VLAN 10 **from** any other network )
here we don't want to create ACE to deny all other packets as cisco implements deny any by default
if we would have applied ACL 12 to inbound interface of VLAN 10 then ,
ACL will check for packets coming from VLAN 10 into VLAN 12 , and will reject everything which doesn't match the ACE. As there is no packet with source address 192.168.12.x (all packets from have source 192.168.10.x) , none of the packet will match the ACE. So all packets from VLAN 10 will be discarded and hence VLAN 10 can't communicate with any other network.
If you add ACE permit any , then it will first check the first condition and it doesn't pass, so it will check below condition . As we gave ACe as permit any, all packets will be allowed and there won't be any filtering
ACE: access-list 12 permit any
So in inbound interface ACL will check for packets coming from VLAN 10 to other networks
Hence inbound = coming from the VLAN 10
(coming **in from** VLAN 10 **into** any other network )
Access-list 10 permit 192.168.10.0 0.0.0.255
on a VLAN inbound you only permit packets originating from 192.168.10.0/24 into the VLAN, everything else is dropped (there's an implicitdeny any
at the end of each ACL). 'Inbound' means the packets are matched to the ACL when they enter the VLAN (through an interface or internal routing). 'Outbound' is the opposite, when they try to leave the VLAN - usually the 'inbound' approach is the better and more logical one.