LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-02-2007, 12:21 AM   #1
alix123
Member
 
Registered: Nov 2004
Posts: 63

Rep: Reputation: 15
Question Single DHCP server ,to provide the ip address to a MAC address in two different subne


Can a single DHCP server ,provide the ip address to a MAC address in two different subnets

For example i have a client whose mac address :- 00:9F:55:34:56:55 & assuming that there are two different subnets such as 10.201.202.0/24 and 10.201.200.0/24

I have to statically bind this MAC address ip address (a must)

so when the client is connected to the 1st physical network ,10.201.202.0/24 DHCP should issue ip addrss 10.201.202.10

and when the client is connected to the 2nd physical network ,10.201.200.0/24 DHCP should issue ip addrss 10.201.200.10

If iam not wrong the DHCP needs to have ip address & physical interface in each subnet? Can i use a single physical interface assined two different virtual address in each subnet.?

is there anything i need to change on clients?

Can some body provide the simple dhcp.conf file , iam able to implement my dhcp for single subnet ,but I'am really confused with two different subnets.

Last edited by alix123; 05-02-2007 at 12:22 AM.
 
Old 05-02-2007, 02:28 AM   #2
Gryyphyn
Member
 
Registered: Dec 2006
Location: Ogden, UT (Go OALUG!)
Distribution: OpenSuSE 10.1
Posts: 61

Rep: Reputation: 15
Question

Quote:
Originally Posted by alix123
Can a single DHCP server ,provide the ip address to a MAC address in two different subnets

For example i have a client whose mac address :- 00:9F:55:34:56:55 & assuming that there are two different subnets such as 10.201.202.0/24 and 10.201.200.0/24

I have to statically bind this MAC address ip address (a must)

so when the client is connected to the 1st physical network ,10.201.202.0/24 DHCP should issue ip addrss 10.201.202.10

and when the client is connected to the 2nd physical network ,10.201.200.0/24 DHCP should issue ip addrss 10.201.200.10

If iam not wrong the DHCP needs to have ip address & physical interface in each subnet? Can i use a single physical interface assined two different virtual address in each subnet.?

is there anything i need to change on clients?

Can some body provide the simple dhcp.conf file , iam able to implement my dhcp for single subnet ,but I'am really confused with two different subnets.
Wow, that's a loaded question... Are you taking something like a laptop to two different subnets or are you doing vsys/vlan routing for different services from one NIC in the same network environment?

If you're running back and forth between two networks with one box then you should be able to bind the mac to a specific IP on the router/DHCP server. Routers like Linksys and Juniper Netscreen allow this.

As far as I know there's no way to do this client side. You'd have to request a specific IP from the client, possibly through a script, but I don't think that's really a solution for your issue.

If you're doing some type of advanced routing then it's not IP binding, it's service binding and advanced routing that needs to be resolved.

Give some more detail about the network environment and it would be a lot easier to give advice. Information such as routers on the network and connection type are particularly helpful for this kind of situation.

Gryyphyn, out.
 
Old 05-04-2007, 08:53 PM   #3
alix123
Member
 
Registered: Nov 2004
Posts: 63

Original Poster
Rep: Reputation: 15
Question yes my hosts are switching back & forth in two vlans

Hii thanks for the reply

yes my hosts are switching back and forth in two different vlans ,my dhcp should remain constant once it is setup ,however if there
topology change for example if my host was in 200 vlan will now be in 202 vlan ,so each time the dhcp should issue the ip address based on that vlan.
 
Old 05-06-2007, 12:24 AM   #4
Gryyphyn
Member
 
Registered: Dec 2006
Location: Ogden, UT (Go OALUG!)
Distribution: OpenSuSE 10.1
Posts: 61

Rep: Reputation: 15
Unhappy

Quote:
Originally Posted by alix123
Hii thanks for the reply

yes my hosts are switching back and forth in two different vlans ,my dhcp should remain constant once it is setup ,however if there
topology change for example if my host was in 200 vlan will now be in 202 vlan ,so each time the dhcp should issue the ip address based on that vlan.
If I understand your topology correctly then I'm not sure that there is much of a solution.

