UNBUNTU 架设DHCP服务器
来源:互联网 发布:防范电信网络诈骗案例 编辑:程序博客网 时间:2024/05/21 08:30
1 到http://www.isc.org/software/dhcp/424-p2/download/dhcp-424-p2targz 下载dhcp-4.2.4-P2.tar.gz
2 解压dhcp-4.2.4-P2.tar.gz到/usr
root@xue-desktop:/home/xue/下载# tar -zxvf dhcp-4.2.4-P2.tar.gz -C /usr
3 配置编译
root@xue-desktop:/home/xue/下载# cd /usr
root@xue-desktop:/usr# ls
adobeflash dhcp-4.2.4-P2 games java local share
bin eclipse include lib sbin src
root@xue-desktop:/usr# cd dhcp-4.2.4-P2/
root@xue-desktop:/usr/dhcp-4.2.4-P2# ./con
configure contrib/
root@xue-desktop:/usr/dhcp-4.2.4-P2# ./configure =====>>配置
root@xue-desktop:/usr/dhcp-4.2.4-P2# make
root@xue-desktop:/usr/dhcp-4.2.4-P2#make install
root@xue-desktop:/usr/local/sbin#cd /usr/local/sbin/
root@xue-desktop:/usr/local/sbin# ls
dhclient dhcpd dhcrelay
root@xue-desktop:/usr/local/sbin#
可以看到,程序默认应该是安装到了/usr/local/sbin目录下,里面有三个文件,分别是dhclient,dhcpd,dhcrelay,分别是客户端,服务端和中转器
4 在/etc目录下建一个dhcpd.conf文件,即ipv4配置文件
root@xue-desktop:/usr/local/sbin#cat -n /etc/dhcpd.conf
1 ddns-update-style none;
2 ignore client-updates;
3 default-lease-time 259200; #默认租借为3天
4 max-lease-time 518400;
5 option routers 192.168.1.128;
6 option domain-name "docotr.mo";
7 option domain-name-servers 202.116.128.1, 202.116.128.2;
8
9 subnet 192.168.1.0 netmask 255.255.255.0
10 {
11 range 192.168.1.200 192.168.1.230;
12
13 host win7
14 {
15 hardware ethernet 00:30:67:3a:ca:32;
16 fixed-address 192.168.1.253;
17 }
18 }
root@xue-desktop:/usr/local/sbin#
启动服务:root@xue-desktop:/usr/local/sbin# cd /usr/local/sbin
root@xue-desktop:/usr/local/sbin# ./dhcpd
Internet Systems Consortium DHCP Server 4.2.4-P2
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Can't open lease database /var/db/dhcpd.leases: No such file or directory --
check for failed database rewrite attempt!
Please read the dhcpd.leases manual page if you
don't know what to do about this.
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
root@xue-desktop:/usr/local/sbin#
这里上面说,找不到/var/db/dhcpd.leases 租约文件, 那就建一个吧
root@xue-desktop:/usr/local/sbin# mkdir /var/db
root@xue-desktop:/usr/local/sbin# touch /var/db/dhcpd.leases
root@xue-desktop:/usr/local/sbin#
再来启动一下:
root@xue-desktop:/usr/local/sbin# ./dhcpd
Internet Systems Consortium DHCP Server 4.2.4-P2
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:e0:4c:20:69:23/192.168.1.0/24
Sending on LPF/eth0/00:e0:4c:20:69:23/192.168.1.0/24
Sending on Socket/fallback/fallback-net
root@xue-desktop:/usr/local/sbin#
看到上面3行红色的就表示没错了。
来看一下服务是否启动了
root@xue-desktop:/usr/local/sbin# netstat -tulnp | grep dhcp
udp 0 0 0.0.0.0:67 0.0.0.0:* 13904/dhcpd
udp 0 0 0.0.0.0:4079 0.0.0.0:* 13904/dhcpd
udp6 0 0 :::13072 :::* 13904/dhcpd
root@xue-desktop:/usr/local/sbin#
67 端口就是了。
- UNBUNTU 架设DHCP服务器
- DHCP服务器架设指南
- DHCP 服务器架设
- Linux-DHCP服务器架设
- fedora12 下架设DHCP服务器
- Ubuntu下简单架设一个dhcp服务器
- Ubuntu10.04 下架设dhcp服务器
- Linux下DHCP和DNS服务器的架设
- Linux服务器的架设 (DHCP,NIS,SAMBA,FTP,DNS)
- linux下服务器的架设(dhcp,nis,samba,ftp,dns)
- centos 6.2下架设DHCP服务器
- [ZT]ADSL上网用RouterOS架设DHCP服务器
- 架设linux DHCP SERVER
- NFS服务器搭建 unbuntu
- linux中架设DHCP服务
- 虚拟机linux架设DHCP服务
- 架设服务器
- 服务器架设
- 【技术类】ArcGIS 也能做正射校正
- 畅享云时代:开发者必备的8个最佳云端集成开发环境
- 【技术类】【遥感入门系列】4、遥感图像预处理
- awk常用字符串处理函数
- java排序算法整理
- UNBUNTU 架设DHCP服务器
- 【技术类】Image Extension for Server功能分享
- osg学习示例之遇到问题四骨骼动画编译osgCal
- 越狱的 iPhone、iPad 通过网站实现一键安装 ipa 格式的 APP 应用
- VC 自定义消息 postmessage用法
- 显示非模式对话框实例
- JAVA MD5的网络简洁方案(32位)
- 【在线应用】ArcGIS 影像技术应用新模式
- 小论接口(interface)和抽象类(abstract class)的区别