Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-14-2004, 04:32 AM
|
#1
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Rep:
|
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
|
|
|
10-14-2004, 06:34 AM
|
#2
|
Member
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512
Rep:
|
oops i didnt read the post, yes, you can do that. i havent looked at how.
Last edited by Frustin; 10-14-2004 at 06:35 AM.
|
|
|
10-14-2004, 07:33 AM
|
#3
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Original Poster
Rep:
|
That is all nice, I have been told numerous times its do-able, does anyone perhaps know how
Thanks guys
|
|
|
10-14-2004, 07:35 AM
|
#4
|
Member
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512
Rep:
|
i would like to quote you on your first edit: " is it at all possible ?", to which i answered yes.
|
|
|
10-14-2004, 07:51 AM
|
#5
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Original Poster
Rep:
|
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
|
|
|
10-14-2004, 07:58 AM
|
#6
|
Member
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512
Rep:
|
gimmie a bit to think about it and do a bit of googling.
|
|
|
10-14-2004, 08:00 AM
|
#7
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Original Poster
Rep:
|
thanks !
|
|
|
10-14-2004, 08:21 AM
|
#8
|
Member
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620
Rep:
|
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;
}
|
|
|
10-14-2004, 08:41 AM
|
#9
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Original Poster
Rep:
|
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
|
|
|
10-14-2004, 09:03 AM
|
#10
|
Member
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620
Rep:
|
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.
|
|
|
10-14-2004, 09:29 AM
|
#11
|
LQ Newbie
Registered: Oct 2004
Posts: 6
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 03:45 PM.
|
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
|
|