Koozali.org: home of the SME Server

have backup DHCP Server?

WACOMalt

have backup DHCP Server?
« on: July 27, 2007, 03:58:35 AM »
Hey, I was wondering, my network is set up as follows:

internet
     |
cable modem
     |
wireless router
     |
4 computers (connected via WiFi)
and the SME server (server only mode, wired connection)


I know the proper setup would be all the computers set to use DHCP, the router's DHCP service turned off, and the Server's DHCP turned on.

problem is: if the server shuts down, then nobody on my network can get online until it's back on.

I need a way to have the SME server be propperly seen on my network (like it does if it is the DHCP server), but not kill everyone's internet if it shuts down.

any way to do this? I know there can only be one DHCP server at a time (not entirely true, as I had two at one time, router and SME, and everything was good as long as we restarted everything in the proper order)

but is there a way to do this a correct way? aka have the router be DHCP server only if the server is dead?

Offline p-jones

  • *
  • 594
  • +0/-0
have backup DHCP Server?
« Reply #1 on: July 27, 2007, 04:54:06 AM »
You pose some interesting points here and I will be interested in other responses. AFAIK there can only be one DHCP server on a network and there is just a much likeleyhood of the Router (with DHCP Server) going down as there is the SME Server going down so either way you are going to be screwed.

I implemented a crude workaround to this by creating a new template fragment which extended the DHCP lease time to about a week. I did this to allow  users to access a MSSQL database on a different box even if the SME/DHCP went down. This is only a partial workaround and has its own set of issues - like the lease doesnt survive a workstation reboot and a reboot is usually the first option in resolving a problem !

I think you showed only four PC's on the network. With that number, fixed IP's should be easily manageable. Also, If they are XP workstations I think there is an option in the TCP/IP settings to put in a fixed fallback IP/DNS/Gateway address although I have never tried using it.

As I stated, I am also interested in other comments on this.
...

Offline mmccarn

  • *
  • 2,656
  • +10/-0
have backup DHCP Server?
« Reply #2 on: July 27, 2007, 02:51:40 PM »
Most DHCP servers will refuse to start if they detect another DHCP server on the same network at startup.  This applies to several routers I've worked with, Novell's DHCPD and Microsoft's DHCP Server - so a backup dhcp server sounds like a tough project.

In what way can your workstations not find the SME if you use the DHCP on your router?  My first guess would be that you need to get the DHCP server on your router to hand out the SME server IP as the primary DNS server for DHCP clients, then they could 'find' it.

Of course, they should always be able to find it by IP address.  (less elegant, but it should work).

Also, if I'm right and you're basically having DNS problems when you use the router's DHCP, you could add your SME server IP and name to c:\windows\system32\drivers\etc\hosts on each workstation...

Offline p-jones

  • *
  • 594
  • +0/-0
have backup DHCP Server?
« Reply #3 on: July 27, 2007, 04:42:12 PM »
Quote
problem is: if the server shuts down, then nobody on my network can get online until it's back on.


because theworkstation IP leases cannot be renewed (and probably assume some 169.x.x.x address)
...

WACOMalt

have backup DHCP Server?
« Reply #4 on: July 28, 2007, 02:48:14 AM »
Quote from: "mmccarn"
... In what way can your workstations not find the SME if you use the DHCP on your router?  My first guess would be that you need to get the DHCP server on your router to hand out the SME server IP as the primary DNS server for DHCP clients, then they could 'find' it...

...Also, if I'm right and you're basically having DNS problems when you use the router's DHCP, you could add your SME server IP and name to c:\windows\system32\drivers\etc\hosts on each workstation...


My workstations can connect via IP, usually. (for some reason my SME cannot get online at all right now... hopefully temporary) But wacomalt.com never works, and they can never see it on the network from "My Network Places" for example.  what exactly would I put in the hosts file if, for example my server's IP is 192.168.1.12? and the domain I use is wacomalt.com?

Quote from: "p-jones"
I think you showed only four PC's on the network. With that number, fixed IP's should be easily manageable.

it would be, but would I have to make any changes to the actual computers themselves? or only make changes on the router? If the latter, I may do that. Basically, my server is in our apartment, and I am trying to have everything work with zero inconvenience to every body else who uses this network.

also we sometimes have friends over with their own laptops and stuff, and it would suck if I werent there, as no one else would know how to add their IPs to the network.

If I can make the server visible to the rest of the network (in "My Network Places") while having the DHCP service coming from the router, I think that would be my best bet. Any Ideas?

