| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-08-2010, 03:43 AM
|
#1
|
|
Member
Registered: Apr 2010
Posts: 54
Rep:
|
fixed address in dhcp server
Hi all,
I want to set up a dhcp server such that the clients get same ip every time. Giving fixed address to every client would be a long process.
"I don't want to assign a specific ip to the client but what i want is the server provides same ip every time"
Is there a way. Thanks in advance
|
|
|
|
07-08-2010, 04:36 AM
|
#2
|
|
Member
Registered: Aug 2006
Posts: 601
Rep:
|
You can make the lease very long.
But I would not rely on it if you want to firewall specific IPs.
On all platforms you will have to add entries "manually".
Actually, if you create a list of mac addresses and of IPs, you can very easily script adding all the IPs.
|
|
|
|
07-08-2010, 05:48 AM
|
#3
|
|
Member
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94
Rep:
|
You would want to assign IP per MAC address,
This is a sample...
Quote:
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.3;
option subnet-mask 255.255.255.0;
range 192.168.0.20 192.168.0.90;
default-lease-time 216000;
max-lease-time 432000;
host HostA {
hardware ethernet 00:16:6f:62:49:b4;
fixed-address 192.168.0.20;
}
host HostB {
hardware ethernet 00:1f:3c:8c:4a:e0;
fixed-address 192.168.0.21;
}
}
|
|
|
|
|
07-08-2010, 06:21 AM
|
#4
|
|
Member
Registered: Apr 2010
Posts: 54
Original Poster
Rep:
|
I was wondering if there's a way server provides same ip without assigning ip per MAC address. I have clients more than 70 and binding all MAC would be a headache....Is there a way server does this automatically?
Thanks
|
|
|
|
07-08-2010, 08:00 AM
|
#5
|
|
Member
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94
Rep:
|
You could set that a lease never expires in the leases file:
lease 192.168.0.88 {
starts 3 2010/03/24 19:26:19;
ends never;
tstp 3 2010/03/24 21:22:09;
binding state active;
hardware ethernet 00:0c:29:45:15:3c;
}
Note that the leases file is build with the MAC address, you won't have to declare it per IP.
If you have a populated leases database, you could set all the leases to "ends never;" using sed...
# mv dhcpd.leases old.dhcpd.leases && sed 's/ends .*;/ends never;/g' old.dhcpd.leases > dhcpd.leases
|
|
|
|
07-08-2010, 11:26 PM
|
#6
|
|
Member
Registered: Apr 2010
Posts: 54
Original Poster
Rep:
|
Thanks, I'll give it a try
|
|
|
|
07-09-2010, 01:33 AM
|
#7
|
|
Member
Registered: Aug 2006
Posts: 601
Rep:
|
As I said, you can script it.
You will have the same issue having to put the stanza with the mac there 70 times.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:44 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|