免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 16751 | 回复: 11
打印 上一主题 下一主题

[服务应用] DHCP服务限制某个MAC地址 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-12-07 10:44 |只看该作者 |倒序浏览
CentOS5

请问如何在DHCP服务器中限制某个MAC地址获取IP?
因为公司的无线经常有手机接入 导致IP地址池紧张

谢谢~~

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
2 [报告]
发表于 2012-12-07 11:15 |只看该作者
本帖最后由 dengbao2001 于 2012-12-07 11:18 编辑

不好意思,看错了标题

论坛徽章:
0
3 [报告]
发表于 2012-12-07 11:18 |只看该作者
回复 2# dengbao2001


    不好意思,操作系统是Linux啊,CentOS 5

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
4 [报告]
发表于 2012-12-07 11:26 |只看该作者
我在红帽开CASE问问

论坛徽章:
0
5 [报告]
发表于 2012-12-07 11:43 |只看该作者
host name{hardware ethernet $MAC;deny booting;}

真要限制MAC得用防火墙,不是dhcpd

论坛徽章:
0
6 [报告]
发表于 2012-12-07 13:20 |只看该作者
回复 5# darrenlee3


    是添加一个禁止该MAC地址到DHCP服务器访问的策略吗?

感觉不方便。。还有其他方法吗?

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
7 [报告]
发表于 2012-12-07 14:53 |只看该作者
不好意思,上午没看清楚,以为是Windows下面,在Linux下面,其实我也想知道。正好我们有服务,开了CASE问了红帽。

请楼主测试下,记得测试后,更新下结果呀



You can edit /etc/dhcpd.conf file this way to deny specified NIC which is using certain MAC to get IP from this DHCP server:

    class "deny-class-1" {
                  match pick-first-value (option dhcp-client-identifier, hardware);
                }

                subclass "deny-class-1" 1:00:0C:29:26:1B:28;
                subclass "deny-class-1" 1:00:0C:29:32:23:96;

                subnet 192.168.100.0 netmask 255.255.255.0 {
                  pool {
                    deny members of "deny-class-1";
                    range 192.168.100.60 192.168.100.70;
                  }
                }

Parameter Description of above configuration:

1) "deny-class-1" == This is a class name and under that subclass is not working which will use the main class name i.e. deny-class-1

2) Then we have specified the MAC address of client machine which we don't want to allocate IP form Pool  (From 192.168.100.60 TO 192.168.100.70)

3) Notice 00:0C:29:26:1B:28 is a MAC address and before that we need to specify the 1 number.

4) subclass "deny-class-1" 1:00:0C:29:32:23:96;
   In this line we are again specifying the next system's MAC address and this client will also can't get IP from Pool.

5) You can create as many classes as you want

6) You can create as many subclasses as you want

Note:- One needs to specify the pool and MAC address as per the requirement.



论坛徽章:
0
8 [报告]
发表于 2012-12-10 10:49 |只看该作者
回复 7# dengbao2001


    刚才试了下不行,改了之后服务起不来了
我等下再试试
谢谢~~!!

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
9 [报告]
发表于 2012-12-10 10:52 |只看该作者
别写错了格式和字符

论坛徽章:
21
白羊座
日期:2013-08-23 15:49:17金牛座
日期:2013-10-08 17:00:03处女座
日期:2013-10-12 11:54:11CU十二周年纪念徽章
日期:2013-10-24 15:41:34午马
日期:2013-11-27 14:07:21巨蟹座
日期:2013-12-04 10:56:03水瓶座
日期:2013-12-04 15:58:00亥猪
日期:2014-05-24 16:02:3115-16赛季CBA联赛之辽宁
日期:2016-11-07 13:52:53戌狗
日期:2013-08-23 16:15:31白羊座
日期:2013-08-24 21:59:24巨蟹座
日期:2013-08-25 16:34:24
10 [报告]
发表于 2012-12-10 11:57 |只看该作者
dhcp + squid 也可以实现,相对来说也麻烦.
iptables 也能实现,
简单的方法就不清楚了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP