LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-15-2012, 04:25 PM   #1
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 21
dhcp3 and mysql


I have ubuntu 10.04 LTS dhcp servers.

I have a mysql table of customers with a flag for if their cable modem is in bridge mode or route mode. I want to give all router modems a public ip address. I want to give all bridge modems a private 10.x.x.x ip, because whatever is behind the bridge will be getting the public ip, and I dont want all the cable modems eating away at my public ip space.

Is there any way to make dhcp3-server interface with mysql for such a purpose?

The only solution I can think of is using cron jobs to write a chunk of config to be included by dhcpd.conf. It would have to set a huge list of mac's to some dhcp3 class, where I can allow or deny in a shared-subnet with 2 sets (public and private) of pools. I'd like to accomplish this in real time by making dhcp3-server look this info up in mysql when it gets the request, possibly by setting a class. Is this possible?
 
Old 02-16-2012, 10:43 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,944

Rep: Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671
Quote:
Originally Posted by suprstar View Post
I have ubuntu 10.04 LTS dhcp servers.

I have a mysql table of customers with a flag for if their cable modem is in bridge mode or route mode. I want to give all router modems a public ip address. I want to give all bridge modems a private 10.x.x.x ip, because whatever is behind the bridge will be getting the public ip, and I dont want all the cable modems eating away at my public ip space.

Is there any way to make dhcp3-server interface with mysql for such a purpose?

The only solution I can think of is using cron jobs to write a chunk of config to be included by dhcpd.conf. It would have to set a huge list of mac's to some dhcp3 class, where I can allow or deny in a shared-subnet with 2 sets (public and private) of pools. I'd like to accomplish this in real time by making dhcp3-server look this info up in mysql when it gets the request, possibly by setting a class. Is this possible?
You can use dnsmasq for doling out DHCP addresses, and it can be used with a MySQL backend:

http://thekelleys.org.uk/dnsmasq/doc.html
http://tournasdimitrios1.wordpress.c...ices-on-linux/
(old, but may be useful) http://www.howtoforge.com/mydns_mydn...on_ubuntu_edgy

May not be exactly what you're looking for, though.
 
Old 02-21-2012, 08:19 AM   #3
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Original Poster
Rep: Reputation: 21
Thanks, that looks interesting, but I see it's targeted at small lan's with up to 500 clients. This is for an ISP so scalability will probably be an issue..

I have this working in my lab environment:

Code:
class "BRIDGE" {
        match hardware;
}
subclass "BRIDGE" 1:00:16:7e:20:9d:38;
subclass "BRIDGE" 1:00:16:7e:70:31:82;
subclass "BRIDGE" 1:00:16:7e:4f:1a:a1;
subclass "BRIDGE" 1:00:16:7e:a7:b3:bf;
subclass "BRIDGE" 1:00:16:7e:92:ba:7f;
subclass "BRIDGE" 1:00:16:7e:c3:65:31;
...
All those subclass lines are written to a file and included by dhcpd.conf. I'm concerned how well this scales up as well - I could possibly have tens of thousands of mac's listed here. Is there going to be a performance problem? I have a quad core xeon 2.4GHz/8MB cache cpu and 8gb ram in each server. Each server is doing mainly dns and dhcp for the customers. Load levels are currently acceptable, adding this kind of config wouldn't have a big impact on performance would it?

Last edited by suprstar; 02-21-2012 at 08:32 AM.
 
Old 02-21-2012, 10:45 AM   #4
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,944

Rep: Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671Reputation: 2671
Quote:
Originally Posted by suprstar View Post
Thanks, that looks interesting, but I see it's targeted at small lan's with up to 500 clients. This is for an ISP so scalability will probably be an issue..

I have this working in my lab environment:

Code:
class "BRIDGE" {
        match hardware;
}
subclass "BRIDGE" 1:00:16:7e:20:9d:38;
subclass "BRIDGE" 1:00:16:7e:70:31:82;
subclass "BRIDGE" 1:00:16:7e:4f:1a:a1;
subclass "BRIDGE" 1:00:16:7e:a7:b3:bf;
subclass "BRIDGE" 1:00:16:7e:92:ba:7f;
subclass "BRIDGE" 1:00:16:7e:c3:65:31;
...
All those subclass lines are written to a file and included by dhcpd.conf. I'm concerned how well this scales up as well - I could possibly have tens of thousands of mac's listed here. Is there going to be a performance problem? I have a quad core xeon 2.4GHz/8MB cache cpu and 8gb ram in each server. Each server is doing mainly dns and dhcp for the customers. Load levels are currently acceptable, adding this kind of config wouldn't have a big impact on performance would it?
Honestly, I can't answer that. The biggest DHCP environment I've ever managed was for about 2,500 on a corporate LAN. You're trying to slay a different dragon.

If it was me, though, I'd implement it in a lab, and see how it goes, and watch the trends on load.
 
  


Reply

Tags
dhcp, dhcp3, dhcpd, dhcpdconf, mysql


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
setting up dhcp3-server 10.04.4 {davros} Ubuntu 18 09-01-2011 03:50 PM
subneting + dhcp3 sudoku Linux - Networking 7 06-23-2010 04:03 PM
DHCP3 Not handing out leases dpeterson3 Linux - Networking 4 05-12-2010 01:12 PM
Setup dhcp3 realnoname Linux - Networking 4 03-21-2008 03:41 PM
dhcp3-client ph33r Linux - Networking 1 05-19-2002 11:24 PM


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