Koozali.org: home of the SME Server

How to have Server obtain IP from Router via DHCP?

RhoXS

How to have Server obtain IP from Router via DHCP?
« on: July 07, 2007, 04:20:59 PM »
I would like to use SME Server as the OS on a a series of consumer home servers.

It's intended that they be installed headless behind a hardware router in "server only" mode.

To make headless setup possible, the router must obtain its IP from the router DHCP server. The user is then instructed to ensure this IP is reserved in the router.

From that point forward the Server Manager should be available on any client machine.

Although assigning an unused IP to the server works, peripherals must be attached to it to make that assignment. I want to avoid this.

How do I have SME 7.1 get its lan IP via the router DHCP server?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to have Server obtain IP from Router via DHCP?
« Reply #1 on: July 07, 2007, 05:00:05 PM »
Quote from: "RhoXS"

How do I have SME 7.1 get its lan IP via the router DHCP server?


There's no provision in SME server for dynamic IP assignment. Servers need to have fixed addresses, so that they can be found by client machines.

RhoXS

Re: How to have Server obtain IP from Router via DHCP?
« Reply #2 on: July 07, 2007, 05:24:11 PM »
Not to be obtuse, but I fully understand that network servers need to have a stable IP. In a home environment, this is accomplished using DHCP reservation or setting the DHCP lease time to forever. In both cases, the router will associate the server's mac address with the IP address from then out.

I may try to install the CentOS 4.4 dhcp client and configure it via the command line.

Quote from: "CharlieBrady"
Quote from: "RhoXS"

How do I have SME 7.1 get its lan IP via the router DHCP server?


There's no provision in SME server for dynamic IP assignment. Servers need to have fixed addresses, so that they can be found by client machines.

RhoXS

SME Server has dhclient installed
« Reply #3 on: July 08, 2007, 04:25:53 PM »
SME Server 7.1 has dhclient installed. I can start DHCP manually by running /usr/sbin/dhclient.

It just doesn't have the dhcpcd daemon in the init.d directory.

Is starting the service as simple as copying dhcpcd to the init.d directory?
 
I've noticed that SME Server handles starting services a little different than standard linux distros...

SME Server would be perfect if I could get this running. It's a show stopper if I cannot.

My customers MUST be able to start and configure this server WITHOUT connecting peripherals (e.g. through Server-Manager)

Offline raem

  • *
  • 3,972
  • +4/-0
Re: SME Server has dhclient installed
« Reply #4 on: July 08, 2007, 11:54:03 PM »
RhoXS

Read the Developers Manual for details re the inner workings of sme server ie adding links to start services etc, the configuration database(s) & the templating system.
http://wiki.contribs.org/SME_Server:Documentation

Configuring a fixed internal IP for the server is done as part of the initial configuration (which is usually done at install time), which means at the console attached to the server.

If you create a "default" configuration (for every sme server) with a fixed local IP and DHCP turned on, then you can instruct your end users to do site specific configuration by attaching the server directly to a workstation (no network) with a crossover cable. The workstation will be able to talk to the server as it gets a IP allocated by the sme's DHCP server (temporary of course until it gets connected back to the normal network).

