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 10-14-2004, 03:32 AM   #1
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Rep: Reputation: 0
Dhcpd two IP ranges via two nics


Hi,

Im have a Fedora 2 Box with two (2) ethernet adapters
I want to configure DHCPD to distribute the 10.0.0.1 / 24 range via eth0
and distrubure 192.168.0.1 /24 range via eth1

Is this possible ?
The reason I want it set like this is I have 1 Linux box, that will act as a DHCP server for two networks as described above.

The one ethernet will be in a Vlan , the second ethernet will be in another vlan hense the configuration to distribute the two IP ranges

Can anyone please help ? is it at all possible ?

Thanks
Riaan
 
Old 10-14-2004, 05:34 AM   #2
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
oops i didnt read the post, yes, you can do that. i havent looked at how.

Last edited by Frustin; 10-14-2004 at 05:35 AM.
 
Old 10-14-2004, 06:33 AM   #3
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Original Poster
Rep: Reputation: 0
That is all nice, I have been told numerous times its do-able, does anyone perhaps know how

Thanks guys
 
Old 10-14-2004, 06:35 AM   #4
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
i would like to quote you on your first edit: " is it at all possible ?", to which i answered yes.
 
Old 10-14-2004, 06:51 AM   #5
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Cool, sorry for that. Its just becoming a frustration at the moment.
I cant kinda gather u wont be able to do it, because of the fact that your nics are on your network layour, and the fact that you cant run two instances of dhcpd.


anyone have got any input regarding this will be greatly appreciated
 
Old 10-14-2004, 06:58 AM   #6
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
gimmie a bit to think about it and do a bit of googling.
 
Old 10-14-2004, 07:00 AM   #7
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Original Poster
Rep: Reputation: 0
thanks !
 
Old 10-14-2004, 07:21 AM   #8
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
If I'm understanding your post correctly - just add two subnet declarations to dhcpd.conf, one for each interface/network. Something like the following should work, just edit to meet your requirements. Note: This is a copy/paste from my own dhcpd.conf

Code:
#################################################
# GLOBAL Options: Every DHCP enabled client
# will inherit the following options unless
# overiden within the subnet/host scopes.
# below
#################################################
authoritative;
option domain-name-servers 192.168.9.3, 192.168.8.2;
option domain-name "mydomain.com";
option netbios-name-servers 192.168.9.2;
option netbios-node-type 8;
 
# If some clown tries to request a rediculous lease
# time (like 365 days), set resonable values here.
min-lease-time 60;              # 1 Hour
default-lease-time 86400;       # 1 Day
max-lease-time 172800;          # 2 Days

subnet 192.168.8.0 netmask 255.255.255.0 {
 
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.8.255;
    option routers 192.168.8.1;
}

subnet 192.168.9.0 netmask 255.255.255.0 {
 
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.9.255;
    option routers 192.168.9.1;
}
 
Old 10-14-2004, 07:41 AM   #9
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the reply.

You are kinda answering my question although let me explain to you the actual problem

a) My eth1 issues IP range 192.168.0.1 /24
b) My eth0 issues IP range 10.0.0.0 /24

Now depending on where you come from (So in other words) which interface you request the information from you get the relevant IP

Now, in the ..../sysconfig/dhcpd I have allowed both ethernet's to listen for request

Now the problem comes in where you move a PC from a ethernet network to the other, the lease file remembers that it was a 192, now its a 10, and it confuses itself.

So the solution either is , to script the lease to clear every 1 hour, or to lease every 1 hour (but by doing this , you kinda miss the purpose of what you want to achieve)

Hope this helps

Another thing is you cant run two instances of dhcpd
I have tried starting it via script to use its own conf file and lease file, but you can only run one instance and it defaults back to the /etc/dhcpd.conf file


Spoken to alot of linux guys , they say im trying to be clever , but I'm more than sure, there must be a way

Thanks Guys

Riaan
 
Old 10-14-2004, 08:03 AM   #10
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Why can't you create a group/pool (see man dhcpd.conf) within the subnet declaration for your laptops. Then make the lease time for these laptops something like 5 minutes. Then the desktps PC's will inherit the global 1 day lease, your laptops 5 minutes.
 
Old 10-14-2004, 08:29 AM   #11
rvjaarsveld
LQ Newbie
 
Registered: Oct 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hi Yip , That was an Option

I have it working!!!!!!!!!

Only thing u need to do is specify the two ranges as per your config, and them in /etc/sysconfig/dhcpd remove everything


so in essence , dont allow any ethernet to listen , otherwize it keeps the old config


Thanks for the help guys.

If anyone wants to do what I did, and Cant figure it out via these posts, please just reply to this post, and I will try my best to help you as well


Regards
Riaan
 
  


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
dhcpd subnet declaration problems in dhcpd.conf vcrispo Linux - Networking 6 07-15-2005 10:32 AM
Blocking IP Address ranges in dhcpd.conf pmcdaid Linux - Networking 4 06-09-2004 09:18 AM
DHCPD startup failure, mdk 9.2, dhcpd v3.0.1rc11 fuzzyworm Linux - Networking 1 02-14-2004 03:58 AM
dhcpd.conf with 2 NICS TheRealDeal Linux - General 1 11-19-2003 03:23 PM
need help with dhcpd.conf file running two nics hwb0014 Linux - Networking 4 08-28-2002 11:47 AM

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

All times are GMT -5. The time now is 08:10 AM.

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