How to build DHCP&NTP server on Linux(Ubuntu)
来源:互联网 发布:java 汉字变拼音 编辑:程序博客网 时间:2024/04/29 15:25
1. DHCP Sever
1) Install Command: $apt-get install dhcp3-server
maybe need apt-get autoremove dhcp3-server firstly.
2) configure /etc/dhcp/dhcpd.conf as below:
#sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.133.255;
option routers 192.168.133.254;
option domain-name-servers 192.168.133.1, 192.168.133.2;
option domain-name "mydomain.example";
option ntp-servers 192.168.133.130;
subnet 192.168.133.0 netmask 255.255.255.0 {
range 192.168.133.10 192.168.133.100;
range 192.168.133.150 192.168.133.200;
}
Comment: The option “ntp-servers” is used to assign ntp-server ip address to client. When the client get ip address from DHCP server, the DHCP server will also give the ntp-server ip address to the client.
3) start/stop/restart dhcp server as below:
$/etc/init.d/isc-dhcp-server restart/start/stop
2. NTP Server
1) Install Command: apt-get install ntp
2) The client do not update time after receive date&time from ntp server.
a) Change the file /etc/ntp.conf as the “stratum” may be verified as illegal. So the firmware will not update the date&time. Maybe Change as below:
fudge 127.127.1.0stratum 1
Comment: If the stratum is 0, maybe the client will take the date&time it get as incredible so that it will not update date&time.
b) The time gap between the server and client is too big, maybe the firmware will not update date&time to avoid some risks.
3) If the system ip address changed, we should restart DHCP/NTP server. Or else it will not work properly.
3. Configure static ip address for linux.
1) The system use dhcp as default. Just check the configuration file /etc/network/interfaces:
# The primary network interface
auto eth0
iface eth0 inet dhcp
2) To edit the file as below to change the system from DHCP to static ip.
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
3) We need to down/up to enable the configuration.
$ ifdown eth0
$ifup eth0
4. Set Time
1) Use command “date” to change the firmware date&time.
e.g.: $date –s “2012-12-12 12:12:12”
2) User should use the command below to check whether the time is UCT or not:
“date ” / “date -u”
5. Change Timezone
1) e..g.: $ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2) Test: use command “date” to check the timezone.
- How to build DHCP&NTP server on Linux(Ubuntu)
- How to build DHCP&NTP server on Linux(Ubuntu)
- How to build openmcu-ru on ubuntu
- How to install DHCP server on Windows Server 2008R2
- how to record build log on linux
- How to build linux PXE server
- How to compile/build QEMU 1.4.0 on Ubuntu 12.04
- How to install GSL on linux(ubuntu)
- How to install eclipse on ubuntu/linux
- How to install GSL on linux (ubuntu)
- How to Install Metasploit on Linux Ubuntu
- How to build and install Open vSwitch on a linux
- How To Build CyanogenMod Android (oneplus/bacon) On Linux
- How to Build OpenSource Coin on Ububtu Linux
- How to start/restart/stop apache server on ubuntu
- How to configure LAMP server on Ubuntu System
- How to install Deluge on a Ubuntu Server
- How to Install CodeIgniter on an Ubuntu 12.04 Cloud Server
- 套接字API(一)socket函数
- 基于像素自适应分割的运动目标检测算法
- Tomcat --> Cannot create a server using the selected type
- cocos2dx含有Box2d编译到android平台和ios平台上
- 1033:子网掩码
- How to build DHCP&NTP server on Linux(Ubuntu)
- Linux下查看文件和文件夹大小
- 第一次任务
- 关于RS485总线通信协议开发注意事项
- php新窗口中get参数乱码
- 如何处理标注打架
- Oracle常用sql语法
- 中美最佳工作场所秀 Top 25 Companies for Work-Life Balance
- iOS 保存到相册和从相册里面去图片的demo