Есть ли ntpd, который можно настроить для прослушивания только выбранных интерфейсов?

Моя ситуация такова, что я настраиваю множество виртуальных сетевых интерфейсов для виртуальных машин, и некоторые из моих сетей даже имеют два или более адресов. Мне не нужно ntpd прослушивать все эти интерфейсы, но, похоже, нет возможности ограничить интерфейсы, к которым пытается подключиться ntpd. Помимо всех этих параметров "безопасности" в ntpd, для системного администратора, который знает свою среду, лучший вариант безопасности - вообще не слушать интерфейсы. Например, было бы более безопасно не слушать внешние интерфейсы вообще, но ограничить доступ через конфигурацию ntp.

Известно ли какое-либо программное обеспечение ntpd, которое можно настроить для прослушивания только выбранных интерфейсов (как это должен делать любой сетевой демон)?

1 ответ

Есть два простых способа сделать это, оба описаны в официальной документации ntp:

  • Использовать -I опция командной строки для вызова ntpd

    -I [address | interface name]
    
          Open the network address given, or all the addresses associated
          with the given interface name.  This option may appear multiple
          times.  This option also implies not opening other addresses,
          except wildcard and local‐ host.  This option is deprecated.
          Please consider using the configuration file interface command,
          which is more versatile.
    

    Из документации ntp по параметрам командной строки для ntpd

  • Использовать interface директива в ntp.conf:

    interface [listen | ignore | drop] [all | ipv4 | ipv6 | wildcard | name |
               address[/prefixlen]]
    
          This command controls which network addresses ntpd opens, and
          whether input is dropped without processing. The first parameter
          determines the action for addresses which match the second
          parameter. That parameter specifies a class of addresses, or a
          specific interface name, or an address. In the address case,
          prefixlen determines how many bits must match for this rule to
          apply. ignore prevents opening matching addresses, drop causes
          ntpd to open the address and drop all received packets without
          examination. Multiple interface commands can be used. The last
          rule which matches a particular address determines the action
          for it. interface commands are disabled if any -I, --interface,
          -L, or --novirtualips command-line options are used. If none of
          those options are used and no interface actions are specified
          in the configuration file, all available network addresses are
          opened. The nic command is an alias for interface.
    

    Из документации ntp по параметрам конфигурации misc:

Другие вопросы по тегам