LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-25-2005, 11:44 PM   #1
hariiyer
Member
 
Registered: May 2004
Location: india
Posts: 103

Rep: Reputation: 15
dhcp with multiple nic


Dear all,

I have 2 lan cards, i want to configure DHCP server for both the cards like

1) one range is 192.168.1.10 to 192.168.1.55 (eth0) and the other range for (eth1) is 192.168.1 60 to 192.168.1.90.

Is it possible? if possible how to configure. I am using redhat 9 and whitebox.
 
Old 08-26-2005, 12:38 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
As far as I know you cannot bind the same network address to 2 nics, you would have to have to different network id's for it to function correctly:

192.168.1.0

and:

192.168.2.0

You need to edit the /etc/dhcpd.conf file, redhat may be in a different place, I use slackware for my setup. A simple configuration would look like this:

ddns-update-style interim;
shared-network domain {
option routers 192.168.1.1; # ---> this is static ip-address of eth0
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name "domain"; # Can be domain or workgroup name
option domain-name-servers 192.168.1.1;
default-lease-time 86400;
max-lease-time 604800;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.55;
}
}

ddns-update-style interim;
shared-network domain {
option routers 192.168.2.1; # ---> this is static ip-address of eth1
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option domain-name "domain"; # Can be domain or workgroup name
option domain-name-servers 192.168.2.1;
default-lease-time 86400;
max-lease-time 604800;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.60 192.168.2.90;
}
}

Although I have never tried 2 different cards with a dhcp server before
 
Old 08-26-2005, 12:52 AM   #3
n0sr
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255

Rep: Reputation: 34
Re: dhcp with multiple nic

Quote:
Originally posted by hariiyer
Dear all,

I have 2 lan cards, i want to configure DHCP server for both the cards like

1) one range is 192.168.1.10 to 192.168.1.55 (eth0) and the other range for (eth1) is 192.168.1 60 to 192.168.1.90.

Is it possible? if possible how to configure. I am using redhat 9 and whitebox.
Yes, this is possible, if you use dhcpcd, then just run it for each interface.
Code:
#dhcpcd eth0
#dhcpcd eth1
The DHCP server configuration will supply the IP address when each interface bids, so controlling what interface gets what IP address is strictly controlled by the DHCP server. (I believe you will have to configure to assign IP addresses according to the MAC of the bidding machine.)

fotoguy is correct in stating that you will be assigning address in the same network assuming your netmask is 255.255.255.0.

This is not a problem if you set up your routing correctly. In your routing table there is the ability to set the metric. This is an arbitrary number that assigns the priority to interfaces in the same network. So if eth0 has metric 1 and eth1 has metric 2, then eth0 will be used first. eth1 will not be used unless eth0 is down.

Sorry I haven't provided specific configuration steps (I use Slack also), but hopefully this will help point you in the right direction.
 
Old 08-26-2005, 03:44 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
it is to some extent possible...
2 options from what i know:

1) you can either bridge, and have 1 pool for both segments,

2) you can devide 192.168.1.x into 2 different subnets (which will do the job even better) example:

eth0:
address 192.168.1.1/25
network 192.168.1.0
broadcast 192.168.1.127

eth1:
address 192.168.1.129/25
network 192.168.1.128
broadcast 192.168.1.255

for the dhcp server you need to note the /25 sunet mask, which in the dhcp config file will look like 255.255.255.128
and the network address of the subnets is
for eth0: 192.168.1.0
for eth1: 192.168.1.128

enjoy :-)
 
Old 08-26-2005, 03:48 AM   #5
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
or do a /26 (255.255.255.192)
an you get
192.168.1.0-63 (where 0=network and 63=broadcast)
and
192.168.1.64=127 (again: 64=network and 127=broadcast)

network addresses are not usable as ip addresses and
broadcast addresses are not usable as ip addresses either

NOTE:
remember to setup the dhcp server as a router too, otherwise the 2 subnets will not be able to communicate with eachother... unless of course that is what you want :-)

Last edited by Nathanael; 08-26-2005 at 03:49 AM.
 
  


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
2 DHCP IPs, one NIC? lil_drummaboy Linux - Networking 1 10-24-2005 03:36 PM
DHCP problems - multiple DHCP servers sat86 Linux - Networking 4 10-02-2005 05:43 AM
Multiple addresses on one NIC via DHCP - possible? babzog Linux - Networking 0 03-25-2004 10:43 AM
nic/dhcp configuration humvee Linux - Newbie 4 10-07-2003 02:51 AM
Multiple IP on on NIC aceexpert Linux - General 3 05-28-2002 05:04 AM

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

All times are GMT -5. The time now is 12:10 PM.

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