How to put `0.pool.ntp.org` in `/etc/nftables.conf` without any error?

214 Views Asked by At

In /etc/nftables.conf,I have define ntp_server={ 0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org, 3.pool.ntp.org }, 0.pool.ntp.org start with number,then I meet error when nft -f.

$ sudo nft -v
$ nftables v0.9.0 (Fearless Fosdick)
$ sudo nft -f /etc/nftables.conf
/etc/nftables.conf:8:7-19: Error: syntax error, unexpected string, expecting comma or '}'
     0.pool.ntp.org,
      ^^^^^^^^^^^^^
/etc/nftables.conf:9:6-6: Error: syntax error, unexpected number
     1.pool.ntp.org,
     ^
/etc/nftables.conf:10:6-6: Error: syntax error, unexpected number
     2.pool.ntp.org,
     ^
/etc/nftables.conf:11:6-6: Error: syntax error, unexpected number
     3.pool.ntp.org
     ^
/etc/nftables.conf:12:1-1: Error: syntax error, unexpected '}'
}

How to solve this problem?

1

There are 1 best solutions below

0
On

The ntp.org pools contain many hosts, so 0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org, 3.pool.ntp.org will resolve to different IP address as you query them over time.

I suggest using a named set and updating it with a script periodically.