auto ip assigning according to username!

Taking care of your Linux box.

auto ip assigning according to username!

Postby TheElectron707 » Thu Feb 05, 2004 4:08 pm

I wanted to ask if the following scenario is possible or not:

my client (windows/linux) starts it machine, connected to a lan.
it asks for a IP for its machine (DHCP)
my DHCP server before assigning any IP asks for a USER/PWD
depending upon user/pwd a specific ip (amongst a range) is given.

i have been reading dhcp howtos but i was unlable to find user/pwd dependent ip allocation. i donot want the default STATIC ALLOCATION which is based upon the MAC address, as the no. of clients in my organisation is toooo large and managing user names is much easier and if i can assign IPs according to user names, the IP based rulez (very common in linux) are much easier for me to implemnt and maintain.

thanx in advance.
TheElectron707
TheElectron707
Lance Naik
 
Posts: 28
Joined: Sun Jun 08, 2003 10:46 am
Location: Lahore

give this a try

Postby arifishaq » Fri Feb 06, 2004 8:49 pm

It doesn't seem quite feasible to me, honestly. DHCP comes into action while your client is booting. The IP address has already been assigned by the time you get to know who the user is (assuming that on a given computer, any user can sit down and log in).

However, you may want to try the Internet Systems Consortium site http://www.isc.org/index.pl?/sw/dhcp/ They provide a freely redistribuitable reference implementation of the DHCP client and server.

Here is a snippet from their DHCP FAQ. It may make some sense to you. I haven't had too much time to go through this stuff. Sorry.

[i]I want to hand out specific (fixed) IP address to clients.
Q: I need the dhcp server to give out fixed ip address to each client. So when each machine boots dhcp will give the same address to each one.
A: Write a host statement for each machine with a fixed-address declaration and a hardware declaration, and then declare ``boot-unknown-clients false;'' at the top level. This is all documented in the dhcpd.conf.5 man page.

[/i]

Good luck!
arifishaq
Lance Naik
 
Posts: 39
Joined: Fri Oct 03, 2003 2:20 pm

Postby TheElectron707 » Fri Feb 06, 2004 10:21 pm

Well, yes i am aware of that, one can assign STATIC ip based on the MAC address of the ethernet card. but the no. of clients is very large that i might not be able to handle individual ips so how can i handle a very very long mac address for each client. plus i will have to go through much tourble if any client changes in NIC as he will get a new MAC.........

but thanx for ur concern.
TheElectron707
TheElectron707
Lance Naik
 
Posts: 28
Joined: Sun Jun 08, 2003 10:46 am
Location: Lahore

Postby zaeemarshad » Wed Feb 11, 2004 3:30 pm

hmmm.. i smell scripting here. :) . You can log all the mac addresses accessing your firewall with a script going through all the entries and filtering out all the previously unknown mac addresses. learning a bit of awk might help. otherwise what you are asking for may not be possible. I remember that squid uses some identd server to block specific usernames but dunno if that will work with dhcp or not. There doesnt seem to be such an implementation in all the dhcp servers available.

Regards
Zaeem
zaeemarshad
Lieutenant Colonel
 
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Website: http://zaeem.no-ip.org
WLM: zarshadvirk@hotmail.com
Yahoo Messenger: negativecreep61@yahoo.com
AOL: zarshadvirk
Location: Islamabad

there might just be ...

Postby arifishaq » Thu Feb 12, 2004 3:36 pm

I have re-read more carefully what you ask for and that scenario is not standard DHCP interaction so you won't find any DHCP server that implements it. Besides, I'm not sure how the user/password scheme would work on the client side even if it were done at the server.

However, that scenario is a hypothetical solution to your problem which seems to be that of assigning IP addresses in function of who is asking for it without having to go through the pain of obtaining the MAC addresses of all machines in your network.

If that's the problem, there may be a simpler solution which does not require the MAC address. You could assign a fixed address by host name alone. Of course there is no guarantee the host name will be unique but if you are careful it could work. The dhcpd.conf(5) man pages explain how this can be done but the wording is really confusing and you may have to experiment a bit to make it work.

Best of luck.
arifishaq
Lance Naik
 
Posts: 39
Joined: Fri Oct 03, 2003 2:20 pm


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 1 guest