LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 05-16-2007, 03:53 PM   #1
vikyath
LQ Newbie
 
Registered: Jan 2006
Posts: 18

Rep: Reputation: 0
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
 
Old 05-16-2007, 08:26 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
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
 
Old 05-17-2007, 01:10 AM   #3
vikyath
LQ Newbie
 
Registered: Jan 2006
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
  


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
1 Linux Box 3 NICS SBN Linux - General 3 01-26-2007 10:45 AM
Linux setup as router / DHCP w/3+ NICs, separate but shared connectivity - question MetaTechi3 Linux - Networking 3 11-17-2006 12:41 PM
Linux Box w/ 2 NICs and passive firewall? rruss Linux - Networking 1 04-14-2005 09:15 AM
Linux Box with 3 NICs for Internet sharing digihall7 Linux - Networking 3 04-30-2004 04:30 AM
Box Linux with 3 NICs Marcelo Oliveir Linux - Networking 9 09-11-2003 02:12 PM


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