auto ip assigning according to username!

Taking care of your Linux box.
Post Reply
TheElectron707
Lance Naik
Posts: 28
Joined: Sun Jun 08, 2003 10:46 am
Location: Lahore

auto ip assigning according to username!

Post by TheElectron707 »

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
arifishaq
Lance Naik
Posts: 39
Joined: Fri Oct 03, 2003 2:20 pm

give this a try

Post by arifishaq »

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!
TheElectron707
Lance Naik
Posts: 28
Joined: Sun Jun 08, 2003 10:46 am
Location: Lahore

Post by TheElectron707 »

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
zaeemarshad
Lieutenant Colonel
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Location: Islamabad
Contact:

Post by zaeemarshad »

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
arifishaq
Lance Naik
Posts: 39
Joined: Fri Oct 03, 2003 2:20 pm

there might just be ...

Post by arifishaq »

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.
Post Reply