If you have L2 Switch with different VLANs, then you Trunk the switch port to a router trunk port.
Now if PC1 on Vlan 10 pings VLAN 20 (both are on the same switch), then the Ping packet will go through the trunk port of the switch to the Trunk port of the router then back the same path.
in this case can we say Ping works at Layer 2 or at both Layer 2 and Layer 3 ?
I also believe(correct me if I am wrong) The IP routing at the router level works without any extra configuration , not like at the L3 switch level where you have to add the command "IP Routing". correct ?