DHCP服务整理
来源:互联网 发布:下载软件 支持thunder 编辑:程序博客网 时间:2024/05/29 12:25
DHCP服务整理
Centos 6.5
主要配置文件:
/etc/dhcpd.conf DHCP的主要配置文件 /etc/sysconfig/dhcpd DHCP的网卡设置文件,多个网卡时设置通过那个网卡提供dhcp服务 /etc/sysconfig/dhcrelay DHCP中继配置文件 /var/lib/dhcpd/dhcpd.leases DHCP记录客户端连接后租约等信息的文件
1.安装配置DHCP服务
[root@localhost ~]# yum -y install dhcp[root@localhost ~]# cd /etc/dhcp[root@localhost dhcp]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample dhcpd.confcp:是否覆盖"dhcpd.conf"? y[root@localhost dhcp]#vim dhcpd.conf# A slightly different configuration for an internal subnet.subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.26 192.168.1.30; option domain-name-servers 192.168.1.1; #目前发现只能写一个DNS地址,多个待我测试。 option domain-name "abc.com"; option routers 192.168.1.1; option broadcast-address 192.168.1.255; default-lease-time 600; max-lease-time 7200;}#为指定机器分配IPhost fantasia { hardware ethernet 08:00:07:26:c0:a5; fixed-address 192.168.1.27;}:wq #保存退出[root@localhost dhcp]# service dhcpd configtest #检查配置文件语法是否有错误Syntax: OK[root@localhost dhcp]# service dhcpd restart #启动dhcp服务#开启允许通过防火墙[root@localhost dhcp]# iptables -I INPUT 1 -p tcp --dport 67:68 -j ACCEPT[root@localhost dhcp]# iptables -I INPUT 1 -p udp --dport 67:68 -j ACCEPT
2.指定DHCP服务监听网卡
[root@localhost dhcp]# vim /etc/sysconfig/dhcpd DHCPDARGS='eth0'
3.配置多作用域
option domain-name "fighting";option domain-name-servers 172.16.51.254;default-lease-time 86400;max-lease-time 604800;log-facility local7;subnet 172.16.51.0 netmask 255.255.255.0 { range 172.16.51.100 172.16.51.110; option routers 172.16.51.254; host zijian { hardware ethernet 08:00:27:8F:54:2C; fixed-address 172.16.51.108; }}subnet 172.16.52.0 netmask 255.255.255.0 { range 172.16.52.120 172.16.52.123; option routers 172.16.52.154; host lijian{ hardware ethernet 08:00:27:8F:74:7C; fixed-address 172.16.52.254; }}
4.超级作用域配置
shared-network 224-29 { #定义一个名叫224-29的超级作用域 subnet 10.17.224.0 netmask 255.255.255.0 { option routers rtr-224.example.org; } subnet 10.0.29.0 netmask 255.255.255.0 { option routers rtr-29.example.org; } pool { allow members of "foo"; range 10.17.224.10 10.17.224.250; } pool { deny members of "foo"; range 10.0.29.10 10.0.29.230; }}
5.客户端验证
linux client 验证
[root@client ~]## dhclient -d eth0
win7 clinet 验证
cmd>ipconfig /release释放ip
cmd>ipconfig /renew重新获取ip
常见dhcpd.conf文件参数
0 0
- DHCP服务整理
- DHCP服务
- DHCP服务
- DHCP服务
- dhcp服务
- DHCP服务
- DHCP服务
- DHCP服务
- DHCP服务
- DHCP服务
- dhcp服务
- 【原创】DHCP服务...
- DHCP服务检测
- DHCP和Apache服务
- centos5 dhcp服务配置
- DHCP服务解析
- Linux DHCP服务
- Linux DHCP服务
- 剑指offer 面试题15: 链表中倒数第k个结点 题解
- usb设备驱动程序
- 如何让妹子认为你是数学天才
- svn cleanup failed–previous operation has not finished
- 面试题87:玛瑙项链
- DHCP服务整理
- 《Android 开发艺术探索》读书笔记四 IPC机制之Android中的多进程模式
- leetcode——43——Multiply Strings
- MyBatis,动态传入表名,字段名的解决办法
- Spring mvc Day1(1) springmvc架构
- Android 4.0以后主线程访问网络问题
- phpcms v9 二次开发 前台上传图片
- 交通灯管理系统
- 青蛙的约会gcd