Which Layer 2? Ethernet? Token Ring? Infiniband? ATM? Fibre Channel?
Both IPv4 and IPv6 were created when there were multiple Layer 2 protocols in use. That's why where was a completely different protocol to handle Layer 2 to 3 mappings (often itself referred to as a Layer "2.5" one):
(Keep in mind that the setup described here has work for years now.)