Red Hat Training
A Red Hat training course is available for RHEL 8
47.2.5. 在 nftables 脚本中包含文件
在 nftables
脚本环境中,您可以使用 include
语句包含其他脚本。
如果您只指定没有绝对或相对路径的文件名,nftables
包含了默认搜索路径(设置为 Red Hat Enterprise Linux 上的 /etc
)。
例 47.2. 包含默认搜索目录中的文件
从默认搜索目录中包含一个文件:
include "example.nft"
例 47.3. 包含目录中的所有 *.nft 文件
要包括以 *.nft
结尾的所有文件,它们存储在 /etc/nftables/rulesets/
目录中:
include "/etc/nftables/rulesets/*.nft"
请注意,include
语句不匹配以点开头的文件。
其他资源
-
nft(8)
手册页中的Include files
部分