<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-1x.git/data/templates/firewall/nftables-offload.j2, branch feature/T9082-codeql-cpp</title>
<subtitle>VyOS command definitions, scripts, and utilities (mirror of https://github.com/vyos/vyos-1x.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-1x.git/atom?h=feature%2FT9082-codeql-cpp</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-1x.git/atom?h=feature%2FT9082-codeql-cpp'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-1x.git/'/>
<updated>2023-09-19T11:08:20+00:00</updated>
<entry>
<title>firewall: T4502: Update to flowtable CLI</title>
<updated>2023-09-19T11:08:20+00:00</updated>
<author>
<name>sarthurdev</name>
<email>965089+sarthurdev@users.noreply.github.com</email>
</author>
<published>2023-09-15T16:31:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-1x.git/commit/?id=41133869c50cd691735a141722dbca72827191e5'/>
<id>urn:sha1:41133869c50cd691735a141722dbca72827191e5</id>
<content type='text'>
`set firewall flowtable &lt;name&gt; interface &lt;ifname&gt;`
`set firewall flowtable &lt;name&gt; offload [software|hardware]`

`set firewall [ipv4|ipv6] forward filter rule N action offload`
`set firewall [ipv4|ipv6] forward filter rule N offload-target &lt;name&gt;`
</content>
</entry>
<entry>
<title>T4502: firewall: Add software flow offload using flowtable</title>
<updated>2023-09-09T08:16:04+00:00</updated>
<author>
<name>Yuxiang Zhu</name>
<email>vfreex@gmail.com</email>
</author>
<published>2023-08-26T05:28:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-1x.git/commit/?id=f909c17aca4d48598d5eaee0df81bf64967902f0'/>
<id>urn:sha1:f909c17aca4d48598d5eaee0df81bf64967902f0</id>
<content type='text'>
The following commands will enable nftables flowtable offload on interfaces eth0 eth1:

```
set firewall global-options flow-offload software interface &lt;name&gt;
set firewall global-options flow-offload hardware interface &lt;name&gt;
```

Generated nftables rules:

```
table inet vyos_offload {
    flowtable VYOS_FLOWTABLE_software {
        hook ingress priority filter - 1; devices = { eth0, eth1, eth2, eth3 };
        counter
    }

    chain VYOS_OFFLOAD_software {
        type filter hook forward priority filter - 1; policy accept;
        ct state { established, related } meta l4proto { tcp, udp } flow add @VYOS_FLOWTABLE_software
    }
}
```

Use this option to count packets and bytes for each offloaded flow:
```
set system conntrack flow-accounting
```

To verify a connection is offloaded, run

```
cat /proc/net/nf_conntrack|grep OFFLOAD
```

This PR follows firewalld's implementation: https://github.com/firewalld/firewalld/blob/e748b97787d685d0ca93f58e8d4292e87d3f0da6/src/firewall/core/nftables.py#L590

A good introduction to nftables flowtable: https://thermalcircle.de/doku.php?id=blog:linux:flowtables_1_a_netfilter_nftables_fastpath
</content>
</entry>
</feed>
