LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2011, 03:52 AM   #1
aswinthomas
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Specific DHCP config


Hi all,
Im using Ubuntu and due to the nature of my application, I have to configure a DHCP server that assigns addresses that end with bits '10'. The IP addresses must be of the type 10.x.y.z/22

So some examples of IP addr to be assigned:

10.1.2.2
10.12.18.14
10.6.155.6
10.121.76.22
10.5.45.18
...etc

As you see all the IP addr end with '10' binary bits.

How do I write the dhcpd.conf file?

Thanks a lot in advance
 
Old 02-23-2011, 09:11 PM   #2
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Rep: Reputation: 17
I would say your IP numbers start with 10 instead of ending. Is not it?

If I have got your doubt correctly, here is a peace of code about your dhcpd.conf

Code:
subnet 10.0.0.0 netmask 255.0.0.0 {
range 10.0.0.2 10.253.253.253;
option routers <your IP gateway>;
}
However I am not sure if it realy is what you want.
 
Old 02-23-2011, 11:19 PM   #3
aswinthomas
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Fabio, thanks for your reply.

It is true that the address must start with 10. But the last two BITS of the whole address must also be '10'. So for the examples that I have provided, the last 2 BITS of the whole address i.e. last 2 bits of 2,14,6,22,18 are also '10'.

10.1.2.2
10.12.18.14
10.6.155.6
10.121.76.22
10.5.45.18

Specifying a range 10.1.2.2 to 10.1.2.2 would solve it partially, but that would make it static. I want the server to pick one address from all the 2^22 addresses in 10.x.y.z/22, when a client joins the network. 22 bits and not 24 bits because the last 2 bits must be predefined as '10'.

Hope its more clear. Really, thanks for the attempt.

Cheers
 
Old 02-24-2011, 01:22 AM   #4
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Rep: Reputation: 17
Hi aswinthomas, now I think I see your problem. It seems to be a hard one.

I suppose your configuration should be put as
Code:
netmask = 255.0.0.3
subnet  = 10.0.0.2

Writting that in binaries
Code:
netmask = 11111111.00000000.00000000.00000011
subnet  = 00000110.00000000.00000000.00000010
In this way your server will offer IPs that have the first octects equals 00000110 and the last two bits equals '10' and the rest are free to be anything.

But the problem is the range. I do not know how to put a range of IPs in this way. You must put a list with all IPs and of course it would be impossible.

Last edited by Fabio Paolini; 02-24-2011 at 01:24 AM.
 
  


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
Can I configure to use a specific DHCP server? jakev383 Linux - Networking 1 01-24-2010 04:46 PM
Forcing a specific DHCP server mtecknology Linux - Networking 1 10-10-2007 04:31 AM
DHCP Assign ip to specific MAC address gfem Linux - Networking 2 08-02-2007 02:58 PM
Question: Request a specific IP address from a DHCP server? haertig Linux - Software 2 09-13-2006 04:32 PM
obtaining a specific ip address from DHCP true_atlantis Slackware 5 09-28-2004 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:15 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