-
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
Command: " iptable -L " is not working #767
Comments
Thanks for reporting the issue. WSL does not currently support the kernel interfaces Linux iptables. Please give us feedback on the user voice page so we can prioritize the scenario - https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo. |
Here is the user voice page for supporting iptables, ifconfig and others! |
I think that WSL still need alot of work on network |
The original use voice page referred to in this post was for |
Just confirming this is still an issue. Edit: Have submitted it on Uservoice -> https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/32025199-support-iptables |
In FCU there is mostly stubbed iptables support (i.e. most things you try to do with it probably won't work). The problem with iptables -L is that it tries to open a RAW socket, which currently requires running elevated as well as root/sudo inside of WSL. socket(PF_INET, SOCK_RAW, IPPROTO_RAW) = -1 EPERM (Operation not permitted) |
To use iptables -L you need to run sudo and an elevated instance. We currently have support for portions of iptable, but not all option flags. Please upvote the user voice ask for additional iptable support. |
@tara-raj Could you list what iptable options are available? Looking forward to seeing it fully implemented! |
seems like --jump -j isn't working. root@LAPTOP-T8AF0OPL:~/compose# iptables --wait -t nat -I POSTROUTING -s 172.18.0.0/16 ! -o br-edc3bcc66c59 -j MASQUERADE
iptables: No chain/target/match by that name. |
@therealkenc Since native nmap now works, can you see if more iptables option flags work for you as well? |
Wouldn't help. Mucking with iptables (filter rules, nat, and the like) is very different surface than doing a port scan. |
docker service cant start in wsl, i dont know if or not this key to cause.here is my failed msg |
I have the same problem! |
/reopen |
is iptables ok now |
/reopen |
This suggests that you can get it working with an old version of docker (17.09): https://medium.com/faun/docker-running-seamlessly-in-windows-subsystem-linux-6ef8412377aa @leonardo-machado It's not actually helpful to comment just to say "me too" - instead, add a |
You can set in your
Then restart the service 👌 |
Funny, cause it definitely still doesn't work on Ubuntu 16.04 WSL2 date 3.25.2020. Could you please clarify how to fix this issue? |
The OP was:
On WSL2: This submission was tagged fixed-in-wsl2 because the OP fail no longer manifests in WSL2. If there are "aint working" scenarios, folks should feel encouraged to submit a new issue under a new cover, following the template (in particular copy-and-pasteable repro steps). Keep in mind that you are operating on a virtual network in a VM, which is not the same as operating on your Windows network. Because WSL2 is a Real Linux Kernel, identifying an actual diverge from Linux behavior might be more difficult than it appears. Or it might not, no prejudice. Bonne chance. |
Try you start the Ubuntu on Windows as Administrator. |
This is still an issue. does that mean that we cannot WSL? |
Still an issue in WSL2 - Ubuntu 20.04 LTS on Windows 10 2004 root@Rockheart:/home/# sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 |
@cypherstream - are you certain you are using WSL2? What is the output of uname -a? |
Well I upgraded to Win 10 Build 2004 which in the Windows 10 release notes state its WSL2. Then I enabled the Windows Subsystem for Linux and rebooted after it was done. Then in the Windows Store I installed Ubuntu 20.04 LTS. uname -a |
You also have to install the virtual machine platform feature for wsl2 |
Ah thanks, I was naive in thinking one of those big box sites like neowin, zdnet, etc.. that simply state WSL2 as a new bullet point under the whats new in Windows 10 2004 meant it was automatically updated. now uname -a sudo iptables -L Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) I can't wait for USB device support in the future to start building some software defined radio tools. |
I can not start the docker daemon. Because of the
|
I have the same issued and it's work for me on WSL 1, because when i using the WSL2, the IP address of the window and WSL is not the same and i can not connect through localhost or the localhost ip address. This work for me ♥ |
Still an issue in WSL2 - Ubuntu 16(or 18) on Windows 10. So dockerd failed to run. $ sudo iptables -L |
Please do the follow steps: 1.- Open a CMD console with administrator privileges (Very important) Done. |
Thank you so much |
I'm so grateful dude . Thanks a lot 😁! I spend much time trying to solve this problem. |
Any workaround to use docker on WSL2 without UAC Account ? |
--------------- I got it working by following in power shell
wsl --set-version Ubuntu-20.04 2 wsl -l -v
----------------- at this point, I start ubuntu 20.04 iptables -L is working for me now and so is dockerd. $ sudo iptables -L Chain FORWARD (policy ACCEPT) |
jlearman:system32$ service docker start (So I start docker daemon manually. That fails unless I disable iptables, which I need.) jlearman:~$ uname -a jlearman:~$ sudo iptables -L Chain FORWARD (policy ACCEPT) Chain OUTPUT (policy ACCEPT) Warning: iptables-legacy tables present, use iptables-legacy to see them |
launch ubuntu.exe as administrator. everything will work. |
I had the same issue(iptables not work) .and it is work when you launch ubuntu as administrator. |
yes this is still an issue with wsl even in Ubuntu 4.4.0-19041-Microsoft. |
I tried as admin but eventually used this:
|
Description/Terminal output & to replicate:
Next, I checked for iptable_nat:
Tried to depmod:
Windows build:
Microsoft Windows [Version 10.0.14393]
strace of failing command
The text was updated successfully, but these errors were encountered: