Rationally design the nonprecious metal electrocatalysts to replace precious Pt-based catalysts is significantly important to boost the development of low cost fuel cells and metal-air batteries. Here, we propose a core/shell template strategy to synthesize nonprecious metal and nitrogen-doped porous carbons as efficient oxygen bifunctional electrocatalysts for Zn-air batteries. As a typical sample of the strategy, we use a ZnO@ZIF-67 core/shell nanoparticle (NP) as a self-sacrificed template and mix with additional nitrogen/carbon sources to synthesize Co/N-doped porous carbon catalysts. The resulting catalysts not only show almost similar activity with commercial 20 wt% Pt/C for oxygen reduction reaction (ORR), but also exhibit comparable activity with IrO2 for oxygen evolution reaction (OER) in alkaline medium. We further use density functional theory to investigate ORR/OER mechanism of Co/N-doped carbon catalysts, and reveal that the highly efficient electrocatalysts can be designed rationally by using N-doped carbons to encapsulate electrophilic components, like metallic Co clusters. As a result, the catalyst-based Zn-air battery also shows a higher power density of ~185 mW cm-2 and a superior durability (30 h) than the Pt-IrO2 catalyst-based counterpart. This work provides an efficient core/shell template strategy for development of bifunctional catalysts for rechargeable Zn-air battery.