diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index c925a5868c0424d3591e26b1a77058b5dca8b7a2..3b93e4e158e3e15778c9a0dddc45f156e5fa8cea 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -884,6 +884,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 		bd->bi_ethspeed = 0xFFFF;
 #endif
 
+#ifdef CONFIG_CMD_NET
 	/* kept around for legacy kernels only ... ignore the next section */
 	eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr);
 #ifdef CONFIG_HAS_ETH1
@@ -901,6 +902,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #ifdef CONFIG_HAS_ETH5
 	eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr);
 #endif
+#endif /* CONFIG_CMD_NET */
 
 	/* IP Address */
 	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");