Skip to content
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 ntp support in buster with mgmt vrf #55

Merged
merged 3 commits into from
Mar 25, 2020
Merged

[ntp] add ntp support in buster with mgmt vrf #55

merged 3 commits into from
Mar 25, 2020

Conversation

bsun-sudo
Copy link

@bsun-sudo bsun-sudo commented Mar 25, 2020

- What I did
change in Buster dev for NTP with mgmt vrf

- How I did it

  • create a file in files/image_config/ntp/ntp-systemd-wrapper to add mgmt vrf related start cmd for ntp service. So that the default /usr/lib/ntp/ntp-systemd-wrapper can be overriden during build time.
  • modify build_debian.sh to cp files/image_config/ntp/ntp-systemd-wrapper to /usr/lib/ntp/ntp-systemd-wrapper during build time.

- How to verify it

- config ntp add xx.xx.xx.xx
- check ntpstat, ntpq -pn
- config mgmt vrf
- check "ip vrf exec mgmt ntpstat" , ip vrf exec mgmt ntpq -pn"
- service ntp start
- service ntp stop
- service ntp status

root@sonic:~# show mgmt-vrf

ManagementVRF : Disabled


root@sonic:~# config ntp add 10.11.0.1
NTP server 10.11.0.1 added to configuration
Restarting ntp-config service...
root@sonic:~#


root@sonic:~# service ntp status
● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enab
   Active: active (running) since Wed 2020-03-25 04:00:42 UTC; 19s ago
     Docs: man:ntpd(8)
  Process: 15898 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status
 Main PID: 15908 (ntpd)
    Tasks: 2 (limit: 4915)
   Memory: 1.8M
   CGroup: /system.slice/ntp.service
           └─15908 /usr/sbin/ntpd -p /var/run/ntpd.pid -x -u 105:110


oot@sonic:~# ntpstat
synchronised to NTP server (10.11.0.1) at stratum 4
   time correct to within 1940 ms
   polling server every 64 s
root@sonic:~#
root@sonic:~#
root@sonic:~# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*10.11.0.1       10.14.2.1        3 u   34   64    1    0.241  -1625.8   0.231
root@sonic:~#


root@sonic:~# config vrf add mgmt
root@sonic:~# show mgmt-vrf

ManagementVRF : Enabled

Management VRF interfaces in Linux:
40: mgmt: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether f6:a6:52:de:0c:46 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500
    vrf table 5000 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master mgmt state UP mode DEFAULT group default qlen 1000
    link/ether 3c:2c:30:1f:9f:80 brd ff:ff:ff:ff:ff:ff
41: lo-m: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master mgmt state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether e2:bc:53:eb:a8:57 brd ff:ff:ff:ff:ff:ff


root@sonic:~# ip vrf exec mgmt ntpstat
synchronised to NTP server (10.11.0.1) at stratum 4
   time correct to within 1755 ms
   polling server every 64 s
root@sonic:~#
root@sonic:~#
root@sonic:~# ip vrf exec mgmt ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*10.11.0.1       10.14.2.1        3 u   50   64    3    0.210  -1563.0  25.494


root@sonic:~# service ntp status
● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enab
   Active: active (running) since Wed 2020-03-25 04:02:21 UTC; 2min 32s ago
     Docs: man:ntpd(8)
  Process: 16104 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status
    Tasks: 2 (limit: 4915)
   Memory: 2.0M
   CGroup: /system.slice/ntp.service
           └─vrf
             └─mgmt
               └─16114 /usr/sbin/ntpd -p /var/run/ntpd.pid -x -u 105:110


root@sonic:~# service ntp restart
root@sonic:~#
root@sonic:~#
root@sonic:~#
root@sonic:~# ip vrf exec mgmt ntpstat
synchronised to NTP server (10.11.0.1) at stratum 4
   time correct to within 1817 ms
   polling server every 64 s
root@sonic:~#
root@sonic:~#
root@sonic:~# ip vrf exec mgmt ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*10.11.0.1       10.14.2.1        3 u   10   64    1    0.426  -1500.2   6.994
root@sonic:~#
root@sonic:~#
root@sonic:~# service ntp status
● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enab
   Active: active (running) since Wed 2020-03-25 04:05:17 UTC; 35s ago
     Docs: man:ntpd(8)
  Process: 16208 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status
    Tasks: 2 (limit: 4915)
   Memory: 1.8M
   CGroup: /system.slice/ntp.service
           └─vrf
             └─mgmt
               └─16219 /usr/sbin/ntpd -p /var/run/ntpd.pid -x -u 105:110


@lguohan lguohan changed the title lguo [ntp] add ntp support in buster with mgmt vrf Mar 25, 2020
@lguohan lguohan merged this pull request into lguohan:master Mar 25, 2020
lguohan pushed a commit that referenced this pull request Mar 28, 2020
- create a file in files/image_config/ntp/ntp-systemd-wrapper to add mgmt vrf related start cmd for ntp service. So that the default /usr/lib/ntp/ntp-systemd-wrapper can be overriden during build time.

- modify build_debian.sh to cp files/image_config/ntp/ntp-systemd-wrapper to /usr/lib/ntp/ntp-systemd-wrapper during build time.

Co-authored-by: Bing Sun <Bing_Sun@dell.com>
lguohan pushed a commit that referenced this pull request Mar 29, 2020
- create a file in files/image_config/ntp/ntp-systemd-wrapper to add mgmt vrf related start cmd for ntp service. So that the default /usr/lib/ntp/ntp-systemd-wrapper can be overriden during build time.

- modify build_debian.sh to cp files/image_config/ntp/ntp-systemd-wrapper to /usr/lib/ntp/ntp-systemd-wrapper during build time.

Co-authored-by: Bing Sun <Bing_Sun@dell.com>
lguohan pushed a commit that referenced this pull request Apr 17, 2020
- create a file in files/image_config/ntp/ntp-systemd-wrapper to add mgmt vrf related start cmd for ntp service. So that the default /usr/lib/ntp/ntp-systemd-wrapper can be overriden during build time.

- modify build_debian.sh to cp files/image_config/ntp/ntp-systemd-wrapper to /usr/lib/ntp/ntp-systemd-wrapper during build time.

Co-authored-by: Bing Sun <Bing_Sun@dell.com>
lguohan pushed a commit that referenced this pull request Nov 21, 2022
3f43852b8 [sonic_operators.cpp]: Increasing select timeout (#55)
a1142e251  [sonic_operators.cpp] Update sonic_db_manager::get_counter (#56)
1069d2dd4 [sonic_operators.cpp]: Fixbug wait with false positive to return success (#54)

Signed-off-by: Ze Gan <ganze718@gmail.com>
lguohan pushed a commit that referenced this pull request May 19, 2024
fa8b709 Handled the error case of negative age (#57)
990f5b0 Use github code scanning instead of LGTM (#55)
a7992c5 Install libyang for swss-common. (#50)
244fa86 Update README.md

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants