0

Since the OpenWRT ver > 22.3 does use NFTABLES instead of IPTABLES I got issue with some firewall (fw4) time based traffic rules that I have no idea how to solve them.

The firewall rule is as follows

config rule
   option name 'Block-Traffic'
   option src 'lan'
   option dest 'wan'
   option target 'DROP'
   option utc_time '1'
   list proto 'all'
   option start_date '2022-10-01'
   option stop_date '2022-10-02'
   option start_time '11:50:00'
   option stop_time '12:15:00'
   option enabled '1'

The problem is with the start_date and stop_date format, I have tried many date formats but I always get following error when I execute /etc/init.d/firewall reload command.

(Block-Traffic) option 'start_date' specifies invalid value '2022-10-02'

/dev/stdin:102:31-51: Error: Cannot parse date meta nfproto ipv4 meta time "2022-10-01 00:00:00"-"2022-10-02 00:00:00" meta hour "11:50:00"-"12:15:00" counter jump drop_to_wan comment "!fw4: Block-Traffic" ^^^^^^^^^^^^^^^^^^^^^

I am tired of trying differnt date formats, I would like to know if there is a bug with the fw4 or ipset or not. I have to overcome this annoying issue and any help is appreciated.

For your reference I am using OpenWRT snapshot mine is snapshot Powered by LuCI Master (git-22.208.55978-37422e8) with ipset installed

Sina S.
  • 11
  • 1
  • 2
  • Its likely openwrt bug nftables Matching by time https://wiki.nftables.org/wiki-nftables/index.php/Matching_packet_metainformation https://en.m.wikipedia.org/wiki/ISO_8601 – gapsf Aug 03 '22 at 05:39
  • Try to add T at the end of each date like option start_date '2022-10-01T' – gapsf Aug 03 '22 at 05:44
  • @gapsf I tried many of the ISO_8601 formats none of them worked, even adding T did not work too. – Sina S. Aug 03 '22 at 10:23
  • It's that I read on the forum not all features of fw3 are implemented in fw4 and as time control is not working ... From here https://forum.openwrt.org/t/time-control-firewall-rules-fw4/123454 – gapsf Aug 03 '22 at 13:59
  • I cant find anything about date issues. Post your issue here https://github.com/openwrt/openwrt/issues – gapsf Aug 03 '22 at 14:38

0 Answers0