Monday, June 24, 2013

How to configuer DHCP Servers with Multiple NIC ?

Edit your /etc/sysconfig/network-scripts/ifcfg-eth* files and specify 
which ones should be using DHCP.
Well.... It totally depends on what you need to do :) 
Here's a simple config that services one nic but not the other (sanitized) 
ddns-update-style interim; 
ddns-updates off; 
subnet xxx.194.0 netmask { 
range xxx.194.40; 
default-lease-time 86400; 
max-lease-time 86400; 
option routers xxx..194.126; 
option ip-forwarding off; 
option broadcast-address xxx.194.127; 
option subnet-mask; 
option domain-name-servers xxx.101.8, xxx.1.29; 

subnet netmask { 

When a DHCP client broadcasts a request, it does so to If your DHCP server has more than on NIC you have to add a route for for the interface you want to send the reply. If you don't, the request is sent to the default gateway. 
From this point I'll assume eth0 is the NIC of choice for your DHCP interface 
This could be as easy as 
route add -host dev eth0 
but that won't survive a reboot. 
You will want to add a permanent route - so you will want to include that route add command to /etc/rc.local 
Hi - 
If I recall correctly, dhcpd doesn't deal with "interfaces" directly, but rather, resolves which interface it is dealing with based on which subnet is bound to which NIC. It makes perfect sense really, as a DHCP server could serve multiple networks on as many as one or infinite networks. 
Just be wary of which IP is bound to which interfaces, and don't think of dhcpd as serving on a particular NIC, but rather a particular subnet. 


Post a Comment

Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM