LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-05-2011, 11:56 AM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
dhcrelay by MAC address?


Ive searched far and wide and cant seem to find an answer and I suspect its not possible. But I need to ask anyways.

I have a CentOS 5.4 server with DHCP server working. Its currently setup to handle DHCP requests for 2 VLANs. I have a 3rd VLAN that has its own DHCP server. I am wondering if I can setup dhcrelay to relay based on MAC address and relay it to the DHCP server for that VLAN.


I have a private domain with 16 WIN2K8R2 servers plus a WIN2K8R2 DC. I have 2 DNS servers listed for the network interface. The first one is for the DC, the second is for the public network. The windows interface is picking up a DHCP IP from a DHCP server that is on the same subnet as the DC instead of a DHCP server listed on the 2nd DNS subnet. If I switch the order of the DNS servers it picks up the correct IP.

So I was wondering if I could use dhcrelay on my 1st subnet to route incoming DHCP requests with a certain pool of MACs over to the other DHCP server. I know this can be done at the router level but is it possible to do it at the OS level?
 
Old 01-05-2011, 02:30 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
well you wouldn't relay based on MAC, you just don't respond to the relayed bootp request on the server. So you get exactly what you want (as I read it) but you just configure the real remote DHCP for the specific MAC's, not the relay.
 
Old 01-05-2011, 02:49 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Well that's the thing. The correct DHCP server is configured to give IPs based on MACs(both DHCP servers are) But its not hitting the correct DHCP server. Its going to the DHCP server thats on the same VLAN(VLAN1) as the DC. I want it to get the IP from the other DHCP server(VLAN2). If I switch the DNS IPs on the WIN2K8 box it gets the IP based on the DNS IP that is listed first. But I need the DC DNS IP to be listed first. On the router its set so that VLAN2 is supposed to it's DHCP server.


The servers are Cisco UCS with VLAN2 as its native VLAN.
 
Old 01-05-2011, 02:54 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Set the leases forever is one way. I know there is a way to set them to offer based on mac but I can't remember it now.
 
Old 01-05-2011, 03:00 PM   #5
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Hmm. That could work. But I do not have root access on the VLAN2 DHCP server. I do have root access to the VLAN1 DHCP server. Thats why I was hoping to use dhcrelay there. Is there a way to force a WIN2K8 server to use a particular DHCP server?
 
Old 01-05-2011, 04:05 PM   #6
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
Well you can't make a client prefer a certain dhcp server, so you'd also need to condone the other server to NOT answer those requests. Personally I'd not want to use excessive lease times etc., but not to the extent of branding it a bad idea, just not my, erm, style.
 
Old 01-05-2011, 04:09 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
Oh, you might also want to look at using a dhcp class on the client settings, that could actually give you something analogous to 'preferring' a server if they can be told to ignore our require a certain class id.
 
Old 01-05-2011, 04:34 PM   #8
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
I found a simple yet I hope effective, low tech solution. Each server has 2 NICs. Once NIC is for management and the other is used for data. We are running VMs using the data NIC for their network. I set the DNS order on the management NIC to use VLAN2s DNS IP first and on the data NIC set it to use VLAN1s DNS IP. That seemed to have worked. They each get an IP on the correct interface for the correct VLAN.


I'm confused as to why WIN2K8R2 cares about DNS though. Shouldn't they get their DHCP server info from the router/switch? Anyways. I think this will work for me. Just need to verify the VMs pic up the correct network and should be set.

Thanks for the replies.
 
Old 01-05-2011, 06:24 PM   #9
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Hi,

I guess this is what you are looking for: C:\>ipconfig /setclassid "Local Area Connection" MyNewClassId

As acid_kewpie mentioned it you can change the dhcp binding in Windows.

There is the link to dig deeper: http://technet.microsoft.com/en-us/l...8WS.10%29.aspx

It works under Vista so it should work in Win 2008.
There is a script in Windows called netsh to manage the network interfaces from a batch file.
You could change this settings and every parts of the network.

Laz
 
  


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
how do I find what MAC address web pages see as my MAC address rob.rice General 20 05-29-2010 02:08 AM
Ethernet MAC Addresses database; MAC address-based processing cctualatin Linux - Newbie 1 04-14-2009 08:59 AM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM

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

All times are GMT -5. The time now is 02:15 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