API Guide

b. NTP 服务器上配置 NTP 主节点 IP 地址。在此示例中NTP 主节点 11.0.0.2 只能通过 VRF Red 访问。
OS10(config)# ntp server 11.0.0.2
OS10(config)# do show running-configuration ntp
ntp server 11.0.0.2
OS10(config)#
c. VRF Red 实例中配置 NTP
OS10(config)# ntp enable vrf red
“% Warning: NTP server/client will be disabled in default VRF and enabled on a red VRF”
Do you wish to continue? (y/n): y
OS10(config)#
OS10(config)# do show running-configuration ntp
ntp server 11.0.0.2
ntp enable vrf red
OS10(config)#
2. 配置 NTP 客户端
a. 创建非默认 VRF 实例并为 VRF 分配接口。
OS10(config)# ip vrf red
OS10(conf-vrf)# exit
OS10(config)# interface ethernet 1/1/1
OS10(conf-if-eth1/1/1)# no switchport
OS10(conf-if-eth1/1/1)# ip vrf forwarding red
OS10(conf-if-eth1/1/1)# ip address 10.0.0.2/24
OS10(conf-if-eth1/1/1)# exit
OS10(config)#
b. NTP 客户端上配置 NTP 服务器 IP 地址。
OS10(config)# ntp server 10.0.0.1
OS10(config)# do show running-configuration ntp
ntp server 10.0.0.1
OS10(config)#
c. VRF Red 实例中配置 NTP
OS10(config)# ntp enable vrf red
“% Warning: NTP server/client will be disabled in default VRF and enabled on a red VRF”
Do you wish to continue? (y/n): y
OS10(config)# do show running-configuration ntp
ntp server 10.0.0.1
ntp enable vrf red
OS10(config)#
3. 配置 NTP 主节点
a. 创建非默认 VRF 实例并为 VRF 分配接口。
OS10(config)# ip vrf red
OS10(conf-vrf)# exit
OS10(config)# interface ethernet 1/1/1
OS10(conf-if-eth1/1/1)# no switchport
OS10(conf-if-eth1/1/1)# ip vrf forwarding red
OS10(conf-if-eth1/1/1)# ip address 11.0.0.2/24
OS10(conf-if-eth1/1/1)# exit
OS10(config)
b. NTP 配置为主节点。
OS10(config)# ntp master
OS10(config)# do show running-configuration ntp
ntp master 8
OS10(config)#
系统管理
177