OpenWrt Forum Archive

Topic: iptables -m length what is wrong ?

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

iptables -I POSTROUTING -t mangle -o eth0 -p tcp -m length --length :64 -j MARK --set-mark 10
iptables v1.4.21: Couldn't load match `length':No such file or directory

lsmod:
act_ipt                 2432  0
act_mirred              2336  0
act_police              3168  0
act_skbedit             1600  0
cfg80211              217747  3 rt2x00lib
cls_basic               3024  0
cls_flow                5136  0
cls_fw                  3488  2
cls_route               4576  0
cls_tcindex             4256  0
cls_u32                 6256  0
compat                 10610  5 rt2800soc
compat_xtables           571  0
crc_ccitt               1019  2 ppp_async
crc_itu_t               1019  0
dwc2                   48407  1 dwc2_platform
dwc2_platform           1888  0
eeprom_93cx6            1807  1 rt2800pci
ehci_hcd               31516  1 ehci_platform
ehci_platform           3744  0
em_cmp                   800  0
em_meta                 4528  0
em_nbyte                 720  0
em_text                 1424  0
em_u32                   576  0
gpio_button_hotplug     6064  0
ip6_tables              9297  3 ip6table_raw
ip6t_REJECT             1184  2
ip6table_filter          608  1
ip6table_mangle         1120  1
ip6table_raw             576  1
ip_set                 21412 16 xt_set
ip_set_bitmap_ip        6768  0
ip_set_bitmap_ipmac     6544  0
ip_set_bitmap_port      6000  0
ip_set_hash_ip         17072  1
ip_set_hash_ipmark     17168  0
ip_set_hash_ipport     17728  0
ip_set_hash_ipportip   18528  0
ip_set_hash_ipportnet   23856  0
ip_set_hash_mac         8656  0
ip_set_hash_net        20896  0
ip_set_hash_netiface   22800  0
ip_set_hash_netnet     23856  0
ip_set_hash_netport    22544  0
ip_set_hash_netportnet   25008  0
ip_set_list_set         7376  0
ip_tables               9501  4 iptable_nat
ipt_ECN                 1392  0
ipt_MASQUERADE           656  1
ipt_REJECT               912  0
iptable_filter           672  1
iptable_mangle           928  1
iptable_nat              768  1
iptable_raw              640  1
leds_gpio               2896  0
mac80211              392704  5 rt2800lib
mt76pci                41582  0
nf_conntrack           47963 13 nf_nat_ipv4
nf_conntrack_ipv4       4720  2
nf_conntrack_ipv6       5024  3
nf_conntrack_rtcache    2448  0
nf_defrag_ipv4           806  1 nf_conntrack_ipv4
nf_defrag_ipv6          9031  1 nf_conntrack_ipv6
nf_log_common           2399  2 nf_log_ipv4
nf_log_ipv4             3280  0
nf_log_ipv6             3424  0
nf_nat                  9163  5 nf_nat_ipv4
nf_nat_ipv4             3761  1 iptable_nat
nf_nat_masquerade_ipv4    1420  1 ipt_MASQUERADE
nf_reject_ipv4          1795  1 ipt_REJECT
nf_reject_ipv6          2087  1 ip6t_REJECT
nfnetlink               4027  1 ip_set
nls_base                5008  1 usbcore
ohci_hcd               21951  1 ohci_platform
ohci_platform           3248  0
ppp_async               6352  0
ppp_generic            20690  3 pppoe
pppoe                   8144  0
pppox                   1354  1 pppoe
rt2800lib              91760  3 rt2800soc
rt2800mmio              6338  2 rt2800soc
rt2800pci               3968  0
rt2800soc               2496  0
rt2x00lib              34111  7 rt2800soc
rt2x00mmio              1904  3 rt2800soc
rt2x00pci               1506  1 rt2800pci
rt2x00soc               1202  1 rt2800soc
sch_codel               4112  0
sch_dsmark              3632  0
sch_fq                  5936  0
sch_gred                6384  0
sch_hfsc               13344  0
sch_htb                12576  1
sch_ingress              944  0
sch_pie                 4016  0
sch_prio                3232  0
sch_red                 4480  0
sch_sfq                 8176  3
sch_tbf                 5104  0
sch_teql                3696  0
slhc                    4395  1 ppp_generic
usb_common              1740  2 dwc2_platform
usbcore               117268  6 dwc2_platform
x_tables               10901 45 ipt_REJECT
xt_CLASSIFY              576  0
xt_CT                   2352  0
xt_DSCP                 1536  0
xt_HL                   1296  0
xt_LOG                   768  0
xt_NETMAP               1248  0
xt_REDIRECT             1152  0
xt_TCPMSS               2704  2
xt_comment               480 36
xt_connbytes            1520  0
xt_connlimit            3440  0
xt_connmark             1040  0
xt_conntrack            2144  4
xt_dscp                 1008  0
xt_ecn                  1296  0
xt_geoip                2896  0
xt_helper                880  0
xt_hl                    800  0
xt_id                    480  0
xt_length                704  0
xt_limit                 992 19
xt_mac                   624  0
xt_mark                  672  2
xt_multiport            1200  0
xt_nat                  1152  0
xt_recent               6432  0
xt_set                  5712  0
xt_state                 688  0
xt_statistic             784  0
xt_tcpmss               1040  0
xt_tcpudp               1760 15
xt_time                 1648  0

