Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DHCP | IP based on hostname : How?

Status
Not open for further replies.

frummel

Technical User
Jun 21, 2002
91
NL
Hi, I configured my DHCP Server like this:

Code:
ddns-update-style ad-hoc;

subnet 192.168.123.0 netmask 255.255.255.0 {
	option routers			192.168.123.254;
	option subnet-mask		255.255.255.0;
	option broadcast-address	192.168.123.255;

	option nis-domain		"flash.homeip.net";
	option domain-name		"flash.homeip.net";
	option domain-name-servers	62.100.32.85, 195.18.27.141;

	option time-offset		3600; 		# Central European Time (CET)

	range 192.168.123.11 192.168.123.20;

	default-lease-time		86400;
	max-lease-time			86400;
	
}

Everything works fine, but what I want is:
Assign IP Addresses based on hostname.

For instance:
Client01 gets IP 192.168.123.11
Client01 gets IP 192.168.123.12

And so on.

Assigning IP's by MAC is not an option!

Thanks for your help.
 
I do it for some addresses for 2 reasons. 1) on is my laptop which is my testbed for new releases, so I'm constantly throwing the latest distro of this or that on it and it just saves having to keep entering that info (yes, I'm *that* lazy). B) I have specific firewall rules for my laptop and also a spare pcmcia card that I lend whenever someone comes over and wants to get on the internet.

That being said, you don't assign IPs based on hostname, you assign hostnames based on IPs, both in dns and via DHCP. You assign an IP, and therefore hostname, based on MAC address, and this is how you do it:

Code:
host echo {
    hardware ethernet 00:0C:41:40:BD:D5;
    fixed-address 192.168.1.5;
    option host-name "echo.brunson.com";
}
 
Hmmm... That is an option... Setting the hostname and IP based om MAC...

Does this work for Windows 2000 / XP clients too?
 
Yes, MACs are MACs. Assuming you are dealing with DHCP enabled MACs then you're all set.

The downside for using MAC assignment is that you need to remember to maintain the DHCP IP config if you change or add a NIC to one of your statically-assigned machines.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top