[FS#4239] flow_offloading_hw doesn't work with nftables (mt7621)

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Mon Feb 7 09:56:12 PST 2022


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#4239 - flow_offloading_hw doesn't work with nftables (mt7621)
User who did this - tiagogaspar8 (tiagogaspar8)

----------
Here it is  (with hw offloading enabled):
root at router1:~# opkg list-installed firewall4
firewall4 - 2022-02-07-b54f4622-1
root at router1:~# opkg list-installed netifd
netifd - 2022-02-04-fd4c9e17-1
root at router1:~# uci show firewall
firewall. at defaults[0]=defaults
firewall. at defaults[0].input='ACCEPT'
firewall. at defaults[0].output='ACCEPT'
firewall. at defaults[0].forward='REJECT'
firewall. at defaults[0].synflood_protect='1'
firewall. at defaults[0].flow_offloading='1'
firewall. at defaults[0].flow_offloading_hw='1'
firewall. at zone[0]=zone
firewall. at zone[0].name='lan'
firewall. at zone[0].network='lan'
firewall. at zone[0].input='ACCEPT'
firewall. at zone[0].output='ACCEPT'
firewall. at zone[0].forward='ACCEPT'
firewall. at zone[1]=zone
firewall. at zone[1].name='wan'
firewall. at zone[1].network='wan' 'wan6'
firewall. at zone[1].input='REJECT'
firewall. at zone[1].output='ACCEPT'
firewall. at zone[1].forward='REJECT'
firewall. at zone[1].masq='1'
firewall. at zone[1].mtu_fix='1'
firewall. at forwarding[0]=forwarding
firewall. at forwarding[0].src='lan'
firewall. at forwarding[0].dest='wan'
firewall. at rule[0]=rule
firewall. at rule[0].name='Allow-DHCP-Renew'
firewall. at rule[0].src='wan'
firewall. at rule[0].proto='udp'
firewall. at rule[0].dest_port='68'
firewall. at rule[0].target='ACCEPT'
firewall. at rule[0].family='ipv4'
firewall. at rule[1]=rule
firewall. at rule[1].name='Allow-Ping'
firewall. at rule[1].src='wan'
firewall. at rule[1].proto='icmp'
firewall. at rule[1].icmp_type='echo-request'
firewall. at rule[1].family='ipv4'
firewall. at rule[1].target='ACCEPT'
firewall. at rule[2]=rule
firewall. at rule[2].name='Allow-IGMP'
firewall. at rule[2].src='wan'
firewall. at rule[2].proto='igmp'
firewall. at rule[2].family='ipv4'
firewall. at rule[2].target='ACCEPT'
firewall. at rule[3]=rule
firewall. at rule[3].name='Allow-DHCPv6'
firewall. at rule[3].src='wan'
firewall. at rule[3].proto='udp'
firewall. at rule[3].src_ip='fc00::/6'
firewall. at rule[3].dest_ip='fc00::/6'
firewall. at rule[3].dest_port='546'
firewall. at rule[3].family='ipv6'
firewall. at rule[3].target='ACCEPT'
firewall. at rule[4]=rule
firewall. at rule[4].name='Allow-MLD'
firewall. at rule[4].src='wan'
firewall. at rule[4].proto='icmp'
firewall. at rule[4].src_ip='fe80::/10'
firewall. at rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall. at rule[4].family='ipv6'
firewall. at rule[4].target='ACCEPT'
firewall. at rule[5]=rule
firewall. at rule[5].name='Allow-ICMPv6-Input'
firewall. at rule[5].src='wan'
firewall. at rule[5].proto='icmp'
firewall. at rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall. at rule[5].limit='1000/sec'
firewall. at rule[5].family='ipv6'
firewall. at rule[5].target='ACCEPT'
firewall. at rule[6]=rule
firewall. at rule[6].name='Allow-ICMPv6-Forward'
firewall. at rule[6].src='wan'
firewall. at rule[6].dest='*'
firewall. at rule[6].proto='icmp'
firewall. at rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall. at rule[6].limit='1000/sec'
firewall. at rule[6].family='ipv6'
firewall. at rule[6].target='ACCEPT'
firewall. at rule[7]=rule
firewall. at rule[7].name='Allow-IPSec-ESP'
firewall. at rule[7].src='wan'
firewall. at rule[7].dest='lan'
firewall. at rule[7].proto='esp'
firewall. at rule[7].target='ACCEPT'
firewall. at rule[8]=rule
firewall. at rule[8].name='Allow-ISAKMP'
firewall. at rule[8].src='wan'
firewall. at rule[8].dest='lan'
firewall. at rule[8].dest_port='500'
firewall. at rule[8].proto='udp'
firewall. at rule[8].target='ACCEPT'
firewall. at rule[9]=rule
firewall. at rule[9].name='Support-UDP-Traceroute'
firewall. at rule[9].src='wan'
firewall. at rule[9].dest_port='33434:33689'
firewall. at rule[9].proto='udp'
firewall. at rule[9].family='ipv4'
firewall. at rule[9].target='REJECT'
firewall. at rule[9].enabled='false'
firewall. at include[0]=include
firewall. at include[0].path='/etc/firewall.user'
firewall.miniupnpd=include
firewall.miniupnpd.type='script'
firewall.miniupnpd.path='/usr/share/miniupnpd/firewall.include'
firewall.miniupnpd.family='any'
firewall.miniupnpd.reload='1'
root at router1:~# fw4 flush
root at router1:~# fw4 start
Section @rule[9] (Support-UDP-Traceroute) is disabled, ignoring section
/proc/self/fd/0:9:12-13: Error: Could not process rule: Not supported

/proc/self/fd/0:54:29-44: Error: Could not process rule: No such file or directory

root at router1:~# fw4 print
Section @rule[9] (Support-UDP-Traceroute) is disabled, ignoring section
table inet fw4
flush table inet fw4

table inet fw4 {
        #
        # Flowtable
        #

        flowtable ft {
                hook ingress priority 0;
                devices = { "lan4", "lan2", "lan3", "lan1", "wan" };
                flags offload;
        }

        #
        # Set definitions
        #


        #
        # Defines
        #

        define lan_devices = { "br-lan" }
        define lan_subnets = { 192.168.1.0/24, 2001:8a0:6ecf:f700::/60, fd16:bed2:31b3::/60 }
        define wan_devices = { "wan" }
        define wan_subnets = { 176.78.6.0/24 }

        #
        # User includes
        #

        include "/etc/nftables.d/*.nft"


        #
        # Filter rules
        #

        chain input {
                type filter hook input priority filter; policy accept;

                iifname "lo" accept comment "!fw4: Accept traffic from loopback"

                ct state established,related accept comment "!fw4: Allow inbound established and related flows"
                tcp flags & (fin | syn | rst | ack) == syn jump syn_flood comment "!fw4: Rate limit TCP syn packets"
                iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
                iifname "wan" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
        }

        chain forward {
                type filter hook forward priority filter; policy drop;

                meta l4proto { tcp, udp } flow offload @ft;
                ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
                iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
                iifname "wan" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
                jump handle_reject
        }

        chain output {
                type filter hook output priority filter; policy accept;

                oifname "lo" accept comment "!fw4: Accept traffic towards loopback"

                ct state established,related accept comment "!fw4: Allow outbound established and related flows"
                oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
                oifname "wan" jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic"
        }

        chain handle_reject {
                meta l4proto tcp reject with tcp reset comment "!fw4: Reject TCP traffic"
                reject with icmpx type port-unreachable comment "!fw4: Reject any other traffic"
        }

        chain syn_flood {
                limit rate 25/second burst 50 packets return comment "!fw4: Accept SYN packets below rate-limit"
                drop comment "!fw4: Drop excess packets"
        }

        chain input_lan {
                jump accept_from_lan
        }

        chain output_lan {
                jump accept_to_lan
        }

        chain forward_lan {
                jump accept_to_wan comment "!fw4: Accept lan to wan forwarding"
                jump accept_to_lan
        }

        chain accept_from_lan {
                iifname "br-lan" counter accept comment "!fw4: accept lan IPv4/IPv6 traffic"
        }

        chain accept_to_lan {
                oifname "br-lan" counter accept comment "!fw4: accept lan IPv4/IPv6 traffic"
        }

        chain input_wan {
                meta nfproto ipv4 meta l4proto igmp counter accept comment "!fw4: ubus:omcproxy[instance1] rule 0"
                ip6 saddr fe80::/10 icmpv6 type . icmpv6 code { 130 . 0, 131 . 0, 132 . 0, 143 . 0 } counter accept comment "!fw4: ubus:omcproxy[instance1] rule 1"
                meta nfproto ipv4 udp dport 68 counter accept comment "!fw4: Allow-DHCP-Renew"
                meta nfproto ipv4 icmp type 8 counter accept comment "!fw4: Allow-Ping"
                meta nfproto ipv4 meta l4proto igmp counter accept comment "!fw4: Allow-IGMP"
                ip6 saddr fc00::/6 ip6 daddr fc00::/6 udp dport 546 counter accept comment "!fw4: Allow-DHCPv6"
                ip6 saddr fe80::/10 icmpv6 type . icmpv6 code { 130 . 0, 131 . 0, 132 . 0, 143 . 0 } counter accept comment "!fw4: Allow-MLD"
                meta nfproto ipv6 icmpv6 type { 128, 129, 1, 3, 133, 134 } limit rate 1000/second counter accept comment "!fw4: Allow-ICMPv6-Input"
                meta nfproto ipv6 icmpv6 type . icmpv6 code { 2 . 0, 4 . 0, 4 . 1, 135 . 0, 136 . 0 } limit rate 1000/second counter accept comment "!fw4: Allow-ICMPv6-Input"
                jump reject_from_wan
        }

        chain output_wan {
                jump accept_to_wan
        }

        chain forward_wan {
                meta l4proto udp ip daddr 224.0.0.0/4 counter jump accept_to_lan comment "!fw4: ubus:omcproxy[instance1] rule 2"
                meta l4proto udp ip6 daddr ff00::/8 counter jump accept_to_lan comment "!fw4: ubus:omcproxy[instance1] rule 3"
                meta nfproto ipv6 icmpv6 type { 128, 129, 1, 3 } limit rate 1000/second counter accept comment "!fw4: Allow-ICMPv6-Forward"
                meta nfproto ipv6 icmpv6 type . icmpv6 code { 2 . 0, 4 . 0, 4 . 1 } limit rate 1000/second counter accept comment "!fw4: Allow-ICMPv6-Forward"
                meta l4proto esp counter jump accept_to_lan comment "!fw4: Allow-IPSec-ESP"
                udp dport 500 counter jump accept_to_lan comment "!fw4: Allow-ISAKMP"
                jump reject_to_wan
        }

        chain accept_to_wan {
                oifname "wan" counter accept comment "!fw4: accept wan IPv4/IPv6 traffic"
        }

        chain reject_from_wan {
                iifname "wan" counter jump handle_reject comment "!fw4: reject wan IPv4/IPv6 traffic"
        }

        chain reject_to_wan {
                oifname "wan" counter jump handle_reject comment "!fw4: reject wan IPv4/IPv6 traffic"
        }


        #
        # NAT rules
        #

        chain dstnat {
                type nat hook prerouting priority dstnat; policy accept;
        }

        chain srcnat {
                type nat hook postrouting priority srcnat; policy accept;
                oifname "wan" jump srcnat_wan comment "!fw4: Handle wan IPv4/IPv6 srcnat traffic"
        }

        chain srcnat_wan {
                meta nfproto ipv4 masquerade comment "!fw4: Masquerade IPv4 wan traffic"
        }


        #
        # Raw rules (notrack & helper)
        #

        chain raw_prerouting {
                type filter hook prerouting priority raw; policy accept;
                iifname "br-lan" jump helper_lan comment "!fw4: lan IPv4/IPv6 CT helper assignment"
        }

        chain raw_output {
                type filter hook output priority raw; policy accept;
        }

        chain helper_lan {
        }


        #
        # Mangle rules
        #

        chain mangle_prerouting {
                type filter hook prerouting priority mangle; policy accept;
        }

        chain mangle_postrouting {
                type filter hook postrouting priority mangle; policy accept;
        }

        chain mangle_input {
                type filter hook input priority mangle; policy accept;
        }

        chain mangle_output {
                type filter hook output priority mangle; policy accept;
        }

        chain mangle_forward {
                type filter hook forward priority mangle; policy accept;
                iifname "wan" tcp flags syn tcp option maxseg size set rt mtu comment "!fw4: Zone wan IPv4/IPv6 ingress MTU fixing"
                oifname "wan" tcp flags syn tcp option maxseg size set rt mtu comment "!fw4: Zone wan IPv4/IPv6 egress MTU fixing"
        }
}
root at router1:~# 

----------

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=4239#comment10525

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list