If you were traipsing between two different LANs then it would be simple. The problem is that your client/host would broadcast a request and wait for a reply. The first server to reply is the one that's going to give out the IP. If that's one server then your host is going to already be registered and will be assigned an IP from the primary list.

In order to do what you're talking about you'd have to have some way to make a choice between which IP you get.

Let's make sure I've got your configuration right: you have one switch/router, multiple clients and a DHCP server that's behind everything. You have multiple servers in the network, separated by a router of some kind that's doing your VLAN separation and you need one box to access them all.

If that's correct I'd have an allowed client policy/ACL that would direct traffic based on requested port from specific IP. Make sure that you get the same IP from the DHCP server every time by MAC and use the router like it's designed: to route from one LAN or VLAN to another. That's the only solution I can think of without more specific information about your topology.

Gryyphyn, out.
 
Old 05-08-2007, 12:25 AM   #5
alix123
Member
 
Registered: Nov 2004
Posts: 63

Original Poster
Rep: Reputation: 15
Question Well here is my exact topology

1) switch /router
2) linux box acting as a DHCP server.
3) two subnets 10.201.202.0/24 & 10.201.200.0/24
4) two vlans 20 ,22

basically iam trying to do pxe based installation,thats why i need the DHCP server.

So my objective if somebody plugs in the PC(physically) to 10.201.200.0/24 subnet or topology changes he should be able to get the ip address from dhcp

similarly if somebody plugs in to 10.201.202.0/24 he also should able to get the ip address from dhcp.

I can statically bind the MAC->ip ,because I have list of MAC address/pc that cab be plugged.

currently my dhcp is in 20 vlan giving dhcp ip address to PC's in 20 vlan and this is working fine.

I want the same dhcp server to issue the ip address to PC's on 22 vlan.

it may be possible sometimes ,assuming that a device 'A' whose MAC address is 00:aa:5f:00:90:fg is connected to 20 vlan or it may be connected to 22 vlan.So DHCP should offer the ip address depending upon the port/vlan/subnet the request came in??

Last edited by alix123; 05-08-2007 at 12:27 AM.
 
Old 05-09-2007, 12:16 AM   #6
Gryyphyn
Member
 
Registered: Dec 2006
Location: Ogden, UT (Go OALUG!)
Distribution: OpenSuSE 10.1
Posts: 61

Rep: Reputation: 15
Cool

Quote:
Originally Posted by alix123
So DHCP should offer the ip address depending upon the port/vlan/subnet the request came in??
Not exactly. When a client connects to a network there's four DHCP packets that get sent:

Syn (hello & request)
Syn/Ack (reply and 'what do you need?')
Syn/Ack (need IP address, here's my mac)
Ack (got your mac, here's your IP)

Problem is that the DHCP server has to be on the same subnet as the requesting client. I see three possible solutions:

1. Add a NIC to your DHCP server, making it multi-honed, and tie the second NIC to 22.

2. Set up relay agent. A relay agent is on the same subnet and will forward the request to a specific destination IP, then return the Ack to the requesting client. But I'm not sure how to accomplish this outside of the Win realm so I couldn't help with that.

3. Make your router the relay agents. The primary problems with this is a) your router wants to be the DHCP server anyways; b) the routers that can do this are fairly expensive; and c) it would defeat the purpose of having a dedicated Linux DHCP server.

My personal advice is to go with the relay agent. You can then specify through the server options to have all requests coming in eth0 to get assigned an IP from the 20 vlan/200 net (like it's already set up now) and inbound to eth1 would be assigned an address from vlan22/sub 202.

Hope all of this makes sense for you. It's pretty much the limit of my knowledge now.

If anyone else can lend some assistance I'm sure it would be appreciated. Hope everything goes well for you!

Gryyphyn, out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Exclude a mac Address in Dhcp server alnmostafa Linux - Networking 3 12-30-2006 10:20 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 05:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 11:33 AM
why linux DHCP provide reverse ip address to itd node? arpit Linux - Networking 0 05-30-2004 03:51 AM
ISC DHCP Server MAC Address dlucas10 Linux - Networking 1 05-25-2004 06:49 PM


All times are GMT -5. The time now is 11:04 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration