LinuxQuestions.org
Review your favorite Linux distribution.
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 03-23-2012, 12:25 PM   #1
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Rep: Reputation: Disabled
dhcp leases on different subnets


Hello guys,

not shure if this is linux related but it involves linux too

I've got one problem. I have dhcp server running on Win server 2003 which sholud supply ip addresses on four subnets. The problem is that I want for clients on specific subnet to get ip address from specific range. For example: client issue broadcast message requesting dhcp server, dhcp offers him ip address and what I want to happen is that that offer is from specific range for that subnet for example 192.168.1.10-254. So is there ayn way to configure client (like set dhcp class on client maybe) so dhcp could recognize from which pool of ip address should it offer a lease??

Offcourse if I've a router and every network segment goes to one router's nic which is configured with ip address from that range,dhcp will know from which range to issue ip address am I wright? But the problem is that I have Debian firewall/gateway and three nic's. One nic is connected to my adsl modem and is configured with pppoe connection and firewall separates those two networks (private and public). Two other nics are in bond mode (trunk mode) so there's only two nic's (one with pppoe and the other one virtually adapter). That virtually adapter ip address is for example 192.168.0.1 and four alias ip addresses (for every subnet) so when broadcast message reaches dhcp it sees request from 192.168.0.1.

Is there any way around this? Some solution maybe which I can apply to my clients so dhcp will know by client configuration from which pool to issue a lease. Client computers runs on win xp. Thanks
 
Old 03-23-2012, 03:48 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you have multiple subnets then a dhcp server will give a lease based on the subnet it came from. There is no magic configuration required. If you define dhcp config declarations for a certain subnet, then that subnet will be served either based on the local subnet, or the data in the bootp relay packet if you're using a dhcp relay agent on a router / switch.
 
Old 03-23-2012, 06:19 PM   #3
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
Yes, I understand that, but the problem is that router on which clients are connected (Debian) is on 192.168.1.1 and other for subnets are actually ip alias address on bond0 interface (192.168.1.1). So two nics are in bonding mode. Bond0 interfac ip address is 192.168.1.1. Alias ip address on bond0 interfaces are 192.168.2.1, 3.1, 4.1, 5.1 so it can route traffic on those subnets. What happens when clients broadcast dhcp requests is that they will get ip address from 192.168.1.0 range am I wrigh? So i thing that there's no solution to this problem in implementation like this. If I want it to work I sholud remove alias ip addresses and buy 4 new nics and than plug it to the switch. Or it could be achived with alias ip addresses?
 
Old 03-24-2012, 01:04 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you are using an *ALIAS* on an interface, bonded or otherwise - that much is irrelevant, that is not in the same subnet, then that is WRONG, and you should NEVER do that. If you have tagged vlan interfaces on the same nic, then that is just fine, and everything will behave as if they were separate nics.
 
Old 03-24-2012, 02:01 PM   #5
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
... "(Debian) is on 192.168.1.1 and other for subnets are actually ip alias address on bond0 interface (192.168.1.1)"... That was just an example, this is my real config:

etho - 192.168.100.5/30 (interface that is connected to my modem and got pppoe connection running on top off it)

eth1 and eth2 are in bond mode!

bond0 - 192.168.100.6/30

bond0 alias ip addresses are:

192.168.100.62/27
192.168.100.94/27
192.168.100.126/27
192.168.100.158/27

Dhcp address is 192.168.100.33/27 with default gateway 192.168.100.62/27

So what I want to accomplish is that when client requests ip address from example 192.168.100.64/27 subnet that it gets ip address from that range (gateway which will provide relay should be alias ip address 192.168.100.94/27) and not from 192.168.100.4/30 range which is my bond0 primary address.
But what I am not shure is that how it could be accomplished becouse dhcp discovery are broadcast packets with source ip 0.0.0.0. How my router could recognize which subnet I want to apply to that host??? That's the reason why I thought that I must implement something to client computers so dhcp could recognize incoming dhcp requests with subnet I want to use for that host. An example of somethink like this are client dhcp classes. If you want different configuration for some clients on the same network, you could configure hosts with different dhcp classes and on dhcp server setup specific configuration for that class (for example different router address than one specified for default scope) I konw it's a little bit messy but i really need help!
Is this ok? Can it work somehow like this or should I change something?

Thanks for replays!

Last edited by tech_soul8; 03-24-2012 at 02:05 PM.
 
Old 03-24-2012, 02:04 PM   #6
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
If you have tagged vlan interfaces on the same nic, then that is just fine, and everything will behave as if they were separate nics.
...and offcourse I could use tagged interfaces but I dont have vlan capable switches
 
Old 03-24-2012, 02:17 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
those are different subnets, it is not meant to work, dhcpd knows what interface it is listening on, and will only give leases for that subnet. Fix your networking, don't hack around its faults.
 
Old 03-24-2012, 02:24 PM   #8
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
those are different subnets, it is not meant to work, dhcpd knows what interface it is listening on, and will only give leases for that subnet. Fix your networking, don't hack around its faults.
You mean I have to change my bond0 address and put it in /27 range??
 
Old 03-25-2012, 03:10 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
No I mean not break fundamental tcp/ip addressing principles and only use one subnet. Buy a vlan capable switch, buy more nics or some other sort of responsible redesign. Is this in a business?? I really hope not.
 
Old 03-25-2012, 06:47 AM   #10
tech_soul8
Member
 
Registered: Aug 2011
Posts: 75

Original Poster
Rep: Reputation: Disabled
No this is not a business and that's the reason why configuration looks like this. This is something what I choose for my final exam and the reason why I'm trying to set it up like this is becouse I lack professional equipment and I'm running it all on virtualbox to be shure that everythig is working ok the way I implement it. In real world scenario router would have 5 nics with separate subnets and than everything would be easy.
 
  


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
dhcp leases BFCsaus Linux - Newbie 1 04-27-2010 05:39 PM
Wrote 0 leases to leases file - DHCP server lionel.rpm Linux - Server 3 07-22-2009 06:05 PM
DHCP on CentOS 4.7 - /var/lib/dhcp/dhcpd.leases: Permission denied Latitude Linux - Networking 1 06-05-2009 02:08 AM
dhcp not writing leases oberon-ken-obi Linux - Newbie 8 04-14-2005 01:44 PM
DHCP leases file not being generated. abhijeetudas Linux - Networking 1 09-25-2004 10:31 PM

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

All times are GMT -5. The time now is 10:01 PM.

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