ls modules.d
20-cfg80211             50-mt76                 ipt-conntrack           lib-crc-ccitt           nfnetlink
20-eeprom-93cx6         50-usb-ohci             ipt-conntrack-extra     lib-crc-itu-t           ppp
20-usb-core             54-usb-dwc2             ipt-core                nf-conntrack            pppoe
30-gpio-button-hotplug  60-leds-gpio            ipt-geoip               nf-conntrack6           rt2800-pci
40-usb2                 70-sched-core           ipt-ipopt               nf-ipt                  rt2800-soc
42-ip6tables            73-sched                ipt-nat                 nf-ipt6                 rt2x00-pci
49-ipt-ipset            ipt-compat-xtables      ipt-nat-extra           nf-nat


This is CC, self-compiled from trunk.

opkg install iptables-mod-ipopt

"iptables extensions for matching/changing IP packet options. Matches: - dscp - ecn - length - mark - statistic - tcpmss - time - unclean - hl Targets: - DSCP - CLASSIFY - ECN - MARK - HL "

Thanx, thats what I guessed. However, my CC is self compiled, AND
40-usb2                 70-sched-core           ipt-ipopt               nf-ipt                  rt2800-soc
                                                                    ^^^^
I think, it is already included.
Although, I do not know where to find it in
make menuconfig :-)

My best guess is network -> ipfilter .

You might have the kernel-space module kmod-ipt-ipopt installed, but you also need user-space iptables extension iptables-mod-ipopt

You can search menuconfig with /
That helps finding packages

/ipopt reveals the path:

  │ Symbol: PACKAGE_iptables-mod-ipopt [=y]                                 │  
  │ Type  : tristate                                                        │  
  │ Prompt: iptables-mod-ipopt........................... IP/Packet option  │  
  │   Location:                                                             │  
  │     -> Network                                                          │  
  │       -> Firewall                                                       │  
  │ (1)     -> iptables................................. IP firewall admini │  
  │   Defined at tmp/.config-package.in:48201                               │  
  │   Depends on: PACKAGE_iptables [=y]                                     │  
  │   Selects: PACKAGE_libpthread [=y] && PACKAGE_libssp [=n] && PACKAGE_km │  
  │   Selected by: PACKAGE_qos-scripts [=n] || PACKAGE_sqm-scripts [=y] &&  │  
  │

(Last edited by hnyman on 8 Nov 2015, 22:59)

Yipphe, I got it !
hnyman, I owe you a beer !

hnyman wrote:

You might have the kernel-space module kmod-ipt-ipopt installed, but you also need user-space iptables extension iptables-mod-ipopt

You can search menuconfig with /
That helps finding packages

/ipopt reveals the path:

  │ Symbol: PACKAGE_iptables-mod-ipopt [=y]                                 │  
  │ Type  : tristate                                                        │  
  │ Prompt: iptables-mod-ipopt........................... IP/Packet option  │  
  │   Location:                                                             │  
  │     -> Network                                                          │  
  │       -> Firewall                                                       │  
  │ (1)     -> iptables................................. IP firewall admini │  
  │   Defined at tmp/.config-package.in:48201                               │  
  │   Depends on: PACKAGE_iptables [=y]                                     │  
  │   Selects: PACKAGE_libpthread [=y] && PACKAGE_libssp [=n] && PACKAGE_km │  
  │   Selected by: PACKAGE_qos-scripts [=n] || PACKAGE_sqm-scripts [=y] &&  │  
  │

thank u very much,the answer is very helpful

(Last edited by wifizoo on 23 Mar 2018, 14:57)

The discussion might have continued from here.