diff --git a/package/iptables/Makefile b/package/iptables/Makefile
index 67dedca38ffa5994a4da5eb2ad39dcc707d32dc1..b60990cabfcf1a9faa17941e2690398688298080 100644
--- a/package/iptables/Makefile
+++ b/package/iptables/Makefile
@@ -388,7 +388,7 @@ TARGET_CFLAGS += \
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-devel \
-	--enable-ipv6 \
+	$(if $(CONFIG_IPV6),--enable-ipv6,--disable-ipv6) \
 	--enable-libipq \
 	--with-kernel="$(LINUX_DIR)" \
 	--with-xtlibdir=/usr/lib/iptables