Jump to content
  • 0

iptables: No chain/target/match by that name.


Question

Posted

Добрый день,

у меня Keenetic Ultra (OS 3.4.6)

на команды iptables для добавления записи в журнал вида

iptables -w -t filter -I INPUT 2 -j LOG

iptables -w -t filter -I INPUT 2 -j ULOG

ругается: iptables: No chain/target/match by that name.

Я понимаю так, что у меня не хватает нужного модуля ядра.

Если запустить ls | grep ipt_ в папке /lib/modules/4.9-ndm-4 - получаем только 2 доступных модуля:

root@Keenetic_Ultra:/lib/modules/4.9-ndm-4# ls | grep ipt_
ipt_ECN.ko
ipt_ah.ko

 

Кто может подсказать, что необходимо чтобы LOG или ULOG в iptables получилось добавить?

Заранее благодарю.

 

7 answers to this question

Recommended Posts

  • 0
Posted (edited)
BusyBox v1.31.1 () built-in shell (ash)

~ # ls -1 /lib/modules/4.9-ndm-4/xt*
/lib/modules/4.9-ndm-4/xt_ACCOUNT.ko
/lib/modules/4.9-ndm-4/xt_CHAOS.ko
/lib/modules/4.9-ndm-4/xt_CLASSIFY.ko
/lib/modules/4.9-ndm-4/xt_CT.ko
/lib/modules/4.9-ndm-4/xt_DELUDE.ko
/lib/modules/4.9-ndm-4/xt_DHCPMAC.ko
/lib/modules/4.9-ndm-4/xt_DNETMAP.ko
/lib/modules/4.9-ndm-4/xt_IPMARK.ko
/lib/modules/4.9-ndm-4/xt_LOGMARK.ko
/lib/modules/4.9-ndm-4/xt_NETMAP.ko
/lib/modules/4.9-ndm-4/xt_NFLOG.ko
/lib/modules/4.9-ndm-4/xt_NFQUEUE.ko
/lib/modules/4.9-ndm-4/xt_SYSRQ.ko
/lib/modules/4.9-ndm-4/xt_TARPIT.ko
/lib/modules/4.9-ndm-4/xt_TEE.ko
/lib/modules/4.9-ndm-4/xt_TPROXY.ko
/lib/modules/4.9-ndm-4/xt_addrtype.ko
/lib/modules/4.9-ndm-4/xt_comment.ko
/lib/modules/4.9-ndm-4/xt_condition.ko
/lib/modules/4.9-ndm-4/xt_connbytes.ko
/lib/modules/4.9-ndm-4/xt_connlimit.ko
/lib/modules/4.9-ndm-4/xt_dscp.ko
/lib/modules/4.9-ndm-4/xt_ecn.ko
/lib/modules/4.9-ndm-4/xt_esp.ko
/lib/modules/4.9-ndm-4/xt_fuzzy.ko
/lib/modules/4.9-ndm-4/xt_geoip.ko
/lib/modules/4.9-ndm-4/xt_hashlimit.ko
/lib/modules/4.9-ndm-4/xt_hl.ko
/lib/modules/4.9-ndm-4/xt_iface.ko
/lib/modules/4.9-ndm-4/xt_ipp2p.ko
/lib/modules/4.9-ndm-4/xt_iprange.ko
/lib/modules/4.9-ndm-4/xt_ipv4options.ko
/lib/modules/4.9-ndm-4/xt_length2.ko
/lib/modules/4.9-ndm-4/xt_lscan.ko
/lib/modules/4.9-ndm-4/xt_mac.ko
/lib/modules/4.9-ndm-4/xt_multiport.ko
/lib/modules/4.9-ndm-4/xt_owner.ko
/lib/modules/4.9-ndm-4/xt_policy.ko
/lib/modules/4.9-ndm-4/xt_psd.ko
/lib/modules/4.9-ndm-4/xt_quota.ko
/lib/modules/4.9-ndm-4/xt_quota2.ko
/lib/modules/4.9-ndm-4/xt_recent.ko
/lib/modules/4.9-ndm-4/xt_socket.ko
/lib/modules/4.9-ndm-4/xt_statistic.ko
/lib/modules/4.9-ndm-4/xt_string.ko
/lib/modules/4.9-ndm-4/xt_time.ko
/lib/modules/4.9-ndm-4/xt_u32.ko

---

https://forum.keenetic.net/topic/5396-не-работает-j-log-в-iptables/

 

 

Edited by TheBB
add
  • 0
Posted

TheBB, спасибо.

