-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ntp: add config to filter and set ntp interfaces #11066
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,12 @@ ntp_servers: | |
ntp_restrict: | ||
- "127.0.0.1" | ||
- "::1" | ||
# Specify whether to filter interfaces | ||
ntp_filter_interface: false | ||
# Specify the interfaces | ||
# Only takes effect when ntp_filter_interface is true | ||
ntp_interfaces: | ||
- ens3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's risky. But, do you think this still works for scenarios with inconsistent NIC names per node? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! I will comment out the When having inconsistent NIC names per node, One can have all interfaces from all nodes listed under this list of interfaces and if the interface does not exist on a node, I did a quick test and NTP simply just listens on the set of interfaces that do exist.
The ntp server logs looked something like this when I restarted the service
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Pavan-Gunda , It looks like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi! I commented |
||
# The NTP driftfile path | ||
# Only takes effect when ntp_manage_config is true. | ||
ntp_driftfile: /var/lib/ntp/ntp.drift | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,13 @@ restrict -6 default kod notrap nomodify nopeer noquery limited | |
restrict {{ item }} | ||
{% endfor %} | ||
|
||
{% if ntp_filter_interface %} | ||
interface ignore wildcard | ||
{% for item in ntp_listen %} | ||
interface listen {{ item }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
# Needed for adding pool entries | ||
restrict source notrap nomodify noquery | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @Pavan-Gunda
Because there is only one variable that needs to be config, so
Which Can be easier for the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 👍
I made the change now and pushed the code :)