LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-27-2015, 02:54 AM   #1
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Rep: Reputation: Disabled
Post Mac Address configuration in DHCP Server Ubuntu 14.04 LTS


Hi All,

I have configured the DHCP 3 server on Ubuntu 14.04 LTS and releasing the IP Address on all device.

Now I want to register the mac address to only 150 device not for all and I don't want to put the manually mac address on dhcpd.conf file for the same.

So please can someone help me how can I do this.

Thanks & Appreciation in Advance.
 
Old 07-27-2015, 05:09 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
I don't think there is a quick solution to this. The configuration of dhcp somehow needs to know the mac and corresponding hostname. So first you need a list of macs and hostname. With that you could use bash to generate the config file and have it include this by dhcp.conf. This way you can update the file without messing with your generel dhpc.conf.

To get a list of macs on your network try nmap -P 192.168.0.0/16 to scan your network. Then have this go through grep or awk and you have a list of macs. But only those that are alive. The ping does not really need to succed.

Sorry pal you have to do the paperwork.
 
Old 07-27-2015, 06:50 AM   #3
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for reply of my issue,

I want that can be deny to everyone to get the IP Address from dhcp server and allow only specific mac address (150 mac address) in the dhcpd.conf file, create one file with the 150 mac address and mentioned in the dhcpd.conf file. If it is possible


Thanks & Appreciation in Advance.
 
Old 07-30-2015, 01:36 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Rephrasing your question does not really help.

1.) Get a list of mac address to be allowed
2.) Create an entry for each of the macs within dhcpd.conf

config snip from the dhcpd.conf man page
Quote:
host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
 
Old 07-30-2015, 01:49 AM   #5
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Is there any possible to create one file of mac address (150 users mac address of mobile device) and configure that file in dhcpd.conf for mac filtering

for example squid Proxy have the mac address based filtering in below link 3 point (Block All Sites for Multiple MAC Addresses).

http://tecadmin.net/configure-squid-...sed-filtering/

So please can we do or not in dhcpd.conf ....


Thanks & Appreciation in Advance.
 
Old 07-30-2015, 02:22 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
No, not that way.
 
Old 07-30-2015, 02:36 AM   #7
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Post

So I can mention the 150 mac address manually in dhcpd.conf file, so please can you provide the step by step configuration of it.

Thanks & Appreciation in Advance.
 
Old 07-30-2015, 06:48 AM   #8
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Actualy I provided some ways to do this. And I won't do the work for you.
 
Old 07-30-2015, 08:53 AM   #9
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
don't work foe me but can you tell me the way for it

Thanks & Appreciation in Advance.
 
Old 07-31-2015, 01:40 AM   #10
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Whats not workin?
 
Old 08-04-2015, 02:27 AM   #11
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Any news here?
 
Old 08-04-2015, 02:43 AM   #12
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
I want to deny all device and configure the others mac address to assign the ip address but it not assign the ip address, I have gone through below links

http://askubuntu.com/questions/41325...r-dhcp3-server


please can you help me with some document by steps configuration.

Thanks & Appreciation in Advance.
 
Old 08-05-2015, 01:42 AM   #13
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
The last post of your link has the needed conifg snippet. Use that and add all macs htat you want to allow.
 
Old 08-05-2015, 02:02 AM   #14
sjain_ivp
LQ Newbie
 
Registered: Nov 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Post

I have tried but getting the error mentioned below, So please can you provide some document step by step configuration.


[63249.140123] init: isc-dhcp-server main process (2808) killed by TERM signal
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 57: expecting allow/deny key
Aug 5 12:10:34 ivpsquid dhcpd: deny unknow-clients;
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 57: expecting a parameter or declaration
Aug 5 12:10:34 ivpsquid dhcpd: deny unknow-clients;
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 58: unexpected end of file
Aug 5 12:10:34 ivpsquid dhcpd:
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: Configuration file errors encountered -- exiting
Aug 5 12:10:34 ivpsquid dhcpd: Internet Systems Consortium DHCP Server 4.2.4
Aug 5 12:10:34 ivpsquid dhcpd: Copyright 2004-2012 Internet Systems Consortium.
Aug 5 12:10:34 ivpsquid dhcpd: All rights reserved.
Aug 5 12:10:34 ivpsquid dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 57: expecting allow/deny key
Aug 5 12:10:34 ivpsquid dhcpd: deny unknow-clients;
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 57: expecting a parameter or declaration
Aug 5 12:10:34 ivpsquid dhcpd: deny unknow-clients;
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: /etc/dhcp/dhcpd.conf line 58: unexpected end of file
Aug 5 12:10:34 ivpsquid dhcpd:
Aug 5 12:10:34 ivpsquid dhcpd: ^
Aug 5 12:10:34 ivpsquid dhcpd: Configuration file errors encountered -- exiting
Aug 5 12:10:34 ivpsquid kernel: [63249.155088] init: isc-dhcp-server pre-start process (3512) terminated with status 1
Aug 5 12:10:56 ivpsquid dhcpd: Internet Systems Consortium DHCP Server 4.2.4
Aug 5 12:10:56 ivpsquid dhcpd: Copyright 2004-2012 Internet Systems Consortium.
Aug 5 12:10:56 ivpsquid dhcpd: All rights reserved.
Aug 5 12:10:56 ivpsquid dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Aug 5 12:10:56 ivpsquid dhcpd: Internet Systems Consortium DHCP Server 4.2.4
Aug 5 12:10:56 ivpsquid dhcpd: Copyright 2004-2012 Internet Systems Consortium.
Aug 5 12:10:56 ivpsquid dhcpd: All rights reserved.
Aug 5 12:10:56 ivpsquid dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Aug 5 12:10:56 ivpsquid dhcpd: Wrote 92 leases to leases file.
 
Old 08-05-2015, 07:18 AM   #15
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Please post your dhcpd.conf with comments removed.

Quote:
grep -v '^#' /etc/dhcpd/dhcpd.conf
I guess you either missed the ending ; on line 56 or did not use "deny unkown-clients" in a pool section
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[help] DHCP server with MAC address manhte1 Linux - Server 1 03-01-2012 02:30 AM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
Exclude a mac Address in Dhcp server alnmostafa Linux - Networking 3 12-30-2006 09:20 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
ISC DHCP Server MAC Address dlucas10 Linux - Networking 1 05-25-2004 05:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration