CentOS6.6下DHCP环境搭建

来源:互联网 发布:无锡微创软件 编辑:程序博客网 时间:2024/06/10 01:47
1检查DHCP服务是否安装rpm -q dhcppackage dhcp is not installed#yum安装yum -y install dhcp#RMP包安装cd /usr/local/srcrpm -ivh --aid *.rpm  #解决依赖关系,一键安装rpm -ivh --nodeps portreserve-0.0.4-9.el6.x86_64.rpmrpm -ivh --nodeps dhcp-common-4.1.1-43.P1.el6.centos.1.x86_64.rpmrpm -ivh --nodeps dhcp-4.1.1-43.P1.el6.centos.1.x86_64.rpm#rpm -ivh --nodeps dhclient-4.1.1-43.P1.el6.centos.1.x86_64.rpm2vi /etc/sysconfig/dhcpd   #指定DHCP服务的网络接口# Command line options hereDHCPDARGS=eth03vi /etc/dhcpd.conf  #编辑配置文件
ddns-update-style interim;   #设置DHCP服务器模式ignore client-updates;       #禁止客户端更新subnet 192.168.0.0 netmask 255.255.0.0 {# --- default gateway        option routers                  192.168.1.1;   #路由        option subnet-mask              255.255.0.0;   #子网掩码#       option nis-domain               "domain.org"; #       option domain-name              "domain.org";          option domain-name-servers      8.8.8.8,8.8.4.4;  #DNS服务器        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.20 192.168.1.230; #动态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 00:0C:29:E2:82:5C;  #保留主机的MAC地址                fixed-address 192.168.21.201;         #保留主机的IP,即绑定IP地址到主机        }}

4service dhcpd start    #启动dhcp服务service dhcpd restart  #重启dhcp服务chkconfig dhcpd on     #设置开机启动

 

低版本的文件位于/etc/dhcpd.conf
高版本的文件位于/etc/dhcp/dhcpd.conf

0 0
原创粉丝点击