LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 DHCP on 2 NICs on a single Linux box (https://www.linuxquestions.org/questions/linux-networking-3/2-dhcp-on-2-nics-on-a-single-linux-box-554431/)

vikyath 05-16-2007 02:53 PM

2 DHCP on 2 NICs on a single Linux box
 
Hi,

I have been on the net like crazy to get a answer to this. Let me tell my requirements
I want to configure 2 DHCP servers on a linux box (RHEL 3). I have 2 NICs confiugured with 2 separate subnets. Bot the NICs are up. I would like to know if there is a possibilty of having 2 DHCPs on a single linux box. I had read in one of the articles about creating a separate space for a different subnet.

Following are my system config:
eth0 Link encap:Ethernet HWaddr 00:02:55:B7:A1:F5
inet addr:192.23.83.2 Bcast:192.23.83.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:282031 errors:0 dropped:0 overruns:0 frame:0
TX packets:208375 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:148973373 (142.0 Mb) TX bytes:40919438 (39.0 Mb)
Interrupt:22

eth1 Link encap:Ethernet HWaddr 00:02:55:B7:A1:F6
inet addr:192.23.84.2 Bcast:192.23.84.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:116 errors:0 dropped:0 overruns:0 frame:0
TX packets:12228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7474 (7.2 Kb) TX bytes:782592 (764.2 Kb)
Interrupt:23


My dhcpd.conf reads as follows:
--------------------------------------------------------------------
ddns-update-style ad-hoc;
option wpad-curl code 252 = text;
subnet 192.23.83.0 netmask 255.255.255.0 {
option nis-domain "x";
option nis-servers 197.95.25.15;
option routers 192.23.83.1;
option subnet-mask 255.255.255.0;
option domain-name "x.x.com";
option domain-name-servers 197.95.25.1;
option ntp-servers 197.95.25.1;
default-lease-time 86400;
max-lease-time 604800;
range 192.23.83.50 192.23.83.250;
}

subnet 192.23.84.0 netmask 255.255.255.0 {
option nis-domain "x";
option nis-servers 197.95.25.15;
option routers 192.23.84.1;
option subnet-mask 255.255.255.0;
option domain-name "x.x.com";
option domain-name-servers 197.95.25.1;
option ntp-servers 197.95.25.1;
------------------------------------------------------------------
Let me know if this is the right way to go about or do am i missing out something.

Thanks in advance
Vikyath

osor 05-16-2007 07:26 PM

The path I would take is to have two separate instances of dhcpd running (with two separate dhcpd.conf files). You can pass the conf file at the command line:
Code:

$ sudo dhcpd -cf /etc/dhcpd/dhcpd.eth0.conf eth0
$ sudo dhcpd -cf /etc/dhcpd/dhcpd.eth1.conf eth1


vikyath 05-17-2007 12:10 AM

Hi,

I get the following message when i try to run the 2nd instance:

$ sudo dhcpd -cf /etc/dhcpd.eth1.conf eth1

Internet Systems Consortium DHCP Server V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.
Listening on LPF/eth1/00:02:55:b7:a1:f6/192.23.84.0/24
Sending on LPF/eth1/00:02:55:b7:a1:f6/192.23.84.0/24
Sending on Socket/fallback/fallback-net
----------------------------------------------------------------
whereas the first insatnce seems to run fine:

$ sudo dhcpd -cf /etc/dhcpd.eth0.conf eth0

Internet Systems Consortium DHCP Server V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 71 leases to leases file.
Listening on LPF/eth0/00:02:55:b7:a1:f5/192.23.83.0/24
Sending on LPF/eth0/00:02:55:b7:a1:f5/192.23.83.0/24
Sending on Socket/fallback/fallback-net
------------------------------------------------------------------

Is there any configuration changes to be made to the original dhcpd.conf file, because if i try to mv that file the dhcp will not be recognised as in i cannot start/stop/restart the service.

Thanks,
Vikyath


All times are GMT -5. The time now is 02:08 AM.