Installing the DHCP Service |
|
First, configure the network card, the card will become a static IP configuration steps are as follows: | |
NIC configuration file directory: / etc / sysyconfig / network-scripts Directory: there are corresponding ifcfg-eth0 configuration profile corresponding to the card |
|
Content profile as follows: first row: device name DEVICE = Note: You can modify according to their needs After editing the input line mode: wq to save and exit |
|
After the verification is complete, so that the configuration file to take effect, order: 1, / etc / init.d / network restart Check DNS situation: 2, vim /etc/resolv.conf |
|
The first step: Go to /etc/yum.repo.d folder, re-establish yum source file. Proceed as follows: |
|
1, create a folder: | Example: mkdir zyl (name zyl folder) |
2, the /etc/yum.repo.d asking about the price of all the files in the folder are moved to the new folder: | Command: mv C * zyl |
3, create a configuration file directly into vim created: | Example: vim dvd.repo |
4, in the configuration file is created which is written: | The first line: [casual Input] Second line: name = random input Third row: baseurl = file: /media/CentOS_6.9_Final Fourth row: gpgcheck = 0 The last line enter: wq to save and exit |
5, yum install plug-ins: |
Command: yum clean all |
6, install the DHCP software: | Command: yum install dhcp Later to enter: y (carriage return) |
7, enter the configuration file is modified: | Command: vim /etc/dhcp/dhcpd.conf (empty file) |
8, import the configuration template in the empty file, directly modify more convenient: | Enter the command line mode: r /usr/share/doc/dhcp-4.1.1/dhcp.conf.sample |
9, the file modification: only the portion reserved subnet 10.5.5.0 {}, dd delete all the rest. | 1、subnet 10.5.5.0 表示工作网段 改为当前实验环境的网段 172.16.0.0 2、netmask 子网掩码:修改为实验要求的:255.25.0.0 3、range:地址池 修改 172.16.0.50 172.16.0.150 4、domain-name-servers:(dns)172.16.0.1 //将地址指向自己 5、domain-name:域名,没有域,可以删除不用了 6、routers:(网关)172.16.0.1 //将网关指向自己 7、下面一行没用删除 8、default-least-tim:(最小租期) 9、max-least-time:(最大租期) //后面两个默认就行 |
10、启动dhcp为客户机分配IP地址: | 启动命令: /etc/init.d/dhcpd start |
11、查看67端口开放,说明开启成功: | 查看命令:netstat -antpul | grep 6 |
报错排除 |
|
1、分析日志: | cat -f /var/log/messages |
2、启动dhcp失败: | 安装dhcp服务器的机子的IP地址,与要分配的ip池不相符。 |
3、dhcp配置文件 | 每行结尾要以分号结尾 |