-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding nftables sets doesn't work on WSL 2 #6044
Comments
I also have the same issue. Environment |
Is this being addressed? I can't run native docker without reverting back to legacy iptables, which I can imagine is not going to be around forever. What is a longer-term path to run native docker? Ticket 6655, which was closed as a dup of this, describes the symptoms/effect very well. |
ping for this. |
I have the same issue with Jammy |
I am facing same issue in ubuntu-22.04 Jammy release. Docker does not start here, due to below error. failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add |
@panktrip I had to do something similar to what was referenced in another ticket.
|
Thanks a lot @kobenauf . This worked for me on Ubuntu-22.04 in WSL2. |
If you are running into this problem from an RPM-based distribution, many of the fixes given may not work for you. Specifically, I ran into this issue using the AlmaLinux-8 distro running under distrod (to enable the use of systemd). I originally went down the path of trying to find and install the legacy version of iptables (xtables-legacy-multi) to use the same fix mentioned above; however, after spending many hours in (unsuccessfully) trying to find that package in non-Fedora yum repositories, I pivoted to fixing the issue in the kernel instead. As referenced by @therealkenc, the issue of supporting the newer, nftables-based iptables is that the proper interfaces are not available in the standard WSL kernel; however, the interfaces exist in the code - they just need to be configured on / compiled in. Here is how I went about fixing the issue in AlmaLinux-8 (under distrod) starting from a fresh install:
At this point, if you performed the optional step to give a custom kernel postfix, you can run I realize this is a heavy-handed approach, but I hope it can help any folks using an RPM-based distribution until the problem is officially addressed either by docker or by the WSL standard kernel. Secondly, I realize that RPM-based distributions have moved towards the use of podman, but I have seen reports of similar issues with iptables, especially when using |
This worked for me running Rocky Linux in WSL2. Can't thank you enough, it's been causing me so many issues! |
This does not really solved the problem. Even though you get a pass for matching comment here, you may still hit error when matching conntrack |
I can confirm this fixes similar issues with podman, where port forwarding was essentially broken, in WSL2, Oracle Linux. Thanks ever so much 🙏 Would be great to have this fixed in the default kernel though! |
Docker and WSL2 : Rocky Linux 9 Any Advise please ? |
When activating nftables on NixOS I got a diff --git a/arch/x86/configs/config-wsl b/arch/x86/configs/config-wsl
index 51935f9f2..365529760 100644
--- a/arch/x86/configs/config-wsl
+++ b/arch/x86/configs/config-wsl
@@ -1066,7 +1069,7 @@ CONFIG_NF_NAT_MASQUERADE=y
CONFIG_NETFILTER_SYNPROXY=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
-# CONFIG_NF_TABLES_NETDEV is not set
+CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=y
CONFIG_NFT_CT=y
CONFIG_NFT_COUNTER=y
@@ -1084,11 +1087,18 @@ CONFIG_NFT_REJECT=y
CONFIG_NFT_REJECT_INET=y
CONFIG_NFT_COMPAT=y
# CONFIG_NFT_HASH is not set
+CONFIG_NFT_FIB=y
+CONFIG_NFT_FIB_INET=y
CONFIG_NFT_XFRM=y
CONFIG_NFT_SOCKET=y
# CONFIG_NFT_OSF is not set
# CONFIG_NFT_TPROXY is not set
# CONFIG_NFT_SYNPROXY is not set
+# CONFIG_NF_DUP_NETDEV is not set
+# CONFIG_NFT_DUP_NETDEV is not set
+# CONFIG_NFT_FWD_NETDEV is not set
+CONFIG_NFT_FIB_NETDEV=y
+# CONFIG_NFT_REJECT_NETDEV is not set
# CONFIG_NF_FLOW_TABLE is not set
CONFIG_NETFILTER_XTABLES=y
# CONFIG_NETFILTER_XTABLES_COMPAT is not set
@@ -1256,7 +1266,7 @@ CONFIG_NF_SOCKET_IPV4=y
CONFIG_NF_TABLES_IPV4=y
CONFIG_NFT_REJECT_IPV4=y
# CONFIG_NFT_DUP_IPV4 is not set
-# CONFIG_NFT_FIB_IPV4 is not set
+CONFIG_NFT_FIB_IPV4=y
# CONFIG_NF_TABLES_ARP is not set
# CONFIG_NF_DUP_IPV4 is not set
# CONFIG_NF_LOG_ARP is not set
@@ -1295,7 +1305,7 @@ CONFIG_NF_SOCKET_IPV6=y
CONFIG_NF_TABLES_IPV6=y
CONFIG_NFT_REJECT_IPV6=y
# CONFIG_NFT_DUP_IPV6 is not set
-# CONFIG_NFT_FIB_IPV6 is not set
+CONFIG_NFT_FIB_IPV6=y
# CONFIG_NF_DUP_IPV6 is not set
CONFIG_NF_REJECT_IPV6=y
CONFIG_NF_LOG_IPV6=y |
Environment
Microsoft Windows [Version 10.0.19041.508]
Ubuntu 20.04
WSL 2
Steps to reproduce
After installing nftables (my version from repo: 0.9.3) and trying to configure named set in specified table - i'm getting an error.
Expected behavior
The set must be created and displayed in listing (nft list ruleset)
Actual behavior
I got the following error: "Could not process rule: Operation not supported"
The text was updated successfully, but these errors were encountered: