howto:network:nftables
Rozdíly
Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Obě strany předchozí revizePředchozí verzeNásledující verze | Předchozí verzePoslední revizeObě strany příští revize | ||
howto:network:nftables [2018/11/28 22:00] – harvie | howto:network:nftables [2018/11/28 22:41] – harvie | ||
---|---|---|---|
Řádek 3: | Řádek 3: | ||
===== Traffic Shaping with nftables and tc ===== | ===== Traffic Shaping with nftables and tc ===== | ||
- | This patch is already merged upstream: | + | Using shell commands: |
+ | |||
+ | <code bash> | ||
+ | nft add table ip filter | ||
+ | nft add map filter deucalion { type ipv4_addr : classid\; } | ||
+ | </ | ||
+ | |||
+ | Using nftables file: | ||
+ | |||
+ | <file ini deucalion.nft> | ||
+ | table ip filter { | ||
+ | map deucalion { | ||
+ | type ipv4_addr : classid; | ||
+ | elements = { 1.1.1.2 : 2:2222, 1.1.1.3 : 3:3333 } | ||
+ | } | ||
+ | |||
+ | |||
+ | chain input { | ||
+ | type filter hook input priority 0; policy accept; | ||
+ | meta priority set ip daddr map @deucalion; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Patch ==== | ||
+ | |||
+ | This patch is already merged upstream | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | |||
+ | You need it if nft shows this error: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | add map filter deucalion { type ipv4_addr : classid; } | ||
+ | ^^^^^^^ | ||
+ | < | ||
+ | add map filter deucalion { type ipv4_addr : classid; } | ||
+ | | ||
+ | </ | ||
<file diff nft-classid.patch> | <file diff nft-classid.patch> | ||
Řádek 32: | Řádek 69: | ||
| | ||
- | </ | ||
- | |||
- | <code bash> | ||
- | nft add map filter deucalion { type ipv4_addr : classid\; } | ||
- | </ | ||
- | |||
- | <file ini deucalion.nft> | ||
- | map deucalion { | ||
- | type ipv4_addr : classid; | ||
- | elements = { 1.1.1.2 : 2:2222, 1.1.1.3 : 3:3333 } | ||
- | } | ||
- | |||
- | |||
- | chain input { | ||
- | type filter hook input priority 0; policy accept; | ||
- | meta priority set ip daddr map @deucalion; | ||
- | } | ||
</ | </ |
howto/network/nftables.txt · Poslední úprava: 2018/11/28 23:08 autor: harvie