add new chinese translations

This commit is contained in:
2024-12-30 15:25:56 +08:00
parent a850046d7b
commit 0d798759fd
5418 changed files with 105800 additions and 7052 deletions

37
pages.zh/linux/nft.md Normal file
View File

@@ -0,0 +1,37 @@
# nft
> 允许配置由Linux内核防火墙提供的表、链和规则。
> Nftables替代了iptables。
> 更多信息:<https://wiki.nftables.org/wiki-nftables/index.php/Main_Page>。
- 查看当前配置:
`sudo nft list ruleset`
- 添加一个新的表,家庭为"inet",表名为"filter"
`sudo nft add table {{inet}} {{filter}}`
- 添加一个新的链以接受所有入站流量:
`sudo nft add chain {{inet}} {{filter}} {{input}} \{ type {{filter}} hook {{input}} priority {{0}} \; policy {{accept}} \; \}`
- 添加一条新规则以接受多个TCP端口
`sudo nft add rule {{inet}} {{filter}} {{input}} {{tcp}} {{dport \{ telnet, ssh, http, https \} accept}}`
- 添加一条NAT规则将所有来自`192.168.0.0/24`子网的流量转换为主机的公共IP
`sudo nft add rule {{nat}} {{postrouting}} ip saddr {{192.168.0.0/24}} {{masquerade}}`
- 显示规则句柄:
`sudo nft --handle --numeric list chain {{family}} {{table}} {{chain}}`
- 删除一条规则:
`sudo nft delete rule {{inet}} {{filter}} {{input}} handle {{3}}`
- 保存当前配置:
`sudo nft list ruleset > {{/etc/nftables.conf}}`