Fedora 36にNTPサーバーChrony をインストールする方法

環境
OSバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)
# cat /etc/redhat-release Fedora release 36 (Thirty Six)
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)

NTPサーバーChrony のインストール手順
1.Chronyをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf -y install chrony
# dnf -y install chrony
# dnf -y install chrony

2.NTPサーバーの配置ファイルを設定します
# vi /etc/chrony.conf
3行目
修正前

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
pool 2.centos.pool.ntp.org iburst
pool 2.centos.pool.ntp.org iburst
pool 2.centos.pool.ntp.org iburst

修正後

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#pool 2.centos.pool.ntp.org iburst
pool ntp.nict.jp iburst
#pool 2.centos.pool.ntp.org iburst pool ntp.nict.jp iburst
#pool 2.centos.pool.ntp.org iburst
pool ntp.nict.jp iburst

27行目
リクエストを受け付けるネットワークを追記します
allow 192.168.71.0/24

3.Chrony自動起動を設定します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl enable --now chronyd
# systemctl enable --now chronyd
# systemctl enable --now chronyd

4.NTPサービスのファイアウォールを設定します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# firewall-cmd --add-service=ntp
success
# firewall-cmd --runtime-to-permanent
success
# firewall-cmd --add-service=ntp success # firewall-cmd --runtime-to-permanent success
# firewall-cmd --add-service=ntp
success
# firewall-cmd --runtime-to-permanent
success

5.動作確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- 132.226.11.60 2 9 377 83 -600us[ -600us] +/- 32ms
^* ntp-b2.nict.go.jp 1 9 377 140 +1444us[+1438us] +/- 6122us
^+ ipv4.ntp3.rbauman.com 2 9 377 14 -478us[ -478us] +/- 6331us
^- ec2-3-114-30-212.ap-nort> 2 9 377 83 -148us[ -148us] +/- 49ms
# chronyc sources MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^- 132.226.11.60 2 9 377 83 -600us[ -600us] +/- 32ms ^* ntp-b2.nict.go.jp 1 9 377 140 +1444us[+1438us] +/- 6122us ^+ ipv4.ntp3.rbauman.com 2 9 377 14 -478us[ -478us] +/- 6331us ^- ec2-3-114-30-212.ap-nort> 2 9 377 83 -148us[ -148us] +/- 49ms
# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- 132.226.11.60                 2   9   377    83   -600us[ -600us] +/-   32ms
^* ntp-b2.nict.go.jp             1   9   377   140  +1444us[+1438us] +/- 6122us
^+ ipv4.ntp3.rbauman.com         2   9   377    14   -478us[ -478us] +/- 6331us
^- ec2-3-114-30-212.ap-nort>     2   9   377    83   -148us[ -148us] +/-   49ms

 

Fedora 36

Posted by arkgame