0

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?

kittygirl
  • 2,255
  • 5
  • 24
  • 52
  • Have you seen [this](https://serverfault.com/questions/963665/how-should-nftables-rules-using-hostnames-be-rewritten-to-deal-with-multiple-add) post? You may be better off asking on [sf] or [su] – user3788685 Aug 28 '21 at 13:26
  • smells like the error is on the previous line; post cat /etc/nftables.conf output please – Andrew Aug 31 '21 at 15:23

1 Answers1

0

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.

Lobz
  • 68
  • 4