Question: do switches use ip or mac?
Answer: Switches in general do not perform routing. This is usually done by routers, and the datagrams sent by the router use the link layer address (MAC address in ethernet networks) to send the packet to the next hop.