LinuxQuestions.org
Help answer threads with 0 replies.
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 12-19-2001, 10:54 AM   #1
hawkpaul
Member
 
Registered: Nov 2001
Location: Black Mountain , NC
Distribution: Debian
Posts: 46

Rep: Reputation: 15
Unhappy DHCP server with multiple nics and subnets


Mine is a 2 part question. The first one is... After reading my second question... am I going about this in a way that seems crrect?

Ok here is the situation:

I am on the technology staff at a college and we are wanting to put in a Linux server to limit the bandwidth to the dorms (4).
So our students that are distance learning can actually get connected. Morpheus and Kaza ad all of their buddies are choking us to death.


We have decided that the best way to do it without limiting our faculty/staff network is to put the server in place where all of the fiber lines from the dorms connect to the network.

What I was hoping to do is to set up a Redhat Linux 7.3 Server with 5 network cards in it to act as a Router/DHCP Server/Bandwidth Limiter/Firewall.

My question is what is the best way to set up a DHCP server so it gives for example 10.20.1.10 through 10.20.1.100 to the machines contacting the dhcp server through one NIC and give 10.30.1.10 through 10.30.1.100 the machines conecting through one of the other NIC ....etc?


Thanks for your help

Paul
 
Old 12-19-2001, 12:05 PM   #2
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
whew, easy. I thought this was going to get into the actual bandwidth limiting. You're going to be running 5 seperate dhcp daemons, one per card, all with different dhcpd.conf files.

Say the dhcpd.conf file for the first subnet is named subnet1.conf, and has the following entry:

subnet 10.20.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.20.1.1;
option subnet-mask 255.255.255.0;

# option nis-domain "blahblah.edu";
# option domain-name "blahblah.edu";
option domain-name-servers 216.27.175.2,216.231.41.2; #don't use mine :P

option time-offset -5; # Eastern Standard Time
# option ntp-servers ;
# option netbios-name-servers 10.20.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 10.20.1.10 10.20.1.100;
# default-lease-time 21600;
# max-lease-time 43200;
}

man dhcpd and you'll get all the field options that are cool. To invoke:

/sbin/dhcpd ethx -cf /directoryhere/subnet1.conf

It will then report back that its listening for requests on the device. x of course stands for the numeric of the card, should be 0-4. Create a different file for each subnet, put the invoke commands in rc.local so it brings the dhcpd servers up at boot, hook it up to a UPS just in case, and then wall it off in a bathroom and forget about it.

-Cheers

Finegan
 
Old 12-19-2001, 12:26 PM   #3
hawkpaul
Member
 
Registered: Nov 2001
Location: Black Mountain , NC
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 15
Wink thanks

Thanks Finegan I will give it a whirl.... Then I will have to get into the badwidth limiting thing...
 
Old 12-19-2001, 02:52 PM   #4
hawkpaul
Member
 
Registered: Nov 2001
Location: Black Mountain , NC
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 15
Problems

I was able to write the config files and start up eth1 as a dhcp server but when I try the /sbin/dhcpd eth2 -cf /etc/subnet2.conf command it says that there is already a dhcp server running.

When I went ahead and put the commands one after another in my rc.local file it runs them but after the first one goes all of the rest go through it and give the error at the end that sya "dhcp server already running"

Is there a way I can start all of them at once pointing to diffrent configuration files?

Thanks


Paul
 
Old 12-19-2001, 04:49 PM   #5
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
I'm an idiot, I should have known better than to post on something I had only seen running and hadn't set up myself. Its not a matter of 5 config files and 5 dhcpd servers, but 1 server, 1 big config file, and some weird arguments to dhcpd. I have to look this up to be of any help and twidle with the man pages.

I really must apologize, but I really must have posted out my ass. I should have something worked out (and tested) by later this evening.

Cheers,

Finegan
 
Old 12-20-2001, 03:59 AM   #6
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
Okay, sorry for my egregious idiot attack before... the one dhcpd.conf file should have all of the subnet declarations in it. For instance:



