Koozali.org: home of the SME Server

DHCP config

AidansDad

DHCP config
« on: February 06, 2007, 10:11:51 PM »
sme is running in my networks in a very specialized setup (too long to explain really) and I need run DHCP but pass out custom gateway and dnsserver information.  I used to do this with dhcp manager with 6.5 but am not sure how to do this with 7.  I looked into the templates in the dhcpd.conf template directory, but they appear to be perl scripts setting the values based on variables, and I don't really want to mess with them.

can I do this with db setprop commands.

help is appeciated as always.  

thanks.

p.s.  I know common sense says stay with 6.5 but 7 offers some other features which are really useful to me, and this dhcp issue is the only thing that's not ideal (for me) so 7 is a better option for me (if I can just edit the dhcp configuration)

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
Re: DHCP config
« Reply #1 on: February 06, 2007, 11:20:17 PM »
Quote from: "AidansDad"
p.s.  I know common sense says stay with 6.5 but 7 offers some other features which are really useful to me, and this dhcp issue is the only thing that's not ideal (for me) so 7 is a better option for me (if I can just edit the dhcp configuration)


On the contrary common sense says upgrade to 7 before you (eventualy) get hacked.
6 is discontinued.
"It should just work" if it doesn't report it. Thanks!

AidansDad

Re: DHCP config
« Reply #2 on: February 06, 2007, 11:25:36 PM »
Quote from: "bpivk"
Quote from: "AidansDad"
p.s.  I know common sense says stay with 6.5 but 7 offers some other features which are really useful to me, and this dhcp issue is the only thing that's not ideal (for me) so 7 is a better option for me (if I can just edit the dhcp configuration)


On the contrary common sense says upgrade to 7 before you (eventualy) get hacked.
6 is discontinued.


so no help on editing my dhcp scope config?

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
DHCP config
« Reply #3 on: February 07, 2007, 12:39:30 AM »
Sorry got no clue. You'll have to wait for charlie or gordon.
I just wanted to encurage you to update your sistem.  :)
"It should just work" if it doesn't report it. Thanks!

Offline raem

  • *
  • 3,972
  • +4/-0
Re: DHCP config
« Reply #4 on: February 07, 2007, 01:07:15 AM »
AidansDad

> sme is running in my networks in a very specialized setup
> (too long to explain really)....

How do you expect someone to suggest an answer when you won't even tell us what you want to do, in detail.


> I used to do this with dhcp manager with 6.5 but am not sure how to do this with 7.  

It would probably be done in a very similar way, the underlying design principles of sme are still the same between versions, although there may be particular version specific settings/code that affect the implementation.

Your starting point is to look at what the contrib did in sme 6.5 and see if that can be emulated in sme7.

If you give more specific detail, then a developer may be able to advise if that feature is already in sme7 using db commands or something else.
...

AidansDad

Re: DHCP config
« Reply #5 on: February 07, 2007, 01:42:00 AM »
Quote from: "RayMitchell"
AidansDad

> sme is running in my networks in a very specialized setup
> (too long to explain really)....

How do you expect someone to suggest an answer when you won't even tell us what you want to do, in detail.




because honestly it's not really important other than for my purposes I need to have the SME server pass out DHCP addresses with a different gateway and dns.

but if you really have to know.  I'm using the sme boxes as disaster recovery boxes. my windows servers are copying over mission critical files at specified intervals to the sme servers with the same share structure and printers are installed as well.  the sme box needs to pass out dhcp of half of my large scope with the same scope options as my windows boxes (dns gateway etc) so that if the windows server goes down and will be down for any substansial amount of time, my end users, can run software to re map their drives to the sme shares, and printers and will continue to get the correct dhcp scope configs for gateway etc.

I was in a rush earlier and didn't have time to type that all out when all I really need to do is change the dchp scope options on the sme box.
maybe I wasn't clear enough about that.
Quote


> I used to do this with dhcp manager with 6.5 but am not sure how to do this with 7.  

It would probably be done in a very similar way, the underlying design principles of sme are still the same between versions, although there may be particular version specific settings/code that affect the implementation.

Your starting point is to look at what the contrib did in sme 6.5 and see if that can be emulated in sme7.

If you give more specific detail, then a developer may be able to advise if that feature is already in sme7 using db commands or something else.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: DHCP config
« Reply #6 on: February 07, 2007, 04:13:51 AM »
Quote from: "AidansDad"

so no help on editing my dhcp scope config?


You can have anything you want in your dhcp configuration, via custom templates.

AidansDad

Re: DHCP config
« Reply #7 on: February 07, 2007, 04:45:10 AM »
Quote from: "CharlieBrady"
Quote from: "AidansDad"

