Skip to content
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

iptables v1.8.9 (nf_tables): unknown option "--key" #18

Closed
Mincubus opened this issue Aug 15, 2023 · 11 comments
Closed

iptables v1.8.9 (nf_tables): unknown option "--key" #18

Mincubus opened this issue Aug 15, 2023 · 11 comments

Comments

@Mincubus
Copy link

Mincubus commented Aug 15, 2023

I did the commands as written, but an error appeared. Debian 12

@infinet
Copy link
Owner

infinet commented Aug 15, 2023

Has the kernel module been loaded? What is the output of lsmod | grep WGOBFS?

@lirigorm
Copy link

Hi, i use openwrt, but i have the same problem.
output of lsmod | grep WGOBFS:

x_tables 24576 15 nft_compat,iptable_mangle,iptable_filter,ipt_REJECT,ip_tables,xt_time,xt_tcpudp,xt_multiport,xt_mark,xt_mac,xt_limit,xt_comment,xt_WGOBFS,xt_TCPMSS,xt_LOG
xt_WGOBFS 12288 0

@romanrm
Copy link

romanrm commented Aug 15, 2023

It looks like you may have forgot to put libxt_WGOBFS.so into the correct place. On my system it is at /usr/lib/x86_64-linux-gnu/xtables/libxt_WGOBFS.so. Adjust for your distro accordingly. Easiest is to run "find / 2> /dev/null | grep libxt_" and that way to determine where other iptables libs live. This additional one needs to be at the same location. Except OpenWRT may have no "other" libs, so on that one try simply /usr/lib/.

@infinet
Copy link
Owner

infinet commented Aug 16, 2023

I agree with @romanrm, perhaps libxt_WGOBFS.so is missing. On Debian 12,
make install shall copy libxt_WGOBFS.so to the correct location. Also please make sure the kernel module is loaded.

On OpenWrt, the build generates two pakcages, kmod-ipt-wgobfs_xxx.ipk and iptables-mod-wgobfs_xxx.ipk. Double check both are installed. The latest OpenWrt I tested was 22.03.3.

@lirigorm
Copy link

lirigorm commented Aug 16, 2023

I'm sure the packages are installed.
opkg list-installed | grep wgobfs:

iptables-mod-wgobfs - 0.4.1-1
kmod-ipt-wgobfs - 5.15.118+0.4.1-1

I also searched *wgobfs* and found the following files in the system:

/usr/lib/iptables/libxt_WGOBFS.so
/usr/lib/opkg/info/kmod-ipt-wgobfs.control
/usr/lib/opkg/info/kmod-ipt-wgobfs.postinst
/usr/lib/opkg/info/kmod-ipt-wgobfs.prerm
/usr/lib/opkg/info/kmod-ipt-wgobfs.list
/usr/lib/opkg/info/iptables-mod-wgobfs.control
/usr/lib/opkg/info/iptables-mod-wgobfs.postinst
/usr/lib/opkg/info/iptables-mod-wgobfs.prerm
/usr/lib/opkg/info/iptables-mod-wgobfs.list
/sys/module/xt_WGOBFS
/sys/module/x_tables/holders/xt_WGOBFS
/lib/modules/5.15.118/xt_WGOBFS.ko
/etc/modules.d/ipt-wgobfs

After that i try to add iptables rule iptables -t mangle -I INPUT -p udp -m udp --dport 6789 -j WGOBFS --key mysecretkey --unobfs and got the following result:

iptables v1.8.8 (nf_tables): unknown option "--key"
Try `iptables -h' or 'iptables --help' for more information.

What is the problem?

I'm trying to run this on openwrt versions 23.05.0-rc1 and 23.05.0-rc2.

@infinet
Copy link
Owner

infinet commented Aug 18, 2023

Error messages such as unknown option "--key", unknown option "--obfs", unknown option "--unobfs" happens when the kernel module is not loaded, or libxt_WGOBFS.so is missing.

I've only tested it up to OpenWrt 22.03. If you're on 23.05 or later, I'm afraid I might not be able to help you directly.

@lirigorm
Copy link

lirigorm commented Aug 18, 2023

I tried it on openwrt version 22.03.5. Works. But how to make it work on version 23.05? I did everything the same as on 22.03.5, but it does not work.

@infinet
Copy link
Owner

infinet commented Aug 19, 2023

It may be related a bug that was fixed by #15. I have packaged a new version. Please try the latest openwrt/package/Makefile.

@lirigorm
Copy link

I tested the new version. It works on openwrt 23.05.

@infinet
Copy link
Owner

infinet commented Aug 20, 2023

Great! Glad it works. I am closing this issue.

@infinet infinet closed this as completed Aug 20, 2023
@lirigorm
Copy link

Thanks @infinet !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants