Welcome to the Linux community forum to interact with 2 million technicians >> Enter the configuration of the DHCP server under Linux [root@loaclhost /]mount /dev/hdc /hdc //Mount the CD to /dev/ [root@loaclhost /] cd hdc/Server //Enter the closed server directory [root@loaclhost Server]rpm ?ivh dhcp-3.0.5-7.el5.i
Welcome to the Linux community forum to interact with 2 million technicians >> Enter
DHCP server configuration under Linux
[root@loaclhost /]mount /dev/hdc /hdc //Mount the CD to /dev/
[root@loaclhost /]cd hdc/Server //Enter the server directory of the closed disk
[root@loaclhost Server]rpm ?ivh dhcp-3.0.5-7.el5.i386.rpm //rpm installs the server side of DHCP
[root@loaclhost Server]cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf // Replace /etc/dhcpd.conf with /usr/share/doc/dhcp -3.0.5/dhcpd.conf.sample
//Tips: The DHCP server does not have a configuration file by default. You need to copy the sample from the /usr directory and then modify it. If you are a skilled engineer, you can create it directly.
[root@loaclhost Server]cd /etc
[root@loaclhost etc]vi dhcpd.conf
Ddns-update-style interim;
Ignore client-updates; //Dynamic DNS resolution
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
Option routers 192.168.0.1; //Gateway
Option subnet-mask 255.255.255.0; //Subnet mask
Option nis-domain "domain.org"; //NIS domain name is domain.org
Option domai-name "domain.org"; //The domain name is domain.org
Option domain-name-servers "192.168.1.1"; //DNS
Option time-offset -18000; # eastern Standard Time //
# Option ntp-servers 192.168.1.1;
# Option netbios-name-servers 192.168.1.1;
# --- Selscts point-to-point node (default is hybrid). don't change thisunless
# -- you understand Netbios very well
# option netbios-node-type 2;
Range dynamic-bootp 192.168.0.128 192.168.0.254; //分配地址池
Default-lease-time 21600; //默认租约时间21600s
Max-lease-time 43200; //最大租约时间为43200s
# 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;
Fixed-address 192.168.0.11;
}
}
注:配置文件,橙色部分为全局配置;蓝色部分为机遇MAC,主机名分配静态IP。
[root@localhost etc]ifconfig eth0 192.168.0.1
[root@localhost etc]service dhcpd restart //重新启动dhcpd服务