linux平台下的DHCP服务
2009-09-14 23:02
190 查看
安装DHCP服务器
***********************************************************************************************************
1.安装dhcp软件包
此包位于(第四章)光盘中,文件名称为dhcp
mount /media/cdrom
cd /media/cdrom/RedHat/RPMS
ls -l dhcp* (列出以dhcp开始的文件)
rpm -qa | grep dhcp (查看dhpc的安装情况)
rpm -ivh dhpc-3.0.1-12_EL.i386.rpm
――――――――――――――――――――――――――――――――――――
2. 建立配置文件
dhpcd服务将完全按照dhcpd.conf配置文件中的设置内容运行,在dhcp软件包没 有提供dhcpd.conf文件,我们可以从它提供的样例中拷贝一份,它的样例文件dhcpd.conf.sample位于/usr/share/doc/dhcp-3.0.1目录中。
cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhpcd.conf
vi /etc/dhpcd.conf 编辑dhcpd.conf文件
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 { (subnet关键字后面设置子网的网络 地址,netmask后面设置子网掩码)
# --- default gateway
option routers 192.168.0.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;
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.0.128 192.168.0.254; (设置动态分配IP的地址范围)
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD; (DHCP服务器将为符合MAC地址的主机分配设置地址)
fixed-address 207.175.42.254; (用与指定为客户端分配的固定使用的IP地址)
}
――――――――――――――――――――――――――――――――――――
3.多网络接口是需要配置的文件
作为DHCP服务器使用的主机通常会用有多个网络接口,而dhcpd服务可能只需要在其中一个网络接口上提供服务,此时可以在 "/etc/sysconfig/dhcpd"文件中指定需要提供dhcpd服务的网络接口
vi /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=添加需要使用的端口
~
――――――――――――――――――――――――――――――――――――
4.重启服务
service dhcpd start (或 /etc/init.d/dhcpd restart )
******************************************************************************************************************
DHCP客户端的配置
1.网络接口配置文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes (用于设置网络接口在系统启动是生效)
BOOTPROTO=dhcp
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
2.重启网络接口
ifdown eth0 ; ifup eth0
ifconfig eth0 (查看接口获取的ip地址)
本文出自 “风尚.趣” 博客,请务必保留此出处http://fengshangqu.blog.51cto.com/913588/201811
***********************************************************************************************************
1.安装dhcp软件包
此包位于(第四章)光盘中,文件名称为dhcp
mount /media/cdrom
cd /media/cdrom/RedHat/RPMS
ls -l dhcp* (列出以dhcp开始的文件)
rpm -qa | grep dhcp (查看dhpc的安装情况)
rpm -ivh dhpc-3.0.1-12_EL.i386.rpm
――――――――――――――――――――――――――――――――――――
2. 建立配置文件
dhpcd服务将完全按照dhcpd.conf配置文件中的设置内容运行,在dhcp软件包没 有提供dhcpd.conf文件,我们可以从它提供的样例中拷贝一份,它的样例文件dhcpd.conf.sample位于/usr/share/doc/dhcp-3.0.1目录中。
cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhpcd.conf
vi /etc/dhpcd.conf 编辑dhcpd.conf文件
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 { (subnet关键字后面设置子网的网络 地址,netmask后面设置子网掩码)
# --- default gateway
option routers 192.168.0.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;
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.0.128 192.168.0.254; (设置动态分配IP的地址范围)
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD; (DHCP服务器将为符合MAC地址的主机分配设置地址)
fixed-address 207.175.42.254; (用与指定为客户端分配的固定使用的IP地址)
}
――――――――――――――――――――――――――――――――――――
3.多网络接口是需要配置的文件
作为DHCP服务器使用的主机通常会用有多个网络接口,而dhcpd服务可能只需要在其中一个网络接口上提供服务,此时可以在 "/etc/sysconfig/dhcpd"文件中指定需要提供dhcpd服务的网络接口
vi /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=添加需要使用的端口
~
――――――――――――――――――――――――――――――――――――
4.重启服务
service dhcpd start (或 /etc/init.d/dhcpd restart )
******************************************************************************************************************
DHCP客户端的配置
1.网络接口配置文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes (用于设置网络接口在系统启动是生效)
BOOTPROTO=dhcp
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
2.重启网络接口
ifdown eth0 ; ifup eth0
ifconfig eth0 (查看接口获取的ip地址)
本文出自 “风尚.趣” 博客,请务必保留此出处http://fengshangqu.blog.51cto.com/913588/201811
相关文章推荐
- Linux平台下DHCP服务的工作原理和配置规范
- Linux系列-Red Hat5平台下的DHCP服务搭建
- Linux系列-Red Hat5平台下的DHCP服务搭建
- Linux系列-Red Hat5平台下的DHCP服务搭建
- linux服务之DHCP
- Linux系列-Red Hat5平台下构建Squid代理服务 推荐
- 基于windows2008系统平台配置DHCP服务
- 初学linux网络服务之DHCP实验
- Linux 系统 中的dhcp 服务不能启动
- 1 Linux网络配置和DHCP服务
- H3C交换机设置DHCP中继,配合Linux 服务器为多VLAN提供DHCP地址分配服务
- H3C交换机设置DHCP中继,配合Linux 服务器为多VLAN提供DHCP地址分配服务
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- Linux推荐-Red Hat5平台下的LAMP网站服务搭建(三)
- 移植ntp服务到arm-linux平台
- linux平台下apache的源码安装和将apache服务配置成系统服务
- linux下简单的dhcp服务搭建
- Linux系列-Red Hat5平台下的LAMP网站服务搭建(四
- Linux系列-Red Hat5平台下的Postfix邮件服务搭建(一
- linux 搭建dhcp服务