so no help on editing my dhcp scope config?


You can have anything you want in your dhcp configuration, via custom templates.


right.

I looked at the template fragments in /etc/e-smith/templates/dhcpd.conf
and they are pearl scripted....so I wasn't really sure on how to change them. I was just looking for a little direction and perhaps a simple example of what I how I might change a fragment to say specify a custom gateway.

help is always appreciated.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: DHCP config
« Reply #8 on: February 07, 2007, 05:10:11 AM »
AidansDad

> I looked at the template fragments in /etc/e-smith/templates/dhcpd.conf
> .... I wasn't really sure on how to change them.

No 1 golden rule is NOT to change them.

Copy the required template fragment (& tree structure) to /etc/e-smith/templates-custom/dhcpd.conf/....
and edit the required fragment code, or create a new fragment if preferred. Then expand the template and restart the service. There are many examples of how to do this in the forums and in various howto's.

>...and perhaps a simple example of what I how I might change a fragment to say specify a custom gateway.

Can't help there, but you can experiment because if you break something with an incorrect custom fragment, then it's just a matter of deleting that custom fragment, expand template, restart service and your server is back the way it was.
Search the Dev Guide for more info, but you will need to sort out the coding required depending on your needs, that why I suggested looking at what the earlier sme6.5 contrib did.
...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: DHCP config
« Reply #9 on: February 07, 2007, 05:37:28 AM »
Quote from: "AidansDad"
... and perhaps a simple example of what I how I might change a fragment to say specify a custom gateway.


I can't think when you would need a custom gateway. When in server-gateway mode, the DHCP leases will suggest the SME server as the gateway. When in serveronly mode, the leases will specify whatever is configured as the default gateway. It's uncommon for there to be more than one gateway to the Internet from a LAN.

AidansDad

Re: DHCP config
« Reply #10 on: February 07, 2007, 12:28:58 PM »
Quote from: "RayMitchell"
AidansDad

> I looked at the template fragments in /etc/e-smith/templates/dhcpd.conf
> .... I wasn't really sure on how to change them.

No 1 golden rule is NOT to change them.

Copy the required template fragment (& tree structure) to /etc/e-smith/templates-custom/dhcpd.conf/....
and edit the required fragment code, or create a new fragment if preferred. Then expand the template and restart the service. There are many examples of how to do this in the forums and in various howto's.



that's actually what I meant.  once I copy the fragment to the custom section I'm not sure what to change.  it's all perl code, and by trade I'm not a programmer, though I can get around in VBS. but I have no perl experience

Quote

 can't think when you would need a custom gateway. When in server-gateway mode, the DHCP leases will suggest the SME server as the gateway. When in serveronly mode, the leases will specify whatever is configured as the default gateway. It's uncommon for there to be more than one gateway to the Internet from a LAN.


perhaps I don't but unless I can specify a custom DNS server, I have to tell sme that it doesn't have access to the internet at all because it makes so many dns requests through the default gateway to the internet it triggers our firewall (which I don't manage or have access too) to black list it's IP which means I end up having no access to these at remote sites. So I need to at least be able to edit the DNS fragment once it's in the custom templates.  And probably the wins one too.

obviously I guess I'm just going to have to figure this one out on my own   :roll:

AidansDad

DHCP config
« Reply #11 on: February 07, 2007, 02:48:15 PM »
sorted - I think

mosotho

DHCP Manager
« Reply #12 on: April 10, 2007, 06:07:18 PM »
I have a similar problem, I suspect that I have zombie machines at a customer site. One of the easy ways to stop these from accessing the net is remove the gateway or send them to a non functional gateway this way they cannot call home. But the users on the machines can still get normal internet access by going through the proxy configured in their browser settings.

Can you please share how your sorted your DHCP manager issues.

Offline jfarschman

  • *
  • 406
  • +0/-0
DHCP config
« Reply #13 on: April 10, 2007, 06:34:37 PM »
Aidan's Dad,

  I would take a look at the old templates-custom information.  You know the templates generate when installing the old 6.5 contrib.

  In general there should be a few templates added to the the mix... rather than a bunch of templates modified.  Since templates are generally small and build in alphanumeric order the idea is to add in what you need between two established (mainstream) templates.... and try not to modify anything unless you have to.

  Hopefully. You'll discover that it's easy.... but first you have to do a stare and compare to see what is different.

  I will add this... there is a command "rpm -qf /path/to/file" that can tell you what rpm owns a particular file.  You have to feed it the entire long, absolute path, but it's quite useful.

  Oh and when done can you post your results here.  I'll help interpret.  Others will too.  If you have the time to try, we have the time to help  :D
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com