diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index cf45fe21f..66e2d516e 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -10,7 +10,7 @@ embassy = { version = "0.1.0", path = "../embassy" }
 embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["stm32"] }
 embassy-extras = {version = "0.1.0", path = "../embassy-extras" }
 embassy-traits = {version = "0.1.0", path = "../embassy-traits" }
-embassy-net = { version = "0.1.0", path = "../embassy-net", features = ["tcp", "medium-ip"] }
+embassy-net = { version = "0.1.0", path = "../embassy-net", features = ["tcp", "medium-ethernet"], optional = true }
 
 defmt = { version = "0.2.0", optional = true }
 log = { version = "0.4.11", optional = true }
@@ -41,6 +41,7 @@ defmt-info = [ ]
 defmt-warn = [ ]
 defmt-error = [ ]
 sdmmc-rs = ["embedded-sdmmc"]
+net = ["embassy-net"]
 
 # BEGIN GENERATED FEATURES
 # Generated by gen_features.py. DO NOT EDIT.
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index b99751e6d..39ccd54f0 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -29,7 +29,7 @@ pub mod clock;
 pub mod dac;
 #[cfg(dma)]
 pub mod dma;
-#[cfg(eth)]
+#[cfg(all(eth, feature = "net"))]
 pub mod eth;
 #[cfg(i2c)]
 pub mod i2c;