microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.52k stars 822 forks source link

iptables - unable to create rules on WSL2 (iptables "recent" module) #11140

Open sreemtech opened 9 months ago

sreemtech commented 9 months ago

Windows Version

10.0.22631.3007

WSL Version

WSL version: 2.0.9.0

Are you using WSL 1 or WSL 2?

Kernel Version

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64

Distro Version

CentOS

Other Software

WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3007

Rocky Linux 9.3

Repro Steps

WSL2 : Centos/Rocky Linux 9

iptables -A test0-in -p tcp --dport 1111 -m state --state NEW -m recent --set Warning: Extension recent revision 0 not supported, missing kernel module? iptables v1.8.8 (nf_tables): RULE_APPEND failed (No such file or directory): rule in chain

Expected Behavior

Rules has to set

Actual Behavior

Warning: Extension recent revision 0 not supported, missing kernel module? iptables v1.8.8 (nf_tables): RULE_APPEND failed (No such file or directory): rule in chain

Diagnostic Logs

No response

github-actions[bot] commented 9 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

elsaco commented 9 months ago

@sreemtech current WSL Linux kernel has CONFIG_NETFILTER_XT_MATCH_RECENT not set, so -m recent fails.

See details at: https://github.com/microsoft/WSL2-Linux-Kernel/blob/ee5b8e3dcbc682f7b3f149d90544b007c50d74f6/arch/x86/configs/config-wsl#L1172

or run zgrep -i netfilter /proc/config.gz to see what's set.