subnet 10.20.1.0 netmask 255.255.255.0 {

# --- default gateway

option routers 10.20.1.1;

option subnet-mask 255.255.255.0;

option domain-name "blahblah.edu";

option domain-name-servers 216.27.175.2,216.231.41.2; #don't use mine :P

option time-offset -5; # Eastern Standard Time

range dynamic-bootp 10.20.1.10 10.20.1.100;

}

subnet 10.20.2.0 netmask 255.255.255.0 {

# --- default gateway

option routers 10.20.2.1;

option subnet-mask 255.255.255.0;

option domain-name "blahblah.edu";

option domain-name-servers 216.27.175.2,216.231.41.2; #don't use mine :P

option time-offset -5; # Eastern Standard Time

range dynamic-bootp 10.20.2.10 10.20.2.100;

}



To build this out of the all of those files I told you to build just do this:



cat subnet2.conf >> subnet1.conf

cat subnet3.conf >> subnet1.conf



blah blah blah repeat 3 times until all of the subnets are in the one conf file.



Make sure all of the NIC are ifconfig'd to have an address on the subnet they'll be serving addresses to. They of course, do not necessarily have to be the same address as the router you are specifying in the first field of each subnet declaration.



Then:



dhcpd eth0 eth1 eth2 eth3 eth4 -cf /wherever/subnet1.conf



The output should look something like this: (my test run was with 2 cards)



root@tenacious:~# dhcpd eth0 eth1 -cf /root/dhcpd.conf

Internet Software Consortium DHCP Server 2.0

Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.

All rights reserved.



Please contribute if you find this software useful.

For info, please visit http://www.isc.org/dhcp-contrib.html



Listening on LPF/eth1/7b:7b:7b:7b:7b:7b/192.168.1.0

Sending on LPF/eth1/7b:7b:7b:7b:7b:7b/192.168.1.0

Listening on LPF/eth0/00:a0:24:6b:18:95/192.168.0.0

Sending on LPF/eth0/00:a0:24:6b:18:95/192.168.0.0

Sending on Socket/fallback/fallback-net



There you go. Sorry for the confusion earlier man and the fact this took me a while to throw out... I had to go see Lord of the rings.



-Cheers



Finegan

Also, it just occured to me that you might want to post the second half of this questions to the security part of the forum as to what would be a solid iptables firewall rules-set that would at least be a solid firewall for forwarding... they might also be able to help you with bandwidth limiting on the typical kazaa, gnutella ports (63000-ish?). IPtables I know a little about, but I mastered chains and all my servers still run on 2.2 kernels (not broke, why fix?). Limiting I'm a babe in the woods. Make sure to be as specific as possible so as to keep the forum moderators from considering it a double post. (That's not a good thing around here.)

Last edited by finegan; 12-20-2001 at 04:52 AM.
 
Old 12-20-2001, 07:32 AM   #7
hawkpaul
Member
 
Registered: Nov 2001
Location: Black Mountain , NC
Distribution: Debian
Posts: 46

Original Poster
Rep: Reputation: 15
Smile Many Thanks

Thanks so much for all your help on this Finegan. Don't worry about the earlier post, I learned a few things from it.

I put all of the files into one file and started them all in rc.local and they work! All of them but my last nic wich happens to be ISA and I havent really verified that is has ever worked.

I'll check out some man pages and how-to's to see if there is anything special that should be done for an ISA nic.

Thanks so much again for your help.


Oh and by the way... I saw The Lord of The Rings last night as well. I would have to say that I was quite pleased.

Long live Frodo and Finegan!



Paul
 
  


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
One DHCP server serving 2 subnets scng Linux - Networking 3 07-12-2005 09:57 AM
DHCP server with two NICs Infernal211283 Linux - Networking 2 02-14-2005 03:51 PM
2 DHCP scopes 1 server 2 NICs DevZer0 Linux - Networking 1 09-27-2004 06:47 PM
how can i create subnets on dhcp server castify Linux - Networking 0 07-24-2003 03:13 AM
Multiple NICs Server Setup swa1 Linux - Software 2 07-26-2001 09:43 PM

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

All times are GMT -5. The time now is 06:38 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