一行でどうすればいいですか?
tcp dport 53 counter accept comment "accept DNS"
udp dport 53 counter accept comment "accept DNS"
ベストアンサー1
十分に新しい場合は、次のようにnftables
書くことができます。
meta l4proto {tcp, udp} th dport 53 counter accept comment "accept DNS"
実際、次のようにすればもっとうまくいくことができます。
set okports {
type inet_proto . inet_service
counter
elements = {
tcp . 22, # SSH
tcp . 53, # DNS (TCP)
udp . 53 # DNS (UDP)
}
それから:
meta l4proto . th dport @okports accept
ポート/サービス名を使用する場合は、代わりdomain
に作成することもできます。53
/etc/services