LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-21-2009, 11:58 AM   #1
daveginorge
Member
 
Registered: Oct 2006
Location: Porsgrunn, Norway
Distribution: CentOS 5 / 6 / 7
Posts: 107

Rep: Reputation: 16
DHCP - 2 NICS & 2 Subnets


Hi All
I have been reading the post here for a long time and I still cannot get my brain around how to do this.

Senario. CentOS 5.3 box 2 NICS supplying 2 different LANS which should have 2 different IP ranges. Lan1 10.70.70.0 Lan2 192.168.1.0

Right now my DHCP server supplies Lan1 without problems and has done for years, now I wish to introduce Lan2 to the server and reconfigure the DHCPD.conf to allow the second range of addresses.

This code with subnet "Lan1" has been working for years

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 10.70.70.255;
option routers 10.70.70.1;
option domain-name-servers 10.70.70.1;
option domain-name "mydomain.no";

So now I would have the 2 subnets.

#Lan1 eth0
subnet 10.70.70.0 netmask 255.255.255.0 {
range 10.70.70.130 10.70.70.149;
}

#Lan2 eth3
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.130 192.168.1.149;
}

How do I bind the NICS eth0 and eth3 to their respective subnet. I can handle the routing in the iptables no problem, I just cannot work this out.

Thanks in advance.
 
Old 05-21-2009, 12:31 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You don't need to bind them, it knows what addresses it is listening on, but you'll need a different default gateway for the new subnet.
 
Old 05-21-2009, 01:12 PM   #3
daveginorge
Member
 
Registered: Oct 2006
Location: Porsgrunn, Norway
Distribution: CentOS 5 / 6 / 7
Posts: 107

Original Poster
Rep: Reputation: 16
Let me see if I get this.
What your saying is that if I create this as a script, the system will automatically configure the 1 subnet on each of the NIC's

Code:
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 10.70.70.255;
option routers 10.70.70.1, 192.168.1.1;
option domain-name-servers 10.70.70.1;
option domain-name "mydomain.no";

#Lan1 eth0
subnet 10.70.70.0 netmask 255.255.255.0 {
range 10.70.70.130 10.70.70.149;
}

#Lan2 eth3
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.130 192.168.1.149;
}
I'm hoping it is that easy
 
Old 05-22-2009, 01:59 AM   #4
daveginorge
Member
 
Registered: Oct 2006
Location: Porsgrunn, Norway
Distribution: CentOS 5 / 6 / 7
Posts: 107

Original Poster
Rep: Reputation: 16
Found the answer. Code posted for others in the future

Code:
default-lease-time 600;
max-lease-time 7200;

option domain-name "mydomain.no";


subnet 10.70.70.0 netmask 255.255.255.0 {
	option broadcast-address 10.70.70.255;
	option subnet-mask 255.255.255.0;
	option routers 10.70.70.1;
	option domain-name-servers 10.70.70.2, 10.70.70.1;
	range 10.70.70.130 10.70.70.149;
}

subnet 192.168.1.0 netmask 255.255.255.0 {
	option broadcast-address 192.168.1.255;
	option subnet-mask 255.255.255.0;
	option routers 192.168.1.1;
	option domain-name-servers 192.168.1.1;
	range 192.168.1.130 192.168.1.149;
}

ddns-update-style ad-hoc;
 
  


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
DHCP server having 2 subnets through 2 nics dils Linux - Newbie 2 05-21-2009 04:09 AM
Getting DHCP to allocate address for two different subnets on 2 nics GGlinux Linux - Networking 5 02-25-2009 08:10 PM
2 NICs & DHCP: 1 gets an address, 1 doesn't wesc78 Linux - Networking 5 05-14-2007 10:01 AM
DHCP for 2 subnets omlex Linux - Networking 11 03-04-2007 06:41 PM
DHCP server with multiple nics and subnets hawkpaul Linux - Networking 6 12-20-2001 07:32 AM

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

All times are GMT -5. The time now is 06:41 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
Open Source Consulting | Domain Registration