после команды: 

ls -1 /lib/modules/4.9-ndm-4/xt*

у меня список библиотек точно такой же как у вас, но iptables все равно ругается  iptables: No chain/target/match by that name.  на действие -j ULOG в правилах типа iptables -w -t filter -I INPUT 2 -j ULOG.

 

Есть еще 3 вопроса:

1. Правильно я понимаю, что на роутере Ultra (KN-1810) в текущей версии ОС 3.5.6  в правилах iptables действия - j LOG и -j ULOG более не поддерживаются, а использовать надо действие -j NFLOG (/lib/modules/4.9-ndm-4/xt_NFLOG.ko)?

2. Правильно я понимаю, что чтобы обрабатывать вывод действий iptables -j NFLOG нужно использовать:

3. при попытке установки 

opkg install http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk

получаю:

Downloading http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Unknown package 'ulogd-mod-nflog'.
Collected errors:
 * pkg_hash_fetch_best_installation_candidate: Packages for ulogd-mod-nflog found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package ulogd-mod-nflog.

и, похоже, проблема не в нем самом (он для правильной архитектуры mipsel-3.4), а в dependency: libnetfilter_log, которую для mipsel-3.4 негде взять в виде ipk.

Как подскажете поступить?

заранее благодарю.

p.s. С Новым Годом! Здоровья, всяческих успехов!

 

Александр

  • 0
Posted

1. угу, перед этим ядерный модуль загружать

2. нет, если не хотите логировать

3. пересобрал, залил

~ # iptables -L -t filter | grep LOG
~ # 
~ # iptables -w -t filter -I INPUT 2 -j NFLOG
iptables: No chain/target/match by that name.
~ # 
~ # lsmod | grep LOG
~ # 
~ # insmod /lib/modules/4.9-ndm-4/xt_NFLOG.ko 
~ # 
~ # lsmod | grep LOG
xt_NFLOG 720 0 - Live 0x877f5000
nfnetlink_log 6322 1 xt_NFLOG, Live 0x872da000
~ # 
~ # iptables -w -t filter -I INPUT 2 -j NFLOG
~ # 
~ # iptables -L -t filter | grep LOG
NFLOG      all  --  anywhere             anywhere            
~ #

 

  • 0
Posted

Спасибо TheBB, вижу, что обновленные ipk датированы сегодняшним днем.

НО, при установке обновленного ipk 

opkg install http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk

Та же самая проблема. Боюсь, что ничего не поменялось

 

Downloading http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Unknown package 'ulogd-mod-nflog'.
Collected errors:
 * pkg_hash_fetch_best_installation_candidate: Packages for ulogd-mod-nflog found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package ulogd-mod-nflog.
 

С уважением, Александр

  • 0
Posted

т.к. индекс отсутствует для тестовых пакетов, всё ставится руками, в том числе и зависимости

~ # opkg install http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Downloading http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Unknown package 'ulogd-mod-nflog'.
Collected errors:
 * pkg_hash_fetch_best_installation_candidate: Packages for ulogd-mod-nflog found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package ulogd-mod-nflog.
~ # 
~ # opkg install http://bin.entware.net/mipselsf-k3.4/test/libnetfilter-log_1.0.1-3_mipsel-3.4.ipk
Downloading http://bin.entware.net/mipselsf-k3.4/test/libnetfilter-log_1.0.1-3_mipsel-3.4.ipk
Installing libnetfilter-log (1.0.1-3) to root...
Installing libnfnetlink (1.0.1-3) to root...
Downloading http://bin.entware.net/mipselsf-k3.4/libnfnetlink_1.0.1-3_mipsel-3.4.ipk
Installing libmnl (1.0.4-2) to root...
Downloading http://bin.entware.net/mipselsf-k3.4/libmnl_1.0.4-2_mipsel-3.4.ipk
Configuring libmnl.
Configuring libnfnetlink.
Configuring libnetfilter-log.
~ # opkg install http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Downloading http://bin.entware.net/mipselsf-k3.4/test/ulogd-mod-nflog_2.0.7-9999_mipsel-3.4.ipk
Installing ulogd-mod-nflog (2.0.7-9999) to root...
Installing ulogd (2.0.7-6) to root...
Downloading http://bin.entware.net/mipselsf-k3.4/ulogd_2.0.7-6_mipsel-3.4.ipk
Configuring ulogd.
Configuring ulogd-mod-nflog.
~ # 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies. By clicking "I accept" or continuing to browse the site, you authorize their use in accordance with the Privacy Policy.