Offline p-jones

  • *
  • 594
  • +0/-0
have backup DHCP Server?
« Reply #5 on: July 28, 2007, 03:17:31 AM »
Quote
If I can make the server visible to the rest of the network (in "My Network Places") while having the DHCP service coming from the router, I think that would be my best bet. Any Ideas?


That would be you best option otherwise



Quote
problem is: if the server shuts down, then nobody on my network can get online until it's back on


Address this issue so your server doesnt shut down. Identify the issues that are making it shut down and deal to them. Replace/repair faulty hardware. If its a power issue then you router will probably shut down anyway.... I would be concerned if I had a server that just randomly shut down...
...

WACOMalt

have backup DHCP Server?
« Reply #6 on: July 28, 2007, 04:36:11 PM »
well,... it doesnt randomly shut down. but I am talking like.. restarts after upgrades etc. My room mates play World of Warcraft constantly. Though I think they need breaks, I doubt they would agree to that in the middle of a raid. (asking them every time I need to restart my server would be a beech if you know what I'm sayin')

Offline idp_qbn

  • *****
  • 347
  • +0/-0
have backup DHCP Server?
« Reply #7 on: July 28, 2007, 10:43:27 PM »
WACOmalt : your best bet is to set a longer lease for DHCP.

p-jones: can you publish your template fragment that extends the DHCP lease time to a week. I would like that, too.

With a longer lease time, the PCs on your home network should not even notice the SME box is down (unless they need to contact it as file server/web server - or you leave it down past their renewal time).

Good luck
Ian
___________________
Sydney, NSW, Australia

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
have backup DHCP Server?
« Reply #8 on: July 28, 2007, 11:52:58 PM »
Quote from: "idp_qbn"
WACOmalt : your best bet is to set a longer lease for DHCP.

p-jones: can you publish your template fragment that extends the DHCP lease time to a week. I would like that, too.

Ian


You do this via db setttings.  Have a look at config show dhcpd, notice the line  leasetime=86400, change it accordingly, then  signal-event remoteaccess-update, release and renew your ip and on a windows pc do a ipconfig /all and look at the lease obtained and lease expires lines.

John
......

Offline p-jones

  • *
  • 594
  • +0/-0
have backup DHCP Server?
« Reply #9 on: July 29, 2007, 05:12:41 AM »
Quote
p-jones: can you publish your template fragment that extends the DHCP lease time to a week.

 


/etc/e-smith/templates-custom/etc/dhcpd.conf

25LeaseTimeDefault
 default-lease-time          { 7*86400 };

I wasnt sure how to do it with the db setprop option so I did it this way.
Dont forget to expand the dhcpd.conf template

Peter

mrjhb3: When I ran that command all I got was

 config show dhcpd
dhcpd=service
    Bootp=deny
    end=192.168.2.155
    start=192.168.2.115
    status=enabled

hence, even if I could remember the command to do it, I figured it was not an option.
...

WACOMalt

have backup DHCP Server?
« Reply #10 on: July 29, 2007, 05:33:57 AM »
I I'll have a look at a bunch of this tomorrow, hopefully I can get a setup that works (with your guys' suggestions), and I will repost here as to my luck.

heck I don't care what I do as long as my windows PCs can see the server and drag files to it, the other computers on my network connect fine all the time, and the server is working from wacomalt.com (both inside and outside of the network)

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
have backup DHCP Server?
« Reply #11 on: July 29, 2007, 06:22:10 AM »
Quote from: "p-jones"

mrjhb3: When I ran that command all I got was

 config show dhcpd
dhcpd=service
    Bootp=deny
    end=192.168.2.155
    start=192.168.2.115
    status=enabled

hence, even if I could remember the command to do it, I figured it was not an option.


You are correct, I had some old db entries that I forgot to remove, but on my updated and test 7.2 servers, here is what I have.

rpm -q /etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeDefault  --whatprovides
e-smith-base-4.18.0-64.el4.sme
[root@www dhcpd.conf]# rpm -q /etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax  --whatprovides
e-smith-base-4.18.0-64.el4.sme
[root@www dhcpd.conf]# more 25LeaseTimeDefault
    default-lease-time          { 86400 };
[root@wwwj dhcpd.conf]# more 25LeaseTimeMax
    max-lease-time              { 7*86400 };

So, it looks now by default you will get a 1 week dhcp lease.

Sorry about the noise.

John
......