systemctl start dhcpd //啟動DHCP
systemctl enable dhcpd //配置服務開機啟動
ps aux | grep dhcp //查看進程
netstat -tlunp | grep dhcpd //查看端口
ifdown ens35 && ifup ens35 //重啟網卡
route -n //查看路由
cat /etc/resolv.conf //查看DNS
cat /var/lib/dhcpd/dhcpd.leases //查看租約數據庫文件
host xuegod63 { #這一段內容,要寫在subnet字段中,和subnet配合使用。
hardware ethernet 00:0C:29:12:ec:1e;
fixed-address 192.168.1.251;
}
======================================================================
ntpdate 192.168.0.2
ntpdate ntp1.aliyun.com
讓NTP服務同步硬件時間 ====》
在/etc/sysconfig/ntpdate 文件中,把SYNC_HWCLOCK=no 改成SYNC_HWCLOCK=yes
就可以讓硬件時間與系統時間一起同步。
hwclock -r #查看硬件時間
date -s "2018-12-10 21:13"
hwclock -w #將系統時間同步到硬件時間
hwclock -s #把BIOS時間同步到系統時間