They can then do headless configuration using their workstation & Putty (they will need to install Putty on their workstation of course), login as admin, select Configure this server, and then change the local IP to suit their network and also disable the DHCP server (as it sounds like your router is the LAN's DHCP server).

Keep in mind that anything you MUST have, MUST therefore be worth expending some money on, so you may like to sponsor a developer to develop the functionality you require, perhaps as another option in the configuration setup screens. As Charlie says though, the concept you are asking for just doesn't make sense in a server ie a dynamically allocated IP.

I'd imagine it would be easy to ask your customers for their local IP range prior to shipment/deployment, and for you to enter a specific fixed IP in the sme server that is compatible with their site.
...

RhoXS

Thanks, Ray
« Reply #5 on: July 09, 2007, 11:43:48 PM »
Thanks, Ray, I appreciate the suggestions.

The issue is that these boxes are intended to be plug and play for home or small office users. Those users want something as simple to connect as an NAS...connect it, turn it on. They won't be happy with having to "pre-configure" the appliance, yet I wanted to offer them the flexibility to do more with it if they want to - something they don't get with an NAS.

Interestingly, I CAN manually ask SME Server to obtain an IP via DHCP by running /usr/sbin/dhclient...it works great. I just don't know how to start the daemon. SME Server has a unique directory structure and an unusual way of managing services, so it doesn't look to be as simple as dropping a CentOS daemon in the init.d directory.

You said:

Quote
Keep in mind that anything you MUST have, MUST therefore be worth expending some money on, so you may like to sponsor a developer to develop the functionality you require, perhaps as another option in the configuration setup screens. As Charlie says though, the concept you are asking for just doesn't make sense in a server ie a dynamically allocated IP.


As a matter of fact, the Microsoft Windows Home Server OS will have exactly this functionality and I will be able to purchase OEM copies...but I was hoping to implement an open source solution at lower cost than the soon to be released HP server. I am a low volume builder trying to beat MS to the punch. If I have to develop much, I lose my cost and timing advantage.

I actually had this configuration implemented in a previous life when all of my machines were Macs running OS X. It worked exceptionally well with one of the G4 Machines playing server to the rest. I was able to serve files, printers and web sites (using dynDNS).

The concept I'm asking for makes perfect sense when you consider that SOHO users generally use ONE router - and most of those routers are not capable of setting one connection static and the others dynamic. Additionally, if they want to use the server as a gateway between the DSL or Cable Modem, those devices also assign IPs via DHCP, so the server will be trying to connect to the WAN via DHCP.

The solution most implemented in consumer routers is DHCP reservation. Home users won't want to deal with the joys of setting up and managing static IPs on all of their machines.

I really liked the features and abilities of SME Server...Server Manager was just about perfect and setting "information bays" was an easy way to set up shares...very innovative. I was hoping a simple hack could be implemented to enable the already-installed DHCP client.

Looks like I may be headed to ubuntu server or perhaps debian, as both can be easily configured as DHCP desktops, then converted to servers. I really don't consider that solution to be anywhere near as good as getting SME working with DHCP, but it might be functional.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Thanks, Ray
« Reply #6 on: July 10, 2007, 12:17:45 AM »
Quote from: "RhoXS"
Additionally, if they want to use the server as a gateway between the DSL or Cable Modem, those devices also assign IPs via DHCP, so the server will be trying to connect to the WAN via DHCP.


SME server already works just fine obtaining its WAN IP address via DHCP.

Quote

I really liked the features and abilities of SME Server...Server Manager was just about perfect and setting "information bays" was an easy way to set up shares...very innovative. I was hoping a simple hack could be implemented to enable the already-installed DHCP client.


If SME server doesn't do exactly what you want, you are free to sponsor the development of the features you require to sell to your customers.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: SME Server has dhclient installed
« Reply #7 on: July 10, 2007, 12:24:58 AM »
Quote from: "RhoXS"

My customers MUST be able to start and configure this server WITHOUT connecting peripherals (e.g. through Server-Manager)


To access the Server manager they will need to know the server's IP address won't they? How will they know that address if it is not preconfigured and fixed?

Since you want something to be different, the place to start is a New Feature Request in the bug tracker. Please be sure to explain exactly what you expect the deployment scenario to be.

RhoXS

Re: SME Server has dhclient installed
« Reply #8 on: July 10, 2007, 01:45:52 AM »
Actually, no, they don't need to know the IP address to access the server manager. Inside the network, I've found that entering

Code: [Select]
https://<servername>/server-manager/

will bring up the server-manager login.

The ONLY reason we need to enable DHCP to begin with is to get the router to assign an IP to a headless unit so the user can then "lock" that IP in the router control panel.

While some routers will serve an IP address in their accepted range, they may not show it as a client. It is essentially "invisible" in the router user control panel. Since it is invisible, it is not available as choice to forward port requests to. Therefore, on some routers, the external web-server would be useless as http requests cannot be forwarded properly.

No IP needed. In any event, they will get it from the Router DHCP client list...they will have to do this to tell the Router which IP to reserve for which mac address.

I'll add the request.

Quote from: "CharlieBrady"
Quote from: "RhoXS"

My customers MUST be able to start and configure this server WITHOUT connecting peripherals (e.g. through Server-Manager)


To access the Server manager they will need to know the server's IP address won't they? How will they know that address if it is not preconfigured and fixed?

Since you want something to be different, the place to start is a New Feature Request in the bug tracker. Please be sure to explain exactly what you expect the deployment scenario to be.
[/code]

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Thanks, Ray
« Reply #9 on: July 10, 2007, 01:52:52 AM »
RhoXS

>...I CAN manually ask SME Server to obtain an IP via DHCP by
> running /usr/sbin/dhclient...I just don't know how to start the daemon

The Developer Manual explains how to start services and create links to run them at startup. You sound like you are willing/want to learn so go read it.

Charlie is prompting you to add a New Feature Request to the bugtracker, so go do that too. A "feature" like you are asking for, could well open up a new area of usage for sme server & expand it's deployment base & user community generally.
...

RhoXS

How to have Server obtain IP from Router via DHCP?
« Reply #10 on: July 10, 2007, 02:20:19 AM »
Quote
A "feature" like you are asking for, could well open up a new area of usage for sme server & expand it's deployment base & user community generally.


DHCP also opens up the possibility of a small, portable wireless server. Might work for households or offices that have few users and not a ton of demand. These users don't like to run ethernet cable and wireless is cheap.

I think you're quite right. I am not a programmer by any means and I found the Server manager to be easy enough to understand for general file serving duties. SME also allows the more technically savvy to get under the hood if they need more advanced services.

I really don't see home users using the email server or gateway features that much...routers are excellent gateways and they are cheap. But what do I know? Someone may come up with something novel in their living room...

I think home users want to easily backup and sync data. Some would like to host their own picture library (Gallery) or private jukebox (Jinzora). Joomla is very appealing to home and SOHO users. I used to post demos of PHP/MySQL stuff I wrote for potential clients (I'm a developer...not a programmer; no real code was actually harmed in the development of my apps  :wink: )

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: SME Server has dhclient installed
« Reply #11 on: July 10, 2007, 03:00:03 AM »
Quote from: "RhoXS"
Actually, no, they don't need to know the IP address to access the server manager. Inside the network, I've found that entering

Code: [Select]
https://<servername>/server-manager/

will bring up the server-manager login.


That most probably means that the client machine has obtained its DHCP lease from the SME server, and is using the SME server for DNS name resolution. That's not the scenario you're proposing to deploy, so we are back to square one.

Since "servername" is also set via the console, how do you propose that is set up in your "headless" deployment scenario?

RhoXS

Re: SME Server has dhclient installed
« Reply #12 on: July 10, 2007, 05:57:52 AM »
This is not correct as the unit was configured as a server only and DHCP Services were definitely turned OFF (I checked - dhcpd was not running). I'm not exactly sure WHY it worked - but it did. It could be that the system is set to resolve certain internal names? This request does NOT work from outside the LAN. Documentation alludes to this but doesn't come right out and say it.

I preset the server name as "myserver" before shipping (all units will be 'myserver'). This will be clearly noted on the "Quick Start" card provided with the unit. The user can change the name if he/she wants.

Again, it can also be retrieved from the Router's DHCP client table OR one could browse the Windows network on a client machine to get it...it should appear.

I cannot preset the IP as I can't predict how the router address scheme is setup. For example, a Linksys router usually defaults to 192.168.1.XX, while a Belkin router tends toward 192.168.2.XX. Of course, the users can have them set to whatever.

I have been reading the Developer Manual...haven't put it all together yet but getting there...trying to figure out how it gets turned on when the server is in gateway mode, then activate those functions for "server only" mode on the common eth0 interface.

Interestingly, SME has a complete DHCP client system, but restricts it to use on the eth card assigned to the WAN...it cannot be assigned to the same device as the LAN (although this is entirely practical as running the dhclient from the command line indicates). Starting these services also makes the dynDNS system (ddclient) available as well...an excellent feature for home users. ddclient is capable of retrieving the router's WAN address automatically...it's an excellent tool.

Quote from: "CharlieBrady"
Quote from: "RhoXS"
Actually, no, they don't need to know the IP address to access the server manager. Inside the network, I've found that entering

Code: [Select]
https://<servername>/server-manager/

will bring up the server-manager login.


That most probably means that the client machine has obtained its DHCP lease from the SME server, and is using the SME server for DNS name resolution. That's not the scenario you're proposing to deploy, so we are back to square one.

Since "servername" is also set via the console, how do you propose that is set up in your "headless" deployment scenario?

Offline idp_qbn

  • *****
  • 347
  • +0/-0
How to have Server obtain IP from Router via DHCP?
« Reply #13 on: July 30, 2007, 09:58:25 AM »
Hi,
On reading all this, I think the main difficulty is that you are describing your solution instead of your problem.

You seem to want to develop a technological solution to what is really a simple issue. I think you want to give your users a seamless install system....just plug it in and it works.

This can be achieved pretty simply since you communicate with your users.

They can tell you their network config details...I regularly get absolute beginners to supply me with that information over the phone when they seek help.

Get them to open a DOS box (Start/Run/cmd) and type ipconfig : this gives them the machine details(IP address/subnet mask/gateway address) so you can configure the SME box you send to have a fixed IP based on that information.

You would have to consult with them anyway to set up users on the SME box.

You must also do something about showing the users how to get to their home directories etc. So, in amongst all the consulting and communicating you have to do, setting the SME IP seems trivial.

In the documentation you supply, or the training you give, you must show some information about the system and how you set it up.

Remember that hypothetical bus that we may all get hit by one day.....leaving the users with a black box office system and no way to support it without documentation.

So, step back and think about what you want to achieve. You have a choice between hours of techo stuff or a few minutes of social engineering.

Good luck whichever way you go.

Cheers
Ian
___________________
Sydney, NSW, Australia

RhoXS

How to have Server obtain IP from Router via DHCP?
« Reply #14 on: July 31, 2007, 01:46:04 AM »
Quote
I think you want to give your users a seamless install system....just plug it in and it works.


Quite correct.

Quote
This can be achieved pretty simply since you communicate with your users.


Actually, I would prefer not to. I would prefer to sell an appliance...not my services.

"They can tell you their network config details...I regularly get absolute beginners to supply me with that information over the phone when they seek help.

Get them to open a DOS box (Start/Run/cmd) and type ipconfig : this gives them the machine details(IP address/subnet mask/gateway address) so you can configure the SME box you send to have a fixed IP based on that information. "

Most inexpensive home routers are not capable of supporting both DHCP and a Static address at the same time...generally all or nothing. Therefore, asking them to assign static IPs to their clients, which can vary, is not acceptable.

"You would have to consult with them anyway to set up users on the SME box. "

Why would I have to do that? Why couldn't they do this themselves?

"You must also do something about showing the users how to get to their home directories etc. So, in amongst all the consulting and communicating you have to do, setting the SME IP seems trivial. "

Again, I don't WANT to do consulting and communication...I want to sell an appliance that the user is capable of supporting themselves.

"Remember that hypothetical bus that we may all get hit by one day.....leaving the users with a black box office system and no way to support it without documentation. "

This is already being done by several companies at the level of a NAS. Black box systems that configure themselves do not NEED documentation. The Bubba home server appliance is an example. Microsoft's Windows Home Server will also be essentailly plug and play...and supported primarily by the purchaser.

For these systems, when something goes wrong, they just hit the reset button or reload the system and start fresh...

"So, step back and think about what you want to achieve. You have a choice between hours of techo stuff or a few minutes of social engineering. "

I've done exactly that - I've built a Debian based system that allows the user to connect it, turn it on, identify the IP from their router panel, then connect via an NX Client (provided on CD) to a full featured Gnome Desktop. From there, they can follow a few simple instructions using the Gnome gui to set up a few other things...

Additionally, the Gnome desktop give them the ability to allow someone (like me or another) to remote desktop into the same NX server to finish setup if needed.