LinuxQuestions.org
Register a domain and help support LQ
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 06-10-2008, 07:49 PM   #1
Srz0rz
LQ Newbie
 
Registered: Jun 2008
Location: Auckland, New Zealand
Distribution: Ubuntu, Debian
Posts: 11

Rep: Reputation: 0
Setting up a DHCP server with multiple network interfaces - Debian


Hi,

I am trying to set up a gateway/router/firewall box for a small business. The requirements for the job are that the box must serve up internet to the business and also to the apartment downstairs and I am having trouble configuring the DHCP server on the gateway.

The gateway has three Network Interface Cards:
eth0: which connects to the modem and the rest of the internet
eth1: which goes downstairs, to serve the apartment
eth2: which serves the small business
The DHCP server should assign all dynamic ip addresses to the downstairs network (eth1), in the range 192.168.0.0 - 192.168.0.255

The upstairs (business) should assign static ip addresses to the servers on the network and dynamically assign ip addresses to any other computers asking for a DHCP lease on the eht2 interface. The addresses assigned to this network should be in the range of 10.0.0.0 - 10.0.0.255

My problem is that computers connected to the 'eth1' interface do not receive an ip address. After connecting a computer to the eth1 interface the computer requests an ip address, but none comes.

NOTE: I am quite sure this is not a hardware fault, I have tested the system first with a crossover cable and a computer directly connected to the router interface and also with both computers connected to a switch using patch cables.

The contents of my /etc/dhcp3/dhcpd.conf file are as follows:

[Global Options]....

subnet 10.0.0.0 subnet 255.255.255.0 {
interface eth2;
option routers 10.0.0.254;
option subnet-mask 255.255.255.0;

option domain-name-servers 10.0.0.254;
}

subnet 192.168.0.0 subnet 255.255.255.0 {
interface eth1;
option routers 192.168.0.254;
option subnet-mask 255.255.255.0;

option domain-name-servers 192.168.0.1;
}

Any help with this would be much appreciated.
 
Old 06-11-2008, 03:48 AM   #2
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Quote:
subnet 10.0.0.0 subnet 255.255.255.0 {

interface eth2;
option routers 10.0.0.254;
option subnet-mask 255.255.255.0;

option domain-name-servers 10.0.0.254;

}

subnet 192.168.0.0 subnet 255.255.255.0 {

interface eth1;
option routers 192.168.0.254;
option subnet-mask 255.255.255.0;

option domain-name-servers 192.168.0.1;

}
Hi!
you've wrote subnet

Code:
subnet 192.168.0.0 subnet 255.255.255.0
where may be you wanted to wrote

Code:
subnet 192.168.0.0 netmask 255.255.255.0
Try correcting this. And may be you need to add an option like

Code:
range  192.168.0.50  192.168.0.100;
inside each subnet. If problem persists, come here again.

See you!!
emi
 
Old 06-11-2008, 05:35 PM   #3
Srz0rz
LQ Newbie
 
Registered: Jun 2008
Location: Auckland, New Zealand
Distribution: Ubuntu, Debian
Posts: 11

Original Poster
Rep: Reputation: 0
Hi, thanks for the quick reply. When I posted last time I didn't have the actual /etc/dhcp3/dhcpd.conf file at hand, which is why i made a mistake typing it out. Here is the actual file

Code:
##########################################
#####----- Global Configuration -----#####
##########################################
ddns-updates off;
option T150 code 150 = string;
deny client-updates;
#one-lease-per-client false;
#allow bootp;

ddns-update-style none;

option domain-name "vlan.local";
option domain-name-servers    210.56.15.1, 231.117.250.27;

default-lease-time 6000;
max-lease-time 7200;

authoritative;
##############################################
#####----- End Global Configuration -----#####
##############################################

###############################################
#####----- Start Modem Configuration -----#####
###############################################
subnet 192.168.1.0 netmask 255.255.255.0 {
	interface eth0;
}
#############################################
#####----- End Modem Configuration -----#####
#############################################

####################################################
#####----- Start Downstairs Configuration -----#####
####################################################
subnet 192.168.0.0 netmask 255.255.255.0 {
	interface eth1;
	default-lease-time 6000;
	max-lease-time 7200;
	option subnet-mask 255.255.255.0;
	option routers 192.168.0.254;
	option broadcast-address 192.168.0.255;
}
##################################################
#####----- End Downstairs Configuration -----#####
##################################################

##################################################
#####----- Start Upstairs Configuration -----#####
##################################################
subnet 10.0.0.0 netmask 255.255.255.0 {
	interface eth2;
	default-lease-time 6000;
	max-lease-time 7200;
	range 10.0.0.100 10.0.0.200;
	option subnet-mask 255.255.255.0;
	option routers 10.0.0.254;
	option broadcast-address 10.0.0.255;
}
################################################
#####----- End Upstairs Configuration -----#####
################################################

#####################################################################
#####----- Start Server and Fixed IP Address Configuration -----#####
#####################################################################
group{
	###--- Any global server settings should go here ---###

	#- Printer -#
	host printer {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.25;
		}
	#- J computer -#
	host j {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.105;					
	}
	#- TServer computer -#
	host tserver {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.110;
	}
	#- Windows 2008 Server -#
	host win2008server {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.115;
	}
	#- Asterisk Box -#
	host asterisk {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.120;
	}
	#- WWW Server -#
	host www2 {
		hardware ethernet 00:00:00:00:00:00;
		fixed-address 10.0.0.125;
	}
}
###################################################################
#####----- End Server and Fixed IP Address Configuration -----#####
###################################################################
NOTE: I have changed the ip addresses and zeroed out the MAC addresses of the interfaces. You should assume that each interface for the server section has a unique MAC address.

I have also tried adding the interfaces in the /etc/default/dhcp3-server file:
Code:
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1 eth2"
But still no luck getting it to work on the eth1 interface. I'm wondering whether the 'interface ethX' lines in each subnet stanza are recognized. Basically I'm just trying to say that any requests for dhcp leases coming from eth1 should get the 192.168.... subnet and any requests for dhcp leases coming from eth2 should get the 10.0.... subnet.
 
Old 06-11-2008, 07:21 PM   #4
Srz0rz
LQ Newbie
 
Registered: Jun 2008
Location: Auckland, New Zealand
Distribution: Ubuntu, Debian
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you emi_ramo! Adding the line 'range 192.168.0.200 192.168.0.253' to the 192.168.0.x subnet declaration worked. I can't believe it was that simple.
 
Old 06-12-2008, 04:48 AM   #5
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Me could'n, too, when I learned about dhcp on linux.

See you over here!!
emi
 
Old 06-08-2011, 11:33 PM   #6
askhawk
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Thumbs up Ubuntu dhcpd server

You are awsome
 
  


Reply

Tags
dhcp, gateway, interface, multiple, router


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
Debian, dhcp, and 2+ network interfaces chrisrees Linux - Newbie 3 02-15-2008 03:39 AM
setting up linux dhcp server with multiple scopes guy_ripper Linux - Server 7 07-09-2007 03:53 PM
[SOLVED] Debian multiple Loopback interfaces ? ionreflex Linux - Networking 1 10-02-2005 10:48 AM
Setting up a DHCP server w/ the server on a wireless network Ionexchange Linux - Wireless Networking 0 05-08-2004 10:56 AM
Manually specify network interfaces for DHCP NetAX Linux - Networking 1 04-22-2004 04:03 AM


All times are GMT -5. The time now is 03:28 PM.

Main Menu
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