
下面是我PXE SERVER的DHCP设定档:
dhcpdconf
#iddns-update-style interim;
ddns-update-style none;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients"{
match if substring(option vendor-class-identifier,0,9)="PXEClient";
filename "linux-install/pxelinux0";
#filename "linux-install/sles111-64/bootx64efi";
next-server 19216801;
}
subnet 19216800 netmask 2552552550{
range 19216802 1921680254;
option broadcast-address 1921680255;
option routers 19216801;
option subnet-mask 2552552550;
}不知道lz需要在怎么样的实训报告
不过个人比较熟悉RHEL5下的各种服务,就以RHEL5简单说明一下DHCP的设置吧
首先,服务器端需要安装好相关包
挂在好安装介质后使用rpm
-ivh
安装相关包
安装完后可以通过vi/vim
编辑/etc/dhcpdconf文件来修改服务器配置
客户端的配置方案很简单
vi/vim
/etc/sysconfig/network-scripts/ifcfg-eth0(第1网卡地址)
设置onboot=yes
类型设置为dhcp
然后重启网卡就可以正常启用dhcp自动获取三具体实验:
任务一 简述安装DHCP服务器的过程:
yum install -y dhcpx86_64
或者rpm -ivh dhcpx86_64
任务二 配置DHCP:
[root@test ~]# rpm -q dhcp
dhcp-411-30P1el6x86_64
[root@test ~]# rpm -qc dhcp |grep conf
/etc/dhcp/dhcpdconf
/etc/dhcp/dhcpd6conf
/etc/sysconfig/dhcpd
/etc/sysconfig/dhcpd6
/etc/sysconfig/dhcrelay
[root@test ~]# vim /etc/dhcp/dhcpdconf
修改为下面参数:
subnet 192168450 netmask 2552552550 {
range 19216845101 19216845200;
option domain-name-servers 19216801;
option domain-name "ncieorg";
option routers 19216845254;
option broadcast-address 19216845255;
default-lease-time 720;
max-lease-time 2160;
}
四思考题:
1.如果在一个子网内有多余一台DHCP服务器提供服务,结果会怎样?
>> 如果一个子网内有多余一台DHCP服务器提供服务,结果有两种可能:
a) 如果两台DHCP服务器的地址池不同,比如甲为19216845101-19216845200,乙为19216845201-19216845220,那么网络可以正常使用,没有任何问题
b) 如果两台DHCP服务器的地址池相同,那么会出现地址冲突的效果,比如PC1从甲获取了19216845201的地址,这个IP在甲中被保留,但在乙中这个地址还在地址池里,那么另一台PC2很有可能从乙获取19216845201,那么PC1和PC2的地址冲突,就会影响两台PC的正常网络通信
纯手工输入,非复制粘贴这个问题包括了linux dhcp除中继外绝大多数功能,我先一个一个的帮你说明一下,最后给出配置文件。
首先搭建我就不用多说了,直接使用rpm -ivh安装dhcp服务即可,然后开始写配置文件,默认是个空白的,可以将/usr/share/doc/dhcp-305/dhcpdconf复制到sample /etc/dhcpdconf,然后VI打开这个文件编写(下面是我自己电脑上配置文件)
ddns-update-style interim;
ignore client-updates;
subnet 192168100 netmask 2552552550 { 指定的网段
# --- default gateway
option routers 192168101; 网关
option subnet-mask 2552552550; 掩码
option nis-domain "domainorg";
option domain-name "domainorg"; 域名
option domain-name-servers 192168102; DNS服务器
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 19216811;
# option netbios-name-servers 19216811;
# --- 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 192168101 19216810100; 分配置IP的范围
default-lease-time 21600; 默认租期
max-lease-time 43200; 最大租期
# we want the nameserver to appear at a fixed address
host ns { 绑定MAC与IP
next-server marvinredhatcom;
hardware ethernet 00:0c:29:61:3c:3c;
fixed-address 192168102;
}
}
只是你的要求中有要排除一些IP ,以及绑定多个IP,下面将继续说明。
比如说在192168101到19216810100中要排除1921681010~1921681020,可以写两段IP范围,即
range 192168101 192168109;
range 1921681021 19216810100;
绑定多个IP
host ns {
hardware ethernet a4:d5:6b:55:9d:43;
fixed-address 192168101;
}
host ns {
hardware ethernet 1a:6f:8c:12:23:5a;
fixed-address 192168102;
}
然后启动DCHP服务
service dhcpd start
查看DHCP服务状态
servic dhcpd staus
到此完毕,如果启动出错一般是配置文件写错了,注意标点符号,你自己总结下,归纳下即可完成。
不足之处,敬请见谅!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)