DHCP服务器的配置
时间:2010-09-21 来源:muban
今天在群里有人问起这个问题,我也是初学者,但配置过DHCP服务器也有段时间了
在这里温习一下。多写写把能提高技术,也便于自己查阅。
原理就不多写了。
1.先选定VMware中网卡的连接方式。 server:VMnet3 client: XP VMnet3
2.DHCP服务器配置IP地址 192.168.1.100 255.255.255.0 192.186.1.1
3.软件包的查询与安装
[root@localhost ~]# rpm -qa dhcp
[root@localhost ~]#yum install dhcp [root@localhost dhcp-3.0.5]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf'? y
[root@localhost ~]#vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
# 分配的网段, 分配的子网掩码 修改你所分配的网络地址 以及子网掩码
# --- default gateway默认的网关设置
option routers 192.168.1.1; #默认网关
option subnet-mask 255.255.255.0; #默认的子网掩码
#option nis-domain "domain.org";
#option domain-name "domain.org";
#option domain-name-servers 192.168.1.1;
#next-server 192.168.1.44; #指定TFTP的IP,如果本机也是TFTP的服务器,则填写本机的IP。
#filename "pxelinux.0"; #指定TFTP下载的pxelinux.0这个文件下的default
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.1.128 192.168.1.254; #指定本DHCP服务器分配的地址池
default-lease-time 21600;
max-lease-time 43200;
4.启动服务
[root@localhost ~]# service dhcpd status
dhcpd is stopped
[root@localhost ~]# service dhcpd restart
Starting dhcpd: [ OK ]
5.client 去自动获取IP
获取的是192.168.1.254
6.至此配置完成
在这里温习一下。多写写把能提高技术,也便于自己查阅。
原理就不多写了。
1.先选定VMware中网卡的连接方式。 server:VMnet3 client: XP VMnet3
2.DHCP服务器配置IP地址 192.168.1.100 255.255.255.0 192.186.1.1
3.软件包的查询与安装
[root@localhost ~]# rpm -qa dhcp
[root@localhost ~]#yum install dhcp [root@localhost dhcp-3.0.5]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf'? y
[root@localhost ~]#vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
# 分配的网段, 分配的子网掩码 修改你所分配的网络地址 以及子网掩码
# --- default gateway默认的网关设置
option routers 192.168.1.1; #默认网关
option subnet-mask 255.255.255.0; #默认的子网掩码
#option nis-domain "domain.org";
#option domain-name "domain.org";
#option domain-name-servers 192.168.1.1;
#next-server 192.168.1.44; #指定TFTP的IP,如果本机也是TFTP的服务器,则填写本机的IP。
#filename "pxelinux.0"; #指定TFTP下载的pxelinux.0这个文件下的default
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.1.128 192.168.1.254; #指定本DHCP服务器分配的地址池
default-lease-time 21600;
max-lease-time 43200;
4.启动服务
[root@localhost ~]# service dhcpd status
dhcpd is stopped
[root@localhost ~]# service dhcpd restart
Starting dhcpd: [ OK ]
5.client 去自动获取IP
获取的是192.168.1.254
6.至此配置完成
相关阅读 更多 +