zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

华为路由器配置NTP服务端和客户端

配置客户端华为 服务端 路由器 ntp
2023-09-11 14:20:23 时间

华为路由器配置NTP服务端和客户端

基础配置
R1:
<Huawei>sys-view    #进入系统配置模式
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1  #修改计算机名称为R1
[R1]int GigabitEthernet 0/0/0   #进入接口g0/0/0中
[R1-GigabitEthernet0/0/0]ip address 192.168.10.1 24 #配置IP地址和子网掩码
Feb 24 2022 14:53:37-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]quit   #退出接口配置模式
​
R2:
<Huawei>sys-view    #进入系统配置模式
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2  #修改计算机名称为R2
[R2]int GigabitEthernet 0/0/0   #进入接口g0/0/0中
[R2-GigabitEthernet0/0/0]ip address 192.168.10.2 24 #配置IP地址和子网掩码
Feb 24 2022 14:53:37-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]quit   #退出接口配置模式

服务端配置

配置时区和时间
<R1>undo clock timezone                 #清除默认时区(印度标准时间)
<R1>clock timezone beijing add 8        #设置时区信息为北京时间
<R1>clock datetime 15:00:00 2022-02-24  #设置当前日期时间为2022年02月24日15点0分0秒
<R1>display clock                       #查看修改后的时间

[R1]ntp refclocck-master 2          #配置NTP主时钟,层数为2

配置NTP认证功能,配置认证密钥并声明该密码可信,密码是md5加密,密码为hello@123456
[R1]ntp authentication enable
[R1]ntp authentication-keyid 42 authentication-mode md5 hello@123456
[R1]ntp reliable authentication-keyid 42

客户端配置

配置NTP认证配置,配置认证密码并声明该密钥可信
[R2]ntp authentication enable
[R2]ntp authentication-keyid 42 authentication-mode md5 hello@123456
[R2]ntp reliable authentication-keyid 42
为NTP单播客户端指定NTP单播服务器,并指定使用密钥ID 42加密
ntp unicast-server 192.168.10.1 authentication-keyid 42

测试

服务端使用display ntp-service sessions   #查看ntp服务端同步信息

客户端使用display ntp-service sessions   #查看ntp客户端与服务端同步信息