# Networking >  IP address to Layer 2 switch

## Geek_Guest

IP works in Network Layer. Switch Works in Data Link Layer (I'm talking about layer2 switches only). So, how we give IP address to a layer2 switch ? My question is how a network layer protocol works in data link layer device?

*Question asked by visitor Debraj*

----------


## tayofaj

Let me say that the 2 addys do work together. the mac addy identifites the layer2 switch, while in a way, the ip addy is mutually inclusive in that it identifies the network. 
Now depending on the routing protocol on your router: 
The logical network addy of the destination host is then used to get the packet to a network thru a routed network; then the mac addy of the host is used to deliver it from the layer2 to the correct destination or host

----------

