summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-06-01 06:53:14 +0200
committerChristian Poessinger <christian@poessinger.com>2018-06-01 06:53:45 +0200
commit69577e72a7a88de96d44dcc30ae1822d92309361 (patch)
tree07c84b02967313ab7804c89007c742b9b2491c7a /src
parent984725f4e6a616bf23661cf510dfc99e1c9254a1 (diff)
downloadvyos-1x-69577e72a7a88de96d44dcc30ae1822d92309361.tar.gz
vyos-1x-69577e72a7a88de96d44dcc30ae1822d92309361.zip
T599: Bind NTP service to specific interface
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/ntp.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/conf_mode/ntp.py b/src/conf_mode/ntp.py
index 9a4846bdf..2a6088575 100755
--- a/src/conf_mode/ntp.py
+++ b/src/conf_mode/ntp.py
@@ -62,11 +62,20 @@ restrict {{ n.address }} mask {{ n.netmask }} nomodify notrap nopeer
{% endfor -%}
{% endif %}
+{% if listen_address -%}
+# NTP should listen on configured addresses only
+interface ignore wildcard
+{% for a in listen_address -%}
+interface listen {{ a }}
+{% endfor -%}
+{% endif %}
+
"""
default_config_data = {
'servers': [],
- 'allowed_networks': []
+ 'allowed_networks': [],
+ 'listen_address': []
}
def get_config():
@@ -89,6 +98,9 @@ def get_config():
ntp['allowed_networks'].append(net)
+ if conf.exists('listen-address'):
+ ntp['listen_address'] = conf.return_values('listen-address')
+
if conf.exists('server'):
for node in conf.list_nodes('server'):
options = []