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.
|
 |
01-05-2011, 11:56 AM
|
#1
|
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Rep:
|
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?
|
|
|
|
01-05-2011, 02:30 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
|
01-05-2011, 02:49 PM
|
#3
|
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
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.
|
|
|
|
01-05-2011, 02:54 PM
|
#4
|
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
|
01-05-2011, 03:00 PM
|
#5
|
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
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?
|
|
|
|
01-05-2011, 04:05 PM
|
#6
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
|
01-05-2011, 04:09 PM
|
#7
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
|
01-05-2011, 04:34 PM
|
#8
|
|
Member
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770
Original Poster
Rep:
|
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.
|
|
|
|
01-05-2011, 06:24 PM
|
#9
|
|
Member
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246
Rep:
|
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
|
|
|
|
All times are GMT -5. The time now is 05:03